mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
gpg: Kludge not to bail out on ECC if build with Libgcrypt 1.6.
* g10/misc.c (print_pubkey_algo_note): Map the algo. (openpgp_pk_test_algo, openpgp_pk_test_algo2): Ditto. (pubkey_get_npkey, pubkey_get_nskey, pubkey_get_nsig) (pubkey_get_nenc): Return 0 for ECC algorithms. -- Libgcrypt 1.6 features algorithm 18 (generic ECC). Because of the missing mapping and no real support for the OpenPGP ECC format, this led to parsing errors of ECC packets. We better better explicitly tell gpg that we ECC is not supported. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
7cae002b0c
commit
1f842011f6
43
g10/misc.c
43
g10/misc.c
@ -297,7 +297,7 @@ print_pubkey_algo_note( int algo )
|
||||
{
|
||||
warn=1;
|
||||
log_info (_("WARNING: using experimental public key algorithm %s\n"),
|
||||
gcry_pk_algo_name (algo));
|
||||
gcry_pk_algo_name (map_pk_openpgp_to_gcry (algo)));
|
||||
}
|
||||
}
|
||||
else if (algo == 20)
|
||||
@ -442,7 +442,7 @@ openpgp_pk_test_algo( int algo )
|
||||
|
||||
if (algo < 0 || algo > 110)
|
||||
return gpg_error (GPG_ERR_PUBKEY_ALGO);
|
||||
return gcry_pk_test_algo (algo);
|
||||
return gcry_pk_test_algo (map_pk_openpgp_to_gcry (algo));
|
||||
}
|
||||
|
||||
int
|
||||
@ -460,7 +460,8 @@ openpgp_pk_test_algo2( int algo, unsigned int use )
|
||||
if (algo < 0 || algo > 110)
|
||||
return gpg_error (GPG_ERR_PUBKEY_ALGO);
|
||||
|
||||
return gcry_pk_algo_info (algo, GCRYCTL_TEST_ALGO, NULL, &use_buf);
|
||||
return gcry_pk_algo_info (map_pk_openpgp_to_gcry (algo),
|
||||
GCRYCTL_TEST_ALGO, NULL, &use_buf);
|
||||
}
|
||||
|
||||
int
|
||||
@ -1324,9 +1325,16 @@ pubkey_get_npkey( int algo )
|
||||
{
|
||||
size_t n;
|
||||
|
||||
/* ECC is special in that domain parameters are given by an OID. */
|
||||
if (algo == PUBKEY_ALGO_ECDSA)
|
||||
return 0; /* We don't support the key format. */
|
||||
else if (algo == PUBKEY_ALGO_ECDH)
|
||||
return 0; /* We don't support the key format. */
|
||||
|
||||
if (algo == GCRY_PK_ELG_E)
|
||||
algo = GCRY_PK_ELG;
|
||||
if (gcry_pk_algo_info( algo, GCRYCTL_GET_ALGO_NPKEY, NULL, &n))
|
||||
if (gcry_pk_algo_info (map_pk_openpgp_to_gcry (algo),
|
||||
GCRYCTL_GET_ALGO_NPKEY, NULL, &n))
|
||||
n = 0;
|
||||
return n;
|
||||
}
|
||||
@ -1337,9 +1345,16 @@ pubkey_get_nskey( int algo )
|
||||
{
|
||||
size_t n;
|
||||
|
||||
/* ECC is special in that domain parameters are given by an OID. */
|
||||
if (algo == PUBKEY_ALGO_ECDSA)
|
||||
return 0; /* We don't support the key format. */
|
||||
else if (algo == PUBKEY_ALGO_ECDH)
|
||||
return 0; /* We don't support the key format. */
|
||||
|
||||
if (algo == GCRY_PK_ELG_E)
|
||||
algo = GCRY_PK_ELG;
|
||||
if (gcry_pk_algo_info( algo, GCRYCTL_GET_ALGO_NSKEY, NULL, &n ))
|
||||
if (gcry_pk_algo_info (map_pk_openpgp_to_gcry (algo),
|
||||
GCRYCTL_GET_ALGO_NSKEY, NULL, &n ))
|
||||
n = 0;
|
||||
return n;
|
||||
}
|
||||
@ -1350,9 +1365,16 @@ pubkey_get_nsig( int algo )
|
||||
{
|
||||
size_t n;
|
||||
|
||||
/* ECC is special. */
|
||||
if (algo == PUBKEY_ALGO_ECDSA)
|
||||
return 0; /* We don't support the key format. */
|
||||
else if (algo == PUBKEY_ALGO_ECDH)
|
||||
return 0;
|
||||
|
||||
if (algo == GCRY_PK_ELG_E)
|
||||
algo = GCRY_PK_ELG;
|
||||
if (gcry_pk_algo_info( algo, GCRYCTL_GET_ALGO_NSIGN, NULL, &n))
|
||||
if (gcry_pk_algo_info (map_pk_openpgp_to_gcry (algo),
|
||||
GCRYCTL_GET_ALGO_NSIGN, NULL, &n))
|
||||
n = 0;
|
||||
return n;
|
||||
}
|
||||
@ -1363,9 +1385,16 @@ pubkey_get_nenc( int algo )
|
||||
{
|
||||
size_t n;
|
||||
|
||||
/* ECC is special. */
|
||||
if (algo == PUBKEY_ALGO_ECDSA)
|
||||
return 0;
|
||||
else if (algo == PUBKEY_ALGO_ECDH)
|
||||
return 0; /* We don't support the key format. */
|
||||
|
||||
if (algo == GCRY_PK_ELG_E)
|
||||
algo = GCRY_PK_ELG;
|
||||
if (gcry_pk_algo_info( algo, GCRYCTL_GET_ALGO_NENCR, NULL, &n ))
|
||||
if (gcry_pk_algo_info (map_pk_openpgp_to_gcry (algo),
|
||||
GCRYCTL_GET_ALGO_NENCR, NULL, &n ))
|
||||
n = 0;
|
||||
return n;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user