1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-02-22 19:58:29 +01:00

Add pubkey letters e and E for ECC.

This does not mean we have any kind of ECC support now.  It is merely
to avoid printing a question mark for the algorithm.

Trailing white space changes as usual.
This commit is contained in:
Werner Koch 2011-07-01 10:21:08 +02:00
parent fc1680abdf
commit 04b0b050ff
7 changed files with 216 additions and 199 deletions

View File

@ -1196,6 +1196,8 @@ write_header( IOBUF out, int ctb, u32 len )
static int
write_sign_packet_header( IOBUF out, int ctb, u32 len )
{
(void)ctb;
/* work around a bug in the pgp read function for signature packets,
* which are not correctly coded and silently assume at some
* point 2 byte length headers.*/
@ -1305,6 +1307,8 @@ write_new_header( IOBUF out, int ctb, u32 len, int hdrlen )
static int
write_version( IOBUF out, int ctb )
{
(void)ctb;
if( iobuf_put( out, 3 ) )
return -1;
return 0;

View File

@ -754,11 +754,13 @@ classify_user_id( const char *name, KEYDB_SEARCH_DESC *desc )
static int
skip_unusable(void *dummy,u32 *keyid,PKT_user_id *uid)
skip_unusable(void *dummy, u32 *keyid,PKT_user_id *uid)
{
int unusable=0;
KBNODE keyblock;
(void)dummy;
keyblock=get_pubkeyblock(keyid);
if(!keyblock)
{

View File

@ -3088,7 +3088,9 @@ main (int argc, char **argv )
if(opt.def_cipher_algo==0 &&
(ascii_strcasecmp(def_cipher_string,"idea")==0
|| ascii_strcasecmp(def_cipher_string,"s1")==0))
{
idea_cipher_warn(1);
}
xfree(def_cipher_string); def_cipher_string = NULL;
if( check_cipher_algo(opt.def_cipher_algo) )
log_error(_("selected cipher algorithm is invalid\n"));

View File

@ -636,6 +636,8 @@ keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved)
{
int rc;
(void)reserved;
if (!hd)
return G10ERR_INV_ARG;

View File

@ -51,6 +51,8 @@ pubkey_letter( int algo )
case PUBKEY_ALGO_ELGAMAL_E: return 'g';
case PUBKEY_ALGO_ELGAMAL: return 'G' ;
case PUBKEY_ALGO_DSA: return 'D' ;
case PUBKEY_ALGO_ECDSA: return 'E' ; /* ECC DSA (sign only) */
case PUBKEY_ALGO_ECDH: return 'e' ; /* ECC DH (encrypt only) */
default: return '?';
}
}

View File

@ -264,7 +264,9 @@ symkey_decrypt_seskey( DEK *dek, byte *seskey, size_t slen )
resulted in a garbage algorithm byte, but it's close enough since
a bogus byte here will fail later. */
if(dek->algo==CIPHER_ALGO_IDEA)
{
idea_cipher_warn(0);
}
memcpy(dek->key, seskey + 1, dek->keylen);

View File

@ -47,8 +47,11 @@
#define PUBKEY_ALGO_RSA_S 3 /* RSA sign only */
#define PUBKEY_ALGO_ELGAMAL_E 16 /* encrypt only ElGamal (but not for v3)*/
#define PUBKEY_ALGO_DSA 17
#define PUBKEY_ALGO_ECDH 18
#define PUBKEY_ALGO_ECDSA 19
#define PUBKEY_ALGO_ELGAMAL 20 /* sign and encrypt elgamal */
#define PUBKEY_USAGE_SIG 1 /* key is good for signatures */
#define PUBKEY_USAGE_ENC 2 /* key is good for encryption */
#define PUBKEY_USAGE_CERT 4 /* key is also good to certify other keys*/