Changeset View
Changeset View
Standalone View
Standalone View
gnupg-2.0.18-showtrunc/g10/mainproc.c
| Context not available. | |||||
| if( !result ) | if( !result ) | ||||
| result = decrypt_data( c, pkt->pkt.encrypted, c->dek ); | result = decrypt_data( c, pkt->pkt.encrypted, c->dek ); | ||||
| /* If told to show the session key, try even on failed operations */ | |||||
| if(opt.show_session_key && c->dek != NULL && c->dek->keylen > 0) | |||||
| { | |||||
| int i; | |||||
| char *buf = xmalloc ( c->dek->keylen*2 + 20 ); | |||||
| sprintf ( buf, "%d:", c->dek->algo ); | |||||
| for(i=0; i < c->dek->keylen; i++ ) | |||||
| sprintf(buf+strlen(buf), "%02X", c->dek->key[i] ); | |||||
| log_info( "session key: `%s'\n", buf ); | |||||
| write_status_text ( STATUS_SESSION_KEY, buf ); | |||||
| } | |||||
| if( result == -1 ) | if( result == -1 ) | ||||
| ; | ; | ||||
| else if( !result || (gpg_err_code (result) == GPG_ERR_BAD_SIGNATURE | else if( !result || (gpg_err_code (result) == GPG_ERR_BAD_SIGNATURE | ||||
| Context not available. | |||||
| write_status( STATUS_GOODMDC ); | write_status( STATUS_GOODMDC ); | ||||
| else if(!opt.no_mdc_warn) | else if(!opt.no_mdc_warn) | ||||
| log_info (_("WARNING: message was not integrity protected\n")); | log_info (_("WARNING: message was not integrity protected\n")); | ||||
| if(opt.show_session_key) | |||||
| { | |||||
| int i; | |||||
| char *buf = xmalloc ( c->dek->keylen*2 + 20 ); | |||||
| sprintf ( buf, "%d:", c->dek->algo ); | |||||
| for(i=0; i < c->dek->keylen; i++ ) | |||||
| sprintf(buf+strlen(buf), "%02X", c->dek->key[i] ); | |||||
| log_info( "session key: `%s'\n", buf ); | |||||
| write_status_text ( STATUS_SESSION_KEY, buf ); | |||||
| } | |||||
| } | } | ||||
| else if( result == G10ERR_BAD_SIGN ) { | else if( result == G10ERR_BAD_SIGN ) { | ||||
| log_error(_("WARNING: encrypted message has been manipulated!\n")); | log_error(_("WARNING: encrypted message has been manipulated!\n")); | ||||
| Context not available. | |||||