mirror of
https://github.com/openssl/openssl.git
synced 2024-11-21 01:15:20 +08:00
Testing the EVP_PKEY_CTX_new_from_name without preliminary init
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18199)
This commit is contained in:
parent
e560655f72
commit
2d96bfd957
@ -37,7 +37,7 @@ IF[{- !$disabled{tests} -}]
|
||||
sanitytest rsa_complex exdatatest bntest \
|
||||
ecstresstest gmdifftest pbelutest \
|
||||
destest mdc2test sha_test \
|
||||
exptest pbetest localetest \
|
||||
exptest pbetest localetest evp_pkey_ctx_new_from_name\
|
||||
evp_pkey_provided_test evp_test evp_extra_test evp_extra_test2 \
|
||||
evp_fetch_prov_test evp_libctx_test ossl_store_test \
|
||||
v3nametest v3ext \
|
||||
@ -140,6 +140,10 @@ IF[{- !$disabled{tests} -}]
|
||||
INCLUDE[localetest]=../include ../apps/include
|
||||
DEPEND[localetest]=../libcrypto libtestutil.a
|
||||
|
||||
SOURCE[evp_pkey_ctx_new_from_name]=evp_pkey_ctx_new_from_name.c
|
||||
INCLUDE[evp_pkey_ctx_new_from_name]=../include ../apps/include
|
||||
DEPEND[evp_pkey_ctx_new_from_name]=../libcrypto
|
||||
|
||||
SOURCE[pbetest]=pbetest.c
|
||||
INCLUDE[pbetest]=../include ../apps/include
|
||||
DEPEND[pbetest]=../libcrypto libtestutil.a
|
||||
|
14
test/evp_pkey_ctx_new_from_name.c
Normal file
14
test/evp_pkey_ctx_new_from_name.c
Normal file
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <openssl/ec.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/err.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
EVP_PKEY_CTX *pctx = NULL;
|
||||
|
||||
pctx = EVP_PKEY_CTX_new_from_name(NULL, "NO_SUCH_ALGORITHM", NULL);
|
||||
EVP_PKEY_CTX_free(pctx);
|
||||
|
||||
return 0;
|
||||
}
|
@ -15,7 +15,9 @@ setup("locale tests");
|
||||
plan skip_all => "Locale tests not available on Windows or VMS"
|
||||
if $^O =~ /^(VMS|MSWin32)$/;
|
||||
|
||||
plan tests => 2;
|
||||
plan tests => 3;
|
||||
|
||||
ok(run(test(["evp_pkey_ctx_new_from_name"])), "running evp_pkey_ctx_new_from_name without explicit context init");
|
||||
|
||||
$ENV{LANG} = "C";
|
||||
ok(run(test(["localetest"])), "running localetest");
|
||||
|
Loading…
Reference in New Issue
Block a user