Revision f6b2ab0ba4fede20d7fdc81a0b281d3470a4d6e9 authored by Jonathan M. Wilbur on 21 August 2024, 02:25:03 UTC, committed by Tomas Mraz on 10 September 2024, 17:17:34 UTC
Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/25244)
1 parent 221e8fa
rsa_x931_test.c
/*
* Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
*/
#include "internal/deprecated.h"
#include <openssl/rsa.h>
#include <openssl/bn.h>
#include "crypto/rsa.h"
#include "testutil.h"
static OSSL_PROVIDER *prov_null = NULL;
static OSSL_LIB_CTX *libctx = NULL;
static int test_rsa_x931_keygen(void)
{
int ret = 0;
BIGNUM *e = NULL;
RSA *rsa = NULL;
ret = TEST_ptr(rsa = ossl_rsa_new_with_ctx(libctx))
&& TEST_ptr(e = BN_new())
&& TEST_int_eq(BN_set_word(e, RSA_F4), 1)
&& TEST_int_eq(RSA_X931_generate_key_ex(rsa, 1024, e, NULL), 1);
BN_free(e);
RSA_free(rsa);
return ret;
}
int setup_tests(void)
{
if (!test_get_libctx(&libctx, &prov_null, NULL, NULL, NULL))
return 0;
ADD_TEST(test_rsa_x931_keygen);
return 1;
}
void cleanup_tests(void)
{
OSSL_PROVIDER_unload(prov_null);
OSSL_LIB_CTX_free(libctx);
}

Computing file changes ...