aboutsummaryrefslogtreecommitdiffstats
path: root/sm/encrypt.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2023-10-24 12:51:16 +0000
committerWerner Koch <[email protected]>2023-10-24 12:54:26 +0000
commit2c3c049fd8a001dc9937e5ac3884831b6e25d2da (patch)
treef660641ea621ee4bb29ebd01b103a9bb91d88b13 /sm/encrypt.c
parentsm: Flag Brainpool curves as compliant. (diff)
downloadgnupg-2c3c049fd8a001dc9937e5ac3884831b6e25d2da.tar.gz
gnupg-2c3c049fd8a001dc9937e5ac3884831b6e25d2da.zip
sm: Flag Brainpool curves as compliant for all other operations.
* sm/fingerprint.c (gpgsm_get_key_algo_info2): Rename to (gpgsm_get_key_algo_info): this. Remove the old wrapper. Adjust all callers. * sm/decrypt.c (gpgsm_decrypt): Pass the curve to the compliance checker. * sm/encrypt.c (gpgsm_encrypt): Ditto. * sm/sign.c (gpgsm_sign): Ditto. * sm/verify.c (gpgsm_verify): Ditto. -- GnuPG-bug-id: 6253
Diffstat (limited to 'sm/encrypt.c')
-rw-r--r--sm/encrypt.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sm/encrypt.c b/sm/encrypt.c
index 6e78a0620..024f48673 100644
--- a/sm/encrypt.c
+++ b/sm/encrypt.c
@@ -758,11 +758,12 @@ gpgsm_encrypt (ctrl_t ctrl, certlist_t recplist, int data_fd, estream_t out_fp)
unsigned char *encval;
unsigned int nbits;
int pk_algo;
+ char *curve = NULL;
/* Check compliance. */
- pk_algo = gpgsm_get_key_algo_info (cl->cert, &nbits);
+ pk_algo = gpgsm_get_key_algo_info (cl->cert, &nbits, &curve);
if (!gnupg_pk_is_compliant (opt.compliance, pk_algo, 0,
- NULL, nbits, NULL))
+ NULL, nbits, curve))
{
char kidstr[10+1];
@@ -777,9 +778,12 @@ gpgsm_encrypt (ctrl_t ctrl, certlist_t recplist, int data_fd, estream_t out_fp)
/* Fixme: When adding ECC we need to provide the curvename and
* the key to gnupg_pk_is_compliant. */
if (compliant
- && !gnupg_pk_is_compliant (CO_DE_VS, pk_algo, 0, NULL, nbits, NULL))
+ && !gnupg_pk_is_compliant (CO_DE_VS, pk_algo, 0, NULL, nbits, curve))
compliant = 0;
+ xfree (curve);
+ curve = NULL;
+
rc = encrypt_dek (dek, cl->cert, pk_algo, &encval);
if (rc)
{