* It's a signature packet. Add it to either the public
* key, to the current UID or the current subkey.
*/
* It's a signature packet. Add it to either the public
* key, to the current UID or the current subkey.
*/
if (curkey->subkeys != NULL) {
ADD_PACKET_TO_LIST_END(curkey->last_subkey,
sig,
if (curkey->subkeys != NULL) {
ADD_PACKET_TO_LIST_END(curkey->last_subkey,
sig,
- log_assert(curkey != NULL);
- log_assert(curkey->subkeys == NULL);
+ if (curkey == NULL)
+ return ONAK_E_INVALID_PARAM;
+ if (curkey->subkeys != NULL)
+ return ONAK_E_INVALID_PARAM;
ADD_PACKET_TO_LIST_END(curkey,
uid,
packet_dup(packets->packet));
ADD_PACKET_TO_LIST_END(curkey,
uid,
packet_dup(packets->packet));
ADD_PACKET_TO_LIST_END(curkey,
subkey,
packet_dup(packets->packet));
ADD_PACKET_TO_LIST_END(curkey,
subkey,
packet_dup(packets->packet));
* packet stream and reads the packets into a linked list of packets
* ready for parsing as a public key or whatever.
*/
* packet stream and reads the packets into a linked list of packets
* ready for parsing as a public key or whatever.
*/
curpacket->packet->length += 192;
} else if (curpacket->packet->length > 223 &&
curpacket->packet->length < 255) {
curpacket->packet->length += 192;
} else if (curpacket->packet->length > 223 &&
curpacket->packet->length < 255) {
* This function uses putchar_func to write characters to an OpenPGP
* packet stream from a linked list of packets.
*/
* This function uses putchar_func to write characters to an OpenPGP
* packet stream from a linked list of packets.
*/
putchar_func(ctx, 1, &curchar);
} else if (packets->packet->length > 8382 &&
packets->packet->length < 0xFFFFFFFF) {
putchar_func(ctx, 1, &curchar);
} else if (packets->packet->length > 8382 &&
packets->packet->length < 0xFFFFFFFF) {