aboutsummaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-02-26 16:59:48 +0000
committerWerner Koch <[email protected]>1999-02-26 16:59:48 +0000
commit694099b9af96d53ad4a4f9bc70e08c2f393f9f4e (patch)
treeff5ddc557b85093cbf4076374bd43b2e958ce804 /g10/mainproc.c
parentSee ChangeLog: Thu Feb 25 18:47:39 CET 1999 Werner Koch (diff)
downloadgnupg-694099b9af96d53ad4a4f9bc70e08c2f393f9f4e.tar.gz
gnupg-694099b9af96d53ad4a4f9bc70e08c2f393f9f4e.zip
See ChangeLog: Fri Feb 26 17:55:41 CET 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r--g10/mainproc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index fa90d003e..7f3d3745e 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -178,10 +178,13 @@ proc_pubkey_enc( CTX c, PACKET *pkt )
c->last_was_session_key = 1;
enc = pkt->pkt.pubkey_enc;
/*printf("enc: encrypted by a pubkey with keyid %08lX\n", enc->keyid[1] );*/
+ /* Hmmm: why do I have this algo check here - anyway there is
+ * function to check it. */
if( is_ELGAMAL(enc->pubkey_algo)
|| enc->pubkey_algo == PUBKEY_ALGO_DSA
|| is_RSA(enc->pubkey_algo) ) {
- if ( !c->dek ) {
+ if ( !c->dek && ((!enc->keyid[0] && !enc->keyid[1])
+ || !seckey_available( enc->keyid )) ) {
c->dek = m_alloc_secure( sizeof *c->dek );
if( (result = get_session_key( enc, c->dek )) ) {
/* error: delete the DEK */