}
/**
* get_fingerprint - Given a public key returns the fingerprint.
* @publickey: The key to calculate the id for.
}
/**
* get_fingerprint - Given a public key returns the fingerprint.
* @publickey: The key to calculate the id for.
* @len: The length of the returned fingerprint.
*
* This function returns the fingerprint for a given public key. As Type 3
* fingerprints are 16 bytes and Type 4 are 20 the len field indicates
* which we've returned.
*/
* @len: The length of the returned fingerprint.
*
* This function returns the fingerprint for a given public key. As Type 3
* fingerprints are 16 bytes and Type 4 are 20 the len field indicates
* which we've returned.
*/
- log_assert(fingerprint != NULL);
- log_assert(len != NULL);
+ if (fingerprint == NULL)
+ return ONAK_E_INVALID_PARAM;
+ if (len == NULL)
+ return ONAK_E_INVALID_PARAM;
* get_packetid - Given a PGP packet returns the keyid.
* @packet: The packet to calculate the id for.
*/
* get_packetid - Given a PGP packet returns the keyid.
* @packet: The packet to calculate the id for.
*/
- for (keyid = 0, i = 0; i < 8; i++) {
- keyid <<= 8;
- keyid += packet->data[offset++];
+ for (*keyid = 0, i = 0; i < 8; i++) {
+ *keyid <<= 8;
+ *keyid += packet->data[offset++];
- logthing(LOGTHING_NOTICE,
- "Type 2 or 3 key, but not RSA: %llx (type %d)",
- keyid,
- packet->data[7]);
+ return ONAK_E_INVALID_PKT;
{
struct openpgp_packet_list *packets = NULL, *list_end = NULL;
struct openpgp_packet_list *curpacket;
{
struct openpgp_packet_list *packets = NULL, *list_end = NULL;
struct openpgp_packet_list *curpacket;
md5_digest(&md5_context, 16, (uint8_t *) &hash->hash);
free_packet_list(packets);
md5_digest(&md5_context, 16, (uint8_t *) &hash->hash);
free_packet_list(packets);