3939#if defined(OPENSSL_ALL ) && \
4040 !defined(NO_RSA ) && !defined(NO_FILESYSTEM )
4141
42- static int last_errcode ;
43- static int last_errdepth ;
4442static int last_errcodes [10 ];
4543static int last_errdepths [10 ];
4644static int err_index = 0 ;
4745
48- static int X509Callback (int ok , X509_STORE_CTX * ctx )
49- {
50-
51- if (!ok ) {
52- last_errcode = X509_STORE_CTX_get_error (ctx );
53- last_errdepth = X509_STORE_CTX_get_error_depth (ctx );
54- }
55- /* Always return OK to allow verification to continue.*/
56- return 1 ;
57- }
58-
5946static int X509CallbackCount (int ok , X509_STORE_CTX * ctx )
6047{
6148 if (!ok ) {
@@ -1029,6 +1016,24 @@ int test_X509_STORE_untrusted(void)
10291016 return EXPECT_RESULT ();
10301017}
10311018
1019+ #if defined(OPENSSL_ALL ) && !defined(NO_RSA ) && !defined(NO_FILESYSTEM )
1020+
1021+ static int last_errcode ;
1022+ static int last_errdepth ;
1023+
1024+ static int X509Callback (int ok , X509_STORE_CTX * ctx )
1025+ {
1026+
1027+ if (!ok ) {
1028+ last_errcode = X509_STORE_CTX_get_error (ctx );
1029+ last_errdepth = X509_STORE_CTX_get_error_depth (ctx );
1030+ }
1031+ /* Always return OK to allow verification to continue.*/
1032+ return 1 ;
1033+ }
1034+
1035+ #endif
1036+
10321037int test_X509_STORE_InvalidCa (void )
10331038{
10341039 EXPECT_DECLS ;
@@ -1043,6 +1048,9 @@ int test_X509_STORE_InvalidCa(void)
10431048 X509 * cert = NULL ;
10441049 STACK_OF (X509 )* untrusted = NULL ;
10451050
1051+ last_errcode = 0 ;
1052+ last_errdepth = 0 ;
1053+
10461054 ExpectTrue ((fp = XFOPEN (srvfile , "rb" ))
10471055 != XBADFILE );
10481056 ExpectNotNull (cert = PEM_read_X509 (fp , 0 , 0 , 0 ));
0 commit comments