]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Remove ossl_prov_util_nid_to_name()
authorShane Lontis <shane.lontis@oracle.com>
Wed, 21 Oct 2020 00:57:52 +0000 (10:57 +1000)
committerShane Lontis <shane.lontis@oracle.com>
Thu, 22 Oct 2020 10:42:42 +0000 (20:42 +1000)
This removes a TODO.
This function is not needed since any place that needs to do the
conversion normally has a special case name2nid table.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13202)

doc/internal/man3/ossl_prov_util_nid_to_name.pod [deleted file]
providers/common/build.info
providers/common/include/prov/providercommon.h
providers/common/nid_to_name.c [deleted file]
providers/fips/fipsprov.c

diff --git a/doc/internal/man3/ossl_prov_util_nid_to_name.pod b/doc/internal/man3/ossl_prov_util_nid_to_name.pod
deleted file mode 100644 (file)
index 31eec07..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-=pod
-
-=head1 NAME
-
-ossl_prov_util_nid_to_name
-- provider utility functions
-
-=head1 SYNOPSIS
-
- #include "prov/providercommon.h"
-
- const char *ossl_prov_util_nid_to_name(int nid);
-
-=head1 DESCRIPTION
-
-The ossl_prov_util_nid_to_name() returns the name of an algorithm given a NID
-in the I<nid> parameter. For the default and legacy providers it is equivalent
-to calling OBJ_nid2sn(). The FIPS provider does not have the object database
-code available to it (because that code relies on the ASN.1 code), so this
-function is a static lookup of all known FIPS algorithm NIDs.
-
-=head1 RETURN VALUES
-
-Returns a pointer to the algorithm name, or NULL on error.
-
-=head1 COPYRIGHT
-
-Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
-
-Licensed under the Apache License 2.0 (the "License").  You may not use
-this file except in compliance with the License.  You can obtain a copy
-in the file LICENSE in the source distribution or at
-L<https://www.openssl.org/source/license.html>.
-
-=cut
index 2179b2a0f8c0e7b42347abc982b472bf2ad25a34..b6d56682a99b39ced720368101283ad17c1d0830 100644 (file)
@@ -3,5 +3,5 @@ SUBDIRS=der
 SOURCE[../libcommon.a]=provider_err.c provider_ctx.c
 $FIPSCOMMON=provider_util.c capabilities.c bio_prov.c digest_to_nid.c\
             securitycheck.c
-SOURCE[../libnonfips.a]=$FIPSCOMMON nid_to_name.c securitycheck_default.c
+SOURCE[../libnonfips.a]=$FIPSCOMMON securitycheck_default.c
 SOURCE[../libfips.a]=$FIPSCOMMON securitycheck_fips.c
index 622fe1977eb5f374ef50c36300bb368a6b70d5a2..33bd8bd732f6304820ba76e96e9f7450b84c76d3 100644 (file)
@@ -12,8 +12,6 @@
 
 const OSSL_CORE_HANDLE *FIPS_get_core_handle(OSSL_LIB_CTX *ctx);
 
-const char *ossl_prov_util_nid_to_name(int nid);
-
 int ossl_cipher_capable_aes_cbc_hmac_sha1(void);
 int ossl_cipher_capable_aes_cbc_hmac_sha256(void);
 
diff --git a/providers/common/nid_to_name.c b/providers/common/nid_to_name.c
deleted file mode 100644 (file)
index af2a7cb..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
- *
- * Licensed under the Apache License 2.0 (the "License").  You may not use
- * this file except in compliance with the License.  You can obtain a copy
- * in the file LICENSE in the source distribution or at
- * https://www.openssl.org/source/license.html
- */
-
-#include <openssl/objects.h>
-#include "prov/providercommon.h"
-
-/*
- * The FIPS provider has its own version of this in fipsprov.c because it does
- * not have OBJ_nid2sn();
- */
-const char *ossl_prov_util_nid_to_name(int nid)
-{
-   return OBJ_nid2sn(nid);
-}
-
index 93b5dede6786db9ee363db003962d6929a9c9e39..a4e66010712f8fc53bb5b8a7fd248641c0294029 100644 (file)
@@ -10,7 +10,6 @@
 #include <openssl/core_dispatch.h>
 #include <openssl/core_names.h>
 #include <openssl/params.h>
-#include <openssl/obj_mac.h> /* NIDs used by ossl_prov_util_nid_to_name() */
 #include <openssl/fips_names.h>
 #include <openssl/rand.h> /* RAND_get0_public() */
 #include "internal/cryptlib.h"
@@ -184,103 +183,6 @@ static int fips_self_test(void *provctx)
     return SELF_TEST_post(&selftest_params, 1) ? 1 : 0;
 }
 
-/* FIPS specific version of the function of the same name in provlib.c */
-/* TODO(3.0) - Is this function needed ? */
-const char *ossl_prov_util_nid_to_name(int nid)
-{
-    /* We don't have OBJ_nid2n() in FIPS_MODULE so we have an explicit list */
-
-    switch (nid) {
-    /* Digests */
-    case NID_sha1:
-        return "SHA1";
-    case NID_sha224:
-        return "SHA-224";
-    case NID_sha256:
-        return "SHA-256";
-    case NID_sha384:
-        return "SHA-384";
-    case NID_sha512:
-        return "SHA-512";
-    case NID_sha512_224:
-        return "SHA-512/224";
-    case NID_sha512_256:
-        return "SHA-512/256";
-    case NID_sha3_224:
-        return "SHA3-224";
-    case NID_sha3_256:
-        return "SHA3-256";
-    case NID_sha3_384:
-        return "SHA3-384";
-    case NID_sha3_512:
-        return "SHA3-512";
-
-    /* Ciphers */
-    case NID_aes_256_ecb:
-        return "AES-256-ECB";
-    case NID_aes_192_ecb:
-        return "AES-192-ECB";
-    case NID_aes_128_ecb:
-        return "AES-128-ECB";
-    case NID_aes_256_cbc:
-        return "AES-256-CBC";
-    case NID_aes_192_cbc:
-        return "AES-192-CBC";
-    case NID_aes_128_cbc:
-        return "AES-128-CBC";
-    case NID_aes_256_ctr:
-        return "AES-256-CTR";
-    case NID_aes_192_ctr:
-        return "AES-192-CTR";
-    case NID_aes_128_ctr:
-        return "AES-128-CTR";
-    case NID_aes_256_xts:
-        return "AES-256-XTS";
-    case NID_aes_128_xts:
-        return "AES-128-XTS";
-    case NID_aes_256_gcm:
-        return "AES-256-GCM";
-    case NID_aes_192_gcm:
-        return "AES-192-GCM";
-    case NID_aes_128_gcm:
-        return "AES-128-GCM";
-    case NID_aes_256_ccm:
-        return "AES-256-CCM";
-    case NID_aes_192_ccm:
-        return "AES-192-CCM";
-    case NID_aes_128_ccm:
-        return "AES-128-CCM";
-    case NID_id_aes256_wrap:
-        return "AES-256-WRAP";
-    case NID_id_aes192_wrap:
-        return "AES-192-WRAP";
-    case NID_id_aes128_wrap:
-        return "AES-128-WRAP";
-    case NID_id_aes256_wrap_pad:
-        return "AES-256-WRAP-PAD";
-    case NID_id_aes192_wrap_pad:
-        return "AES-192-WRAP-PAD";
-    case NID_id_aes128_wrap_pad:
-        return "AES-128-WRAP-PAD";
-    case NID_des_ede3_ecb:
-        return "DES-EDE3";
-    case NID_des_ede3_cbc:
-        return "DES-EDE3-CBC";
-    case NID_aes_256_cbc_hmac_sha256:
-        return "AES-256-CBC-HMAC-SHA256";
-    case NID_aes_128_cbc_hmac_sha256:
-        return "AES-128-CBC-HMAC-SHA256";
-    case NID_aes_256_cbc_hmac_sha1:
-        return "AES-256-CBC-HMAC-SHA1";
-    case NID_aes_128_cbc_hmac_sha1:
-        return "AES-128-CBC-HMAC-SHA1";
-    default:
-        break;
-    }
-
-    return NULL;
-}
-
 /*
  * For the algorithm names, we use the following formula for our primary
  * names: