summaryrefslogtreecommitdiffstats
path: root/crypto/params.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-04-06 19:15:44 +1000
committerPauli <paul.dale@oracle.com>2019-04-06 19:15:44 +1000
commit6ce84e64102c9df984e3a00af12eb797c398563f (patch)
tree31ef91fe905e029791fd78e292895e69dfd480ed /crypto/params.c
parent8cf85d489978c384a3f193fb7cb25469e0559f27 (diff)
Fix big endian param API tests.
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/8629)
Diffstat (limited to 'crypto/params.c')
-rw-r--r--crypto/params.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/params.c b/crypto/params.c
index 8eef736ef4..465bb32711 100644
--- a/crypto/params.c
+++ b/crypto/params.c
@@ -382,6 +382,10 @@ int OSSL_PARAM_set_BN(const OSSL_PARAM *p, const BIGNUM *val)
if (val == NULL || p->data_type != OSSL_PARAM_UNSIGNED_INTEGER)
return 0;
+ /* For the moment, only positive values are permitted */
+ if (BN_is_negative(val))
+ return 0;
+
bytes = (size_t)BN_num_bytes(val);
SET_RETURN_SIZE(p, bytes);
return p->data_size >= bytes