Browse Source

EC_GROUP_new_by_curve_name_with_libctx(): Add name of unknown group to error output

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13023)
Dr. David von Oheimb 3 years ago
parent
commit
4a24d6050b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      crypto/ec/ec_curve.c

+ 4 - 0
crypto/ec/ec_curve.c

@@ -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;
     }