diff options
author | Werner Koch <[email protected]> | 1998-10-25 19:00:01 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1998-10-25 19:00:01 +0000 |
commit | 5ccb92591e5ff9cf90efeb5ef527cf7a5fb08fcf (patch) | |
tree | 241529d030ede38fcdaee1a708c5956693ed159d /g10/mainproc.c | |
parent | Epxerimenta support for GDBM keyings. (diff) | |
download | gnupg-5ccb92591e5ff9cf90efeb5ef527cf7a5fb08fcf.tar.gz gnupg-5ccb92591e5ff9cf90efeb5ef527cf7a5fb08fcf.zip |
some random changes
Diffstat (limited to '')
-rw-r--r-- | g10/mainproc.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c index 7980c22dc..a075f836f 100644 --- a/g10/mainproc.c +++ b/g10/mainproc.c @@ -180,11 +180,12 @@ proc_pubkey_enc( CTX c, PACKET *pkt ) if( is_ELGAMAL(enc->pubkey_algo) || enc->pubkey_algo == PUBKEY_ALGO_DSA || is_RSA(enc->pubkey_algo) ) { - m_free(c->dek ); /* paranoid: delete a pending DEK */ - c->dek = m_alloc_secure( sizeof *c->dek ); - if( (result = get_session_key( enc, c->dek )) ) { - /* error: delete the DEK */ - m_free(c->dek); c->dek = NULL; + if ( !c->dek ) { + c->dek = m_alloc_secure( sizeof *c->dek ); + if( (result = get_session_key( enc, c->dek )) ) { + /* error: delete the DEK */ + m_free(c->dek); c->dek = NULL; + } } } else @@ -716,13 +717,6 @@ do_proc_packets( CTX c, IOBUF a ) c->iobuf = a; init_packet(pkt); while( (rc=parse_packet(a, pkt)) != -1 ) { - /* cleanup if we have an illegal data structure */ - if( c->dek && pkt->pkttype != PKT_ENCRYPTED ) { - /* FIXME: do we need to ave it in case we have no secret - * key for one of the next reciepents- we should check it - * here. */ - m_free(c->dek); c->dek = NULL; /* burn it */ - } if( rc ) { free_packet(pkt); |