Changeset View
Changeset View
Standalone View
Standalone View
b/g10/mainproc.c
Context not available. | |||||
/*** Local prototypes. ***/ | /*** Local prototypes. ***/ | ||||
static int do_proc_packets (CTX c, iobuf_t a); | static int do_proc_packets (ctrl_t ctrl, CTX c, iobuf_t a); | ||||
static void list_node (CTX c, kbnode_t node); | static void list_node (CTX c, kbnode_t node); | ||||
static void proc_tree (CTX c, kbnode_t node); | static void proc_tree (CTX c, kbnode_t node); | ||||
static int literals_seen; | static int literals_seen; | ||||
Context not available. | |||||
static void | static void | ||||
proc_pubkey_enc (CTX c, PACKET *pkt) | proc_pubkey_enc (ctrl_t ctrl, CTX c, PACKET *pkt) | ||||
{ | { | ||||
PKT_pubkey_enc *enc; | PKT_pubkey_enc *enc; | ||||
int result = 0; | int result = 0; | ||||
Context not available. | |||||
else | else | ||||
{ | { | ||||
c->dek = xmalloc_secure_clear (sizeof *c->dek); | c->dek = xmalloc_secure_clear (sizeof *c->dek); | ||||
if ((result = get_session_key (enc, c->dek))) | if ((result = get_session_key (ctrl, enc, c->dek))) | ||||
{ | { | ||||
/* Error: Delete the DEK. */ | /* Error: Delete the DEK. */ | ||||
xfree (c->dek); | xfree (c->dek); | ||||
Context not available. | |||||
c->ctrl = ctrl; | c->ctrl = ctrl; | ||||
c->anchor = anchor; | c->anchor = anchor; | ||||
rc = do_proc_packets (c, a); | rc = do_proc_packets (ctrl, c, a); | ||||
xfree (c); | xfree (c); | ||||
return rc; | return rc; | ||||
Context not available. | |||||
c->signed_data.used = !!signedfiles; | c->signed_data.used = !!signedfiles; | ||||
c->sigfilename = sigfilename; | c->sigfilename = sigfilename; | ||||
rc = do_proc_packets ( c, a ); | rc = do_proc_packets (ctrl, c, a); | ||||
/* If we have not encountered any signature we print an error | /* If we have not encountered any signature we print an error | ||||
messages, send a NODATA status back and return an error code. | messages, send a NODATA status back and return an error code. | ||||
Context not available. | |||||
c->signed_data.data_names = NULL; | c->signed_data.data_names = NULL; | ||||
c->signed_data.used = (signed_data_fd != -1); | c->signed_data.used = (signed_data_fd != -1); | ||||
rc = do_proc_packets ( c, a ); | rc = do_proc_packets (ctrl, c, a); | ||||
/* If we have not encountered any signature we print an error | /* If we have not encountered any signature we print an error | ||||
messages, send a NODATA status back and return an error code. | messages, send a NODATA status back and return an error code. | ||||
Context not available. | |||||
c->ctrl = ctrl; | c->ctrl = ctrl; | ||||
c->anchor = anchor; | c->anchor = anchor; | ||||
c->encrypt_only = 1; | c->encrypt_only = 1; | ||||
rc = do_proc_packets (c, a); | rc = do_proc_packets (ctrl, c, a); | ||||
xfree (c); | xfree (c); | ||||
return rc; | return rc; | ||||
} | } | ||||
Context not available. | |||||
static int | static int | ||||
do_proc_packets (CTX c, iobuf_t a) | do_proc_packets (ctrl_t ctrl, CTX c, iobuf_t a) | ||||
{ | { | ||||
PACKET *pkt; | PACKET *pkt; | ||||
int rc = 0; | int rc = 0; | ||||
Context not available. | |||||
{ | { | ||||
switch (pkt->pkttype) | switch (pkt->pkttype) | ||||
{ | { | ||||
case PKT_PUBKEY_ENC: proc_pubkey_enc (c, pkt); break; | case PKT_PUBKEY_ENC: proc_pubkey_enc (ctrl, c, pkt); break; | ||||
case PKT_SYMKEY_ENC: proc_symkey_enc (c, pkt); break; | case PKT_SYMKEY_ENC: proc_symkey_enc (c, pkt); break; | ||||
case PKT_ENCRYPTED: | case PKT_ENCRYPTED: | ||||
case PKT_ENCRYPTED_MDC: proc_encrypted (c, pkt); break; | case PKT_ENCRYPTED_MDC: proc_encrypted (c, pkt); break; | ||||
Context not available. | |||||
case PKT_SIGNATURE: newpkt = add_signature (c, pkt); break; | case PKT_SIGNATURE: newpkt = add_signature (c, pkt); break; | ||||
case PKT_SYMKEY_ENC: proc_symkey_enc (c, pkt); break; | case PKT_SYMKEY_ENC: proc_symkey_enc (c, pkt); break; | ||||
case PKT_PUBKEY_ENC: proc_pubkey_enc (c, pkt); break; | case PKT_PUBKEY_ENC: proc_pubkey_enc (ctrl, c, pkt); break; | ||||
case PKT_ENCRYPTED: | case PKT_ENCRYPTED: | ||||
case PKT_ENCRYPTED_MDC: proc_encrypted (c, pkt); break; | case PKT_ENCRYPTED_MDC: proc_encrypted (c, pkt); break; | ||||
case PKT_PLAINTEXT: proc_plaintext (c, pkt); break; | case PKT_PLAINTEXT: proc_plaintext (c, pkt); break; | ||||
Context not available. | |||||
break; | break; | ||||
case PKT_USER_ID: newpkt = add_user_id (c, pkt); break; | case PKT_USER_ID: newpkt = add_user_id (c, pkt); break; | ||||
case PKT_SIGNATURE: newpkt = add_signature (c, pkt); break; | case PKT_SIGNATURE: newpkt = add_signature (c, pkt); break; | ||||
case PKT_PUBKEY_ENC: proc_pubkey_enc (c, pkt); break; | case PKT_PUBKEY_ENC: proc_pubkey_enc (ctrl, c, pkt); break; | ||||
case PKT_SYMKEY_ENC: proc_symkey_enc (c, pkt); break; | case PKT_SYMKEY_ENC: proc_symkey_enc (c, pkt); break; | ||||
case PKT_ENCRYPTED: | case PKT_ENCRYPTED: | ||||
case PKT_ENCRYPTED_MDC: proc_encrypted (c, pkt); break; | case PKT_ENCRYPTED_MDC: proc_encrypted (c, pkt); break; | ||||
Context not available. |