EC_GROUP_new_by_curve_name_with_libctx(): Add name of unknown group to error output
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Tue, 29 Sep 2020 08:33:22 +0000 (10:33 +0200)
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>
Wed, 30 Sep 2020 18:49:44 +0000 (20:49 +0200)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13023)

crypto/ec/ec_curve.c

index bf02c261f7423381bcd417796924e33b20e4c395..a63a8535c3751bee21c8bf82b2ec083bd86626e0 100644 (file)
@@ -18,6 +18,7 @@
 #include "ec_local.h"
 #include <openssl/err.h>
 #include <openssl/obj_mac.h>
+#include <openssl/objects.h>
 #include <openssl/opensslconf.h>
 #include "internal/nelem.h"
 #include "e_os.h" /* strcasecmp required by windows */
@@ -3298,6 +3299,9 @@ EC_GROUP *EC_GROUP_new_by_curve_name_with_libctx(OPENSSL_CTX *libctx,
     if ((curve = ec_curve_nid2curve(nid)) == NULL
         || (ret = ec_group_new_from_data(libctx, propq, *curve)) == NULL) {
         ECerr(0, EC_R_UNKNOWN_GROUP);
+#ifndef FIPS_MODULE
+        ERR_add_error_data(2, "name=", OBJ_nid2sn(nid));
+#endif
         return NULL;
     }