2 * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include "internal/deprecated.h"
12 #include <openssl/rsa.h>
13 #include <openssl/bn.h>
14 #include "crypto/rsa.h"
17 static OSSL_PROVIDER *prov_null = NULL;
18 static OSSL_LIB_CTX *libctx = NULL;
20 static int test_rsa_x931_keygen(void)
26 ret = TEST_ptr(rsa = ossl_rsa_new_with_ctx(libctx))
27 && TEST_ptr(e = BN_new())
28 && TEST_int_eq(BN_set_word(e, RSA_F4), 1)
29 && TEST_int_eq(RSA_X931_generate_key_ex(rsa, 1024, e, NULL), 1);
37 if (!test_get_libctx(&libctx, &prov_null, NULL, NULL, NULL))
40 ADD_TEST(test_rsa_x931_keygen);
44 void cleanup_tests(void)
46 OSSL_PROVIDER_unload(prov_null);
47 OSSL_LIB_CTX_free(libctx);