]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/params.c
Fix big endian param API tests.
[thirdparty/openssl.git] / crypto / params.c
index 8eef736ef403d23158010ca382db41557263d483..465bb32711ade3c55e40d4106cb8c3beec55b93b 100644 (file)
@@ -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