Use macros internally for algorithm names
[openssl.git] / crypto / params.c
index 0c9e6f3ef7ba9572812de89bec6f92ef64c1cf65..b3fbb12b9ba1a6eef1081eee2d4d89a079fb19a2 100644 (file)
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <openssl/params.h>
 #include "internal/thread_once.h"
+#include "internal/numbers.h"
 
 OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key)
 {
@@ -582,13 +583,6 @@ OSSL_PARAM OSSL_PARAM_construct_size_t(const char *key, size_t *buf)
                                 sizeof(size_t));
 }
 
-#ifndef FIPS_MODE
-/*
- * TODO(3.0): Make this available in FIPS mode.
- *
- * Temporarily we don't include these functions in FIPS mode to avoid pulling
- * in the entire BN sub-library into the module at this point.
- */
 int OSSL_PARAM_get_BN(const OSSL_PARAM *p, BIGNUM **val)
 {
     BIGNUM *b;
@@ -632,7 +626,6 @@ OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf,
     return ossl_param_construct(key, OSSL_PARAM_UNSIGNED_INTEGER,
                                 buf, bsize);
 }
-#endif
 
 int OSSL_PARAM_get_double(const OSSL_PARAM *p, double *val)
 {
@@ -693,7 +686,7 @@ int OSSL_PARAM_set_double(OSSL_PARAM *p, double val)
             return 1;
         }
     } else if (p->data_type == OSSL_PARAM_UNSIGNED_INTEGER
-               && val == (uintmax_t)val) {
+               && val == (ossl_uintmax_t)val) {
         p->return_size = sizeof(double);
         switch (p->data_size) {
         case sizeof(uint32_t):
@@ -710,7 +703,7 @@ int OSSL_PARAM_set_double(OSSL_PARAM *p, double val)
                 return 1;
             }
             break;            }
-    } else if (p->data_type == OSSL_PARAM_INTEGER && val == (intmax_t)val) {
+    } else if (p->data_type == OSSL_PARAM_INTEGER && val == (ossl_intmax_t)val) {
         p->return_size = sizeof(double);
         switch (p->data_size) {
         case sizeof(int32_t):