Fixed return values of several functions (e.g. return FALSE for pointer types).
This commit is contained in:
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
chunk_create(iv, aead->get_iv_size(aead)), NULL))
|
chunk_create(iv, aead->get_iv_size(aead)), NULL))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "aead integrity check failed!\n");
|
fprintf(stderr, "aead integrity check failed!\n");
|
||||||
return FALSE;
|
return 1;
|
||||||
}
|
}
|
||||||
if (limit && ++i == limit)
|
if (limit && ++i == limit)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ static bool get_bool_attribute(private_imc_agent_t *this, TNC_ConnectionID id,
|
|||||||
return this->get_attribute &&
|
return this->get_attribute &&
|
||||||
this->get_attribute(this->id, id, attribute_id, 4, buf, &len) ==
|
this->get_attribute(this->id, id, attribute_id, 4, buf, &len) ==
|
||||||
TNC_RESULT_SUCCESS && len == 1 && *buf == 0x01;
|
TNC_RESULT_SUCCESS && len == 1 && *buf == 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read a string attribute
|
* Read a string attribute
|
||||||
|
|||||||
@@ -398,7 +398,7 @@ agent_private_key_t *agent_private_key_open(key_type_t type, va_list args)
|
|||||||
}
|
}
|
||||||
if (!path)
|
if (!path)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT(this,
|
INIT(this,
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ static private_key_t *parse_private_key(chunk_t blob)
|
|||||||
}
|
}
|
||||||
if (!pgp_read_scalar(&packet, 1, &version))
|
if (!pgp_read_scalar(&packet, 1, &version))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return NULL;
|
||||||
}
|
}
|
||||||
switch (version)
|
switch (version)
|
||||||
{
|
{
|
||||||
@@ -166,7 +166,7 @@ static private_key_t *parse_private_key(chunk_t blob)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DBG1(DBG_LIB, "PGP packet version V%d not supported", version);
|
DBG1(DBG_LIB, "PGP packet version V%d not supported", version);
|
||||||
return FALSE;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!pgp_read_scalar(&packet, 4, &created))
|
if (!pgp_read_scalar(&packet, 4, &created))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -441,14 +441,14 @@ pgp_cert_t *pgp_cert_load(certificate_type_t type, va_list args)
|
|||||||
if (!parse_signature(this, packet))
|
if (!parse_signature(this, packet))
|
||||||
{
|
{
|
||||||
destroy(this);
|
destroy(this);
|
||||||
return FALSE;
|
return NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PGP_PKT_USER_ID:
|
case PGP_PKT_USER_ID:
|
||||||
if (!parse_user_id(this, packet))
|
if (!parse_user_id(this, packet))
|
||||||
{
|
{
|
||||||
destroy(this);
|
destroy(this);
|
||||||
return FALSE;
|
return NULL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -531,7 +531,7 @@ METHOD(plugin_loader_t, load_plugins, bool,
|
|||||||
if (snprintf(file, sizeof(file), "%s/libstrongswan-%s.so",
|
if (snprintf(file, sizeof(file), "%s/libstrongswan-%s.so",
|
||||||
path, token) >= sizeof(file))
|
path, token) >= sizeof(file))
|
||||||
{
|
{
|
||||||
return NULL;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (!load_plugin(this, token, file) && critical)
|
if (!load_plugin(this, token, file) && critical)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1492,7 +1492,7 @@ end:
|
|||||||
if (hasher == NULL)
|
if (hasher == NULL)
|
||||||
{
|
{
|
||||||
DBG1(DBG_ASN, " unable to create hash of certificate, SHA1 not supported");
|
DBG1(DBG_ASN, " unable to create hash of certificate, SHA1 not supported");
|
||||||
return NULL;
|
return FALSE;
|
||||||
}
|
}
|
||||||
hasher->allocate_hash(hasher, this->encoding, &this->encoding_hash);
|
hasher->allocate_hash(hasher, this->encoding, &this->encoding_hash);
|
||||||
hasher->destroy(hasher);
|
hasher->destroy(hasher);
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ static int custom_fmt_cb(Vstr_base *base, size_t pos, Vstr_fmt_spec *fmt_spec)
|
|||||||
{
|
{
|
||||||
vstr_add_buf(base, pos, buf, written);
|
vstr_add_buf(base, pos, buf, written);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user