summaryrefslogtreecommitdiffstats
path: root/crypto/params.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2019-04-06 11:15:44 +0200
committerPauli <paul.dale@oracle.com>2019-04-06 11:15:44 +0200
commit6ce84e64102c9df984e3a00af12eb797c398563f (patch)
tree31ef91fe905e029791fd78e292895e69dfd480ed /crypto/params.c
parentFix the allocation size in EVP_OpenInit and PEM_SignFinal (diff)
downloadopenssl-6ce84e64102c9df984e3a00af12eb797c398563f.tar.xz
openssl-6ce84e64102c9df984e3a00af12eb797c398563f.zip
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