Skip to content

Commit 6bc53d8

Browse files
committed
engine: Do not report errors if libica does not support EC key
In case EC key creation using libica fails (for whatever reason), and the software fallback is used to perform the operation, do not report the errors that have been put to the error stack by the failing attempt to use libica. Fixes: a462093 Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
1 parent 85b8c52 commit 6bc53d8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/engine/ibmca_ec.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ int ibmca_ecdh_compute_key(unsigned char **pout, size_t *poutlen,
337337
}
338338

339339
/* Create ICA_EC_KEY object for private key */
340+
ERR_set_mark();
340341
ica_privkey = ibmca_ec_make_and_cache_ica_key((EC_KEY*)ecdh, &privlen);
342+
ERR_pop_to_mark();
341343
if (ica_privkey == NULL) {
342344
/* This curve is not supported by libica. */
343345
#ifdef OLDER_OPENSSL
@@ -502,7 +504,9 @@ ECDSA_SIG *ibmca_ecdsa_sign_sig(const unsigned char *dgst, int dgst_len,
502504
}
503505

504506
/* Create ICA_EC_KEY object */
507+
ERR_set_mark();
505508
icakey = ibmca_ec_make_and_cache_ica_key(eckey, &privlen);
509+
ERR_pop_to_mark();
506510
if (icakey == NULL) {
507511
/* This curve is not supported by libica. */
508512
#ifdef OLDER_OPENSSL
@@ -633,7 +637,9 @@ int ibmca_ecdsa_verify_sig(const unsigned char *dgst, int dgst_len,
633637
}
634638

635639
/* Create ICA_EC_KEY object */
640+
ERR_set_mark();
636641
icakey = ibmca_ec_make_and_cache_ica_key(eckey, &privlen);
642+
ERR_pop_to_mark();
637643
if (icakey == NULL) {
638644
/* This curve is not supported by libica. */
639645
#ifdef OLDER_OPENSSL

0 commit comments

Comments
 (0)