#define err_unsupported_real \
ERR_raise(ERR_LIB_CRYPTO, CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT)
+#ifndef OPENSSL_SYS_UEFI
/*
* Return the number of bits in the mantissa of a double. This is used to
* shift a larger integral value to determine if it will exactly fit into a
{
return sizeof(double) == 4 ? 24 : 53;
}
+#endif
OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key)
{
int OSSL_PARAM_get_int32(const OSSL_PARAM *p, int32_t *val)
{
- double d;
-
if (val == NULL || p == NULL) {
err_null_argument;
return 0;
return general_get_int(p, val, sizeof(*val));
} else if (p->data_type == OSSL_PARAM_REAL) {
+#ifndef OPENSSL_SYS_UEFI
+ double d;
+
switch (p->data_size) {
case sizeof(double):
d = *(const double *)p->data;
}
err_unsupported_real;
return 0;
+#endif
}
err_bad_type;
return 0;
#endif
return general_set_int(p, &val, sizeof(val));
} else if (p->data_type == OSSL_PARAM_REAL) {
+#ifndef OPENSSL_SYS_UEFI
p->return_size = sizeof(double);
if (p->data == NULL)
return 1;
}
err_unsupported_real;
return 0;
+#endif
}
err_bad_type;
return 0;
int OSSL_PARAM_get_uint32(const OSSL_PARAM *p, uint32_t *val)
{
- double d;
-
if (val == NULL || p == NULL) {
err_null_argument;
return 0;
#endif
return general_get_uint(p, val, sizeof(*val));
} else if (p->data_type == OSSL_PARAM_REAL) {
+#ifndef OPENSSL_SYS_UEFI
+ double d;
+
switch (p->data_size) {
case sizeof(double):
d = *(const double *)p->data;
}
err_unsupported_real;
return 0;
+#endif
}
err_bad_type;
return 0;
#endif
return general_set_uint(p, &val, sizeof(val));
} else if (p->data_type == OSSL_PARAM_REAL) {
+#ifndef OPENSSL_SYS_UEFI
p->return_size = sizeof(double);
if (p->data == NULL)
return 1;
}
err_unsupported_real;
return 0;
+#endif
}
err_bad_type;
return 0;
int OSSL_PARAM_get_int64(const OSSL_PARAM *p, int64_t *val)
{
- double d;
-
if (val == NULL || p == NULL) {
err_null_argument;
return 0;
#endif
return general_get_int(p, val, sizeof(*val));
} else if (p->data_type == OSSL_PARAM_REAL) {
+#ifndef OPENSSL_SYS_UEFI
+ double d;
+
switch (p->data_size) {
case sizeof(double):
d = *(const double *)p->data;
}
err_unsupported_real;
return 0;
+#endif
}
err_bad_type;
return 0;
int OSSL_PARAM_set_int64(OSSL_PARAM *p, int64_t val)
{
- uint64_t u64;
-
if (p == NULL) {
err_null_argument;
return 0;
#endif
return general_set_int(p, &val, sizeof(val));
} else if (p->data_type == OSSL_PARAM_REAL) {
+#ifndef OPENSSL_SYS_UEFI
+ uint64_t u64;
+
p->return_size = sizeof(double);
if (p->data == NULL)
return 1;
}
err_unsupported_real;
return 0;
+#endif
}
err_bad_type;
return 0;
int OSSL_PARAM_get_uint64(const OSSL_PARAM *p, uint64_t *val)
{
- double d;
-
if (val == NULL || p == NULL) {
err_null_argument;
return 0;
#endif
return general_get_uint(p, val, sizeof(*val));
} else if (p->data_type == OSSL_PARAM_REAL) {
+#ifndef OPENSSL_SYS_UEFI
+ double d;
+
switch (p->data_size) {
case sizeof(double):
d = *(const double *)p->data;
}
err_unsupported_real;
return 0;
+#endif
}
err_bad_type;
return 0;
#endif
return general_set_uint(p, &val, sizeof(val));
} else if (p->data_type == OSSL_PARAM_REAL) {
+#ifndef OPENSSL_SYS_UEFI
p->return_size = sizeof(double);
switch (p->data_size) {
case sizeof(double):
}
err_unsupported_real;
return 0;
+#endif
}
err_bad_type;
return 0;
buf, bsize);
}
+#ifndef OPENSSL_SYS_UEFI
int OSSL_PARAM_get_double(const OSSL_PARAM *p, double *val)
{
int64_t i64;
{
return ossl_param_construct(key, OSSL_PARAM_REAL, buf, sizeof(double));
}
+#endif
static int get_string_internal(const OSSL_PARAM *p, void **val,
size_t *max_len, size_t *used_len,