* pkclist.c (build_pk_list): Do not allow an empty PK list in interactive
authorDavid Shaw <dshaw@jabberwocky.com>
Thu, 27 Nov 2003 14:47:00 +0000 (14:47 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Thu, 27 Nov 2003 14:47:00 +0000 (14:47 +0000)
mode.

* getkey.c (get_seckey_byname2): Disallow use of sign+encrypt Elgamal
keys.

g10/ChangeLog
g10/getkey.c
g10/pkclist.c

index 8e74aaa..df26e07 100644 (file)
@@ -1,10 +1,13 @@
 2003-11-27  David Shaw  <dshaw@jabberwocky.com>
 
+       * pkclist.c (build_pk_list): Do not allow an empty PK list in
+       interactive mode.
+
        * keygen.c (ask_algo): Remove ability to generate Elgamal
        sign+encrypt keys.
 
-       * getkey.c (merge_selfsigs_main, merge_selfsigs_subkey): Disallow
-       use of sign+encrypt Elgamal keys.
+       * getkey.c (merge_selfsigs_main, merge_selfsigs_subkey,
+       get_seckey_byname2): Disallow use of sign+encrypt Elgamal keys.
 
 2003-11-20  David Shaw  <dshaw@jabberwocky.com>
 
index d1be8e5..477ba9e 100644 (file)
@@ -1055,7 +1055,11 @@ get_seckey_byname2( GETKEY_CTX *retctx,
        ctx.items[0].mode = KEYDB_SEARCH_MODE_FIRST;
        rc = lookup( &ctx, &kb, 1 );
         if (!rc && sk )
-            sk_from_block ( &ctx, sk, kb );
+         {
+           sk_from_block ( &ctx, sk, kb );
+           if(sk->pubkey_algo==PUBKEY_ALGO_ELGAMAL)
+             rc=G10ERR_UNU_SECKEY;
+         }
         release_kbnode ( kb );
        get_seckey_end( &ctx );
     }
index e289acb..7a9ac81 100644 (file)
@@ -880,7 +880,8 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned use )
        char *answer=NULL;
        STRLIST backlog=NULL;
 
-       any_recipients = 1;
+       if(pk_list)
+         any_recipients = 1;
        def_rec = default_recipient();
        have_def_rec = !!def_rec;
        if( !have_def_rec )