|
|
@@ -1320,7 +1320,7 @@ int x509_validate ( struct x509_certificate *cert,
|
|
1320
|
1320
|
root = &root_certificates;
|
|
1321
|
1321
|
|
|
1322
|
1322
|
/* Return success if certificate has already been validated */
|
|
1323
|
|
- if ( cert->valid )
|
|
|
1323
|
+ if ( x509_is_valid ( cert ) )
|
|
1324
|
1324
|
return 0;
|
|
1325
|
1325
|
|
|
1326
|
1326
|
/* Fail if certificate is invalid at specified time */
|
|
|
@@ -1329,7 +1329,7 @@ int x509_validate ( struct x509_certificate *cert,
|
|
1329
|
1329
|
|
|
1330
|
1330
|
/* Succeed if certificate is a trusted root certificate */
|
|
1331
|
1331
|
if ( x509_check_root ( cert, root ) == 0 ) {
|
|
1332
|
|
- cert->valid = 1;
|
|
|
1332
|
+ cert->flags |= X509_FL_VALIDATED;
|
|
1333
|
1333
|
cert->path_remaining = ( cert->extensions.basic.path_len + 1 );
|
|
1334
|
1334
|
return 0;
|
|
1335
|
1335
|
}
|
|
|
@@ -1342,7 +1342,7 @@ int x509_validate ( struct x509_certificate *cert,
|
|
1342
|
1342
|
}
|
|
1343
|
1343
|
|
|
1344
|
1344
|
/* Fail unless issuer has already been validated */
|
|
1345
|
|
- if ( ! issuer->valid ) {
|
|
|
1345
|
+ if ( ! x509_is_valid ( issuer ) ) {
|
|
1346
|
1346
|
DBGC ( cert, "X509 %p \"%s\" ", cert, x509_name ( cert ) );
|
|
1347
|
1347
|
DBGC ( cert, "issuer %p \"%s\" has not yet been validated\n",
|
|
1348
|
1348
|
issuer, x509_name ( issuer ) );
|
|
|
@@ -1376,7 +1376,7 @@ int x509_validate ( struct x509_certificate *cert,
|
|
1376
|
1376
|
cert->path_remaining = max_path_remaining;
|
|
1377
|
1377
|
|
|
1378
|
1378
|
/* Mark certificate as valid */
|
|
1379
|
|
- cert->valid = 1;
|
|
|
1379
|
+ cert->flags |= X509_FL_VALIDATED;
|
|
1380
|
1380
|
|
|
1381
|
1381
|
DBGC ( cert, "X509 %p \"%s\" successfully validated using ",
|
|
1382
|
1382
|
cert, x509_name ( cert ) );
|