Cleanup of verify(1) failure output
Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
parent
1de1d7689a
commit
63c6aa6b93
@ -263,16 +263,17 @@ static int check(X509_STORE *ctx, char *file,
|
||||
x = load_cert(file, FORMAT_PEM, NULL, e, "certificate file");
|
||||
if (x == NULL)
|
||||
goto end;
|
||||
printf("%s: ", (file == NULL) ? "stdin" : file);
|
||||
|
||||
csc = X509_STORE_CTX_new();
|
||||
if (csc == NULL) {
|
||||
ERR_print_errors(bio_err);
|
||||
printf("error %s: X.509 store context allocation failed\n",
|
||||
(file == NULL) ? "stdin" : file);
|
||||
goto end;
|
||||
}
|
||||
X509_STORE_set_flags(ctx, vflags);
|
||||
if (!X509_STORE_CTX_init(csc, ctx, x, uchain)) {
|
||||
ERR_print_errors(bio_err);
|
||||
printf("error %s: X.509 store context initialization failed\n",
|
||||
(file == NULL) ? "stdin" : file);
|
||||
goto end;
|
||||
}
|
||||
if (tchain)
|
||||
@ -281,7 +282,7 @@ static int check(X509_STORE *ctx, char *file,
|
||||
X509_STORE_CTX_set0_crls(csc, crls);
|
||||
i = X509_verify_cert(csc);
|
||||
if (i > 0) {
|
||||
printf("OK\n");
|
||||
printf("%s: OK\n", (file == NULL) ? "stdin" : file);
|
||||
ret = 1;
|
||||
if (show_chain) {
|
||||
int j;
|
||||
@ -301,6 +302,8 @@ static int check(X509_STORE *ctx, char *file,
|
||||
}
|
||||
sk_X509_pop_free(chain, X509_free);
|
||||
}
|
||||
} else {
|
||||
printf("error %s: verification failed\n", (file == NULL) ? "stdin" : file);
|
||||
}
|
||||
X509_STORE_CTX_free(csc);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user