Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 34504
Collapse All | Expand All

(-)getkey.c (+12 lines)
Lines 1655-1660 Link Here
1655
        if ( x ) /* mask it down to the actual allowed usage */
1655
        if ( x ) /* mask it down to the actual allowed usage */
1656
            key_usage &= x; 
1656
            key_usage &= x; 
1657
    }
1657
    }
1658
1659
    /* Type 20 Elgamal keys are not usable. */
1660
    if(pk->pubkey_algo==PUBKEY_ALGO_ELGAMAL)
1661
      key_usage=0;
1662
1658
    pk->pubkey_usage = key_usage;
1663
    pk->pubkey_usage = key_usage;
1659
1664
1660
    if ( !key_expire_seen ) {
1665
    if ( !key_expire_seen ) {
Lines 1869-1874 Link Here
1869
        if ( x ) /* mask it down to the actual allowed usage */
1874
        if ( x ) /* mask it down to the actual allowed usage */
1870
            key_usage &= x; 
1875
            key_usage &= x; 
1871
    }
1876
    }
1877
1878
    /* Type 20 Elgamal subkeys or any subkey on a type 20 primary are
1879
       not usable. */
1880
    if(mainpk->pubkey_algo==PUBKEY_ALGO_ELGAMAL
1881
       || subpk->pubkey_algo==PUBKEY_ALGO_ELGAMAL)
1882
      key_usage=0;
1883
1872
    subpk->pubkey_usage = key_usage;
1884
    subpk->pubkey_usage = key_usage;
1873
    
1885
    
1874
    p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_EXPIRE, NULL);
1886
    p = parse_sig_subpkt (sig->hashed, SIGSUBPKT_KEY_EXPIRE, NULL);
(-)keygen.c (-17 lines)
Lines 958-965 Link Here
958
    tty_printf(    _("   (%d) DSA (sign only)\n"), 2 );
958
    tty_printf(    _("   (%d) DSA (sign only)\n"), 2 );
959
    if( addmode )
959
    if( addmode )
960
	tty_printf(    _("   (%d) ElGamal (encrypt only)\n"), 3 );
960
	tty_printf(    _("   (%d) ElGamal (encrypt only)\n"), 3 );
961
    if (opt.expert)
962
        tty_printf(    _("   (%d) ElGamal (sign and encrypt)\n"), 4 );
963
    tty_printf(    _("   (%d) RSA (sign only)\n"), 5 );
961
    tty_printf(    _("   (%d) RSA (sign only)\n"), 5 );
964
    if (addmode)
962
    if (addmode)
965
        tty_printf(    _("   (%d) RSA (encrypt only)\n"), 6 );
963
        tty_printf(    _("   (%d) RSA (encrypt only)\n"), 6 );
Lines 989-1009 Link Here
989
	    algo = PUBKEY_ALGO_RSA;
987
	    algo = PUBKEY_ALGO_RSA;
990
            *r_usage = PUBKEY_USAGE_SIG;
988
            *r_usage = PUBKEY_USAGE_SIG;
991
	    break;
989
	    break;
992
	}
993
	else if( algo == 4 && opt.expert)
994
	  {
995
	    tty_printf(_(
996
"The use of this algorithm is only supported by GnuPG.  You will not be\n"
997
"able to use this key to communicate with PGP users.  This algorithm is also\n"
998
"very slow, and may not be as secure as the other choices.\n"));
999
1000
	    if( cpr_get_answer_is_yes("keygen.algo.elg_se",
1001
				      _("Create anyway? ")))
1002
	      {
1003
		algo = PUBKEY_ALGO_ELGAMAL;
1004
		*r_usage = PUBKEY_USAGE_ENC | PUBKEY_USAGE_SIG;
1005
		break;
1006
	      }
1007
	}
990
	}
1008
	else if( algo == 3 && addmode ) {
991
	else if( algo == 3 && addmode ) {
1009
	    algo = PUBKEY_ALGO_ELGAMAL_E;
992
	    algo = PUBKEY_ALGO_ELGAMAL_E;

Return to bug 34504