Skip to content

Commit 6392c2b

Browse files
committed
undo changes
fix indentation
1 parent c6dd1a7 commit 6392c2b

2 files changed

Lines changed: 25 additions & 17 deletions

File tree

src/x509_str.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ static int X509StoreVerifyCert(WOLFSSL_X509_STORE_CTX* ctx)
443443
#if !defined(NO_ASN_TIME) && defined(OPENSSL_ALL)
444444
if (ret != WC_NO_ERR_TRACE(ASN_BEFORE_DATE_E) &&
445445
ret != WC_NO_ERR_TRACE(ASN_AFTER_DATE_E)) {
446-
/* With OpenSSL, we need to check the certificate's date
447-
* after certificate manager verification,
448-
* as it skips date validation when other errors are present.
449-
*/
446+
/* With OpenSSL, we need to check the certificate's date
447+
* after certificate manager verification,
448+
* as it skips date validation when other errors are present.
449+
*/
450450
ret = X509StoreVerifyCertDate(ctx, ret);
451451
SetupStoreCtxError(ctx, ret);
452452
ret = ret == WOLFSSL_SUCCESS ? 1 : 0;

tests/api/test_ossl_x509_str.c

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,10 @@
3939
#if defined(OPENSSL_ALL) && \
4040
!defined(NO_RSA) && !defined(NO_FILESYSTEM)
4141

42-
static int last_errcode;
43-
static int last_errdepth;
4442
static int last_errcodes[10];
4543
static int last_errdepths[10];
4644
static 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-
5946
static 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+
10321037
int 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

Comments
 (0)