File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
parsec-openssl-provider/src/signature Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -92,3 +92,29 @@ pub const PARSEC_PROVIDER_SIGNATURE: [OSSL_ALGORITHM; 3] = [
9292 ) ,
9393 ossl_algorithm ! ( ) ,
9494] ;
95+
96+ #[ test]
97+ fn test_sign_newctx ( ) {
98+ use crate :: parsec_provider_provider_init;
99+
100+ let out: * const OSSL_DISPATCH = std:: ptr:: null ( ) ;
101+ let mut provctx: types:: VOID_PTR = std:: ptr:: null_mut ( ) ;
102+
103+ // Initialize the provider
104+ let result: Result < ( ) , parsec_openssl2:: Error > = unsafe {
105+ parsec_provider_provider_init (
106+ std:: ptr:: null ( ) ,
107+ std:: ptr:: null ( ) ,
108+ & out as * const _ as * mut _ ,
109+ & mut provctx as * mut VOID_PTR ,
110+ )
111+ } ;
112+ assert ! ( result. is_ok( ) ) ;
113+ assert_ne ! ( provctx, std:: ptr:: null_mut( ) ) ;
114+ let s = String :: from ( "" ) ;
115+
116+ let sig_ctx = unsafe { parsec_provider_signature_newctx ( provctx, s. as_ptr ( ) as _ ) } ;
117+ assert_ne ! ( sig_ctx, std:: ptr:: null_mut( ) ) ;
118+
119+ unsafe { parsec_provider_signature_freectx ( sig_ctx) } ;
120+ }
You can’t perform that action at this time.
0 commit comments