1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

See ChangeLog: Thu Jul 27 12:01:00 CEST 2000 Werner Koch

This commit is contained in:
Werner Koch 2000-07-27 10:01:27 +00:00
parent 8bd661db8c
commit a2ad808d1f
11 changed files with 131 additions and 3 deletions

View file

@ -219,8 +219,17 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
write_status_text( STATUS_ENC_TO, buf );
}
if( is_ELGAMAL(enc->pubkey_algo)
if( !opt.list_only && opt.override_session_key ) {
/* It does not make nuch sense to store the session key in
* secure memory because it has already been passed on the
* command line and the GCHQ knows about it */
c->dek = m_alloc( sizeof *c->dek );
result = get_override_session_key ( c->dek, opt.override_session_key );
if ( result ) {
m_free(c->dek); c->dek = NULL;
}
}
else if( is_ELGAMAL(enc->pubkey_algo)
|| enc->pubkey_algo == PUBKEY_ALGO_DSA
|| is_RSA(enc->pubkey_algo) ) {
if ( !c->dek && ((!enc->keyid[0] && !enc->keyid[1])
@ -246,6 +255,15 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
else if( !result ) {
if( opt.verbose > 1 )
log_info( _("public key encrypted data: good DEK\n") );
if ( opt.show_session_key ) {
int i;
char *buf = m_alloc ( 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 { /* store it for later display */
struct kidlist_item *x = m_alloc( sizeof *x );