VirtualBox

source: vbox/trunk/src/libs/openssl-3.3.2/test/rsa_x931_test.c@ 108403

最後變更 在這個檔案從108403是 108206,由 vboxsync 提交於 6 週 前

openssl-3.3.2: Exported all files to OSE and removed .scm-settings ​bugref:10757

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.1 KB
 
1/*
2 * Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
3 *
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
8 */
9
10#include "internal/deprecated.h"
11
12#include <openssl/rsa.h>
13#include <openssl/bn.h>
14#include "crypto/rsa.h"
15#include "testutil.h"
16
17static OSSL_PROVIDER *prov_null = NULL;
18static OSSL_LIB_CTX *libctx = NULL;
19
20static int test_rsa_x931_keygen(void)
21{
22 int ret = 0;
23 BIGNUM *e = NULL;
24 RSA *rsa = NULL;
25
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);
30 BN_free(e);
31 RSA_free(rsa);
32 return ret;
33}
34
35int setup_tests(void)
36{
37 if (!test_get_libctx(&libctx, &prov_null, NULL, NULL, NULL))
38 return 0;
39
40 ADD_TEST(test_rsa_x931_keygen);
41 return 1;
42}
43
44void cleanup_tests(void)
45{
46 OSSL_PROVIDER_unload(prov_null);
47 OSSL_LIB_CTX_free(libctx);
48}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette