diff options
Diffstat (limited to 'crypto/x509/by_file.c')
-rw-r--r-- | crypto/x509/by_file.c | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c index a4ec328312..95223ea2af 100644 --- a/crypto/x509/by_file.c +++ b/crypto/x509/by_file.c @@ -19,9 +19,9 @@ static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret); -static int by_file_ctrl_with_libctx(X509_LOOKUP *ctx, int cmd, - const char *argc, long argl, char **ret, - OPENSSL_CTX *libctx, const char *propq); +static int by_file_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret, OPENSSL_CTX *libctx, + const char *propq); static X509_LOOKUP_METHOD x509_file_lookup = { @@ -35,8 +35,8 @@ static X509_LOOKUP_METHOD x509_file_lookup = { NULL, /* get_by_issuer_serial */ NULL, /* get_by_fingerprint */ NULL, /* get_by_alias */ - NULL, /* get_by_subject_with_libctx */ - by_file_ctrl_with_libctx, /* ctrl_with_libctx */ + NULL, /* get_by_subject_ex */ + by_file_ctrl_ex, /* ctrl_ex */ }; X509_LOOKUP_METHOD *X509_LOOKUP_file(void) @@ -44,9 +44,9 @@ X509_LOOKUP_METHOD *X509_LOOKUP_file(void) return &x509_file_lookup; } -static int by_file_ctrl_with_libctx(X509_LOOKUP *ctx, int cmd, - const char *argp, long argl, char **ret, - OPENSSL_CTX *libctx, const char *propq) +static int by_file_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argp, + long argl, char **ret, OPENSSL_CTX *libctx, + const char *propq) { int ok = 0; const char *file; @@ -56,12 +56,11 @@ static int by_file_ctrl_with_libctx(X509_LOOKUP *ctx, int cmd, if (argl == X509_FILETYPE_DEFAULT) { file = ossl_safe_getenv(X509_get_default_cert_file_env()); if (file) - ok = (X509_load_cert_crl_file_with_libctx(ctx, file, - X509_FILETYPE_PEM, - libctx, propq) != 0); + ok = (X509_load_cert_crl_file_ex(ctx, file, X509_FILETYPE_PEM, + libctx, propq) != 0); else - ok = (X509_load_cert_crl_file_with_libctx( + ok = (X509_load_cert_crl_file_ex( ctx, X509_get_default_cert_file(), X509_FILETYPE_PEM, libctx, propq) != 0); @@ -70,12 +69,11 @@ static int by_file_ctrl_with_libctx(X509_LOOKUP *ctx, int cmd, } } else { if (argl == X509_FILETYPE_PEM) - ok = (X509_load_cert_crl_file_with_libctx(ctx, argp, - X509_FILETYPE_PEM, - libctx, propq) != 0); + ok = (X509_load_cert_crl_file_ex(ctx, argp, X509_FILETYPE_PEM, + libctx, propq) != 0); else - ok = (X509_load_cert_file_with_libctx(ctx, argp, (int)argl, - libctx, propq) != 0); + ok = (X509_load_cert_file_ex(ctx, argp, (int)argl, libctx, + propq) != 0); } break; } @@ -85,11 +83,11 @@ static int by_file_ctrl_with_libctx(X509_LOOKUP *ctx, int cmd, static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp, long argl, char **ret) { - return by_file_ctrl_with_libctx(ctx, cmd, argp, argl, ret, NULL, NULL); + return by_file_ctrl_ex(ctx, cmd, argp, argl, ret, NULL, NULL); } -int X509_load_cert_file_with_libctx(X509_LOOKUP *ctx, const char *file, int type, - OPENSSL_CTX *libctx, const char *propq) +int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type, + OPENSSL_CTX *libctx, const char *propq) { int ret = 0; BIO *in = NULL; @@ -107,7 +105,7 @@ int X509_load_cert_file_with_libctx(X509_LOOKUP *ctx, const char *file, int type X509err(0, X509_R_BAD_X509_FILETYPE); goto err; } - x = X509_new_with_libctx(libctx, propq); + x = X509_new_ex(libctx, propq); if (x == NULL) { X509err(0, ERR_R_MALLOC_FAILURE); goto err; @@ -153,7 +151,7 @@ int X509_load_cert_file_with_libctx(X509_LOOKUP *ctx, const char *file, int type int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type) { - return X509_load_cert_file_with_libctx(ctx, file, type, NULL, NULL); + return X509_load_cert_file_ex(ctx, file, type, NULL, NULL); } int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type) @@ -213,9 +211,8 @@ int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type) return ret; } -int X509_load_cert_crl_file_with_libctx(X509_LOOKUP *ctx, const char *file, - int type, OPENSSL_CTX *libctx, - const char *propq) +int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type, + OPENSSL_CTX *libctx, const char *propq) { STACK_OF(X509_INFO) *inf; X509_INFO *itmp; @@ -223,13 +220,13 @@ int X509_load_cert_crl_file_with_libctx(X509_LOOKUP *ctx, const char *file, int i, count = 0; if (type != X509_FILETYPE_PEM) - return X509_load_cert_file_with_libctx(ctx, file, type, libctx, propq); + return X509_load_cert_file_ex(ctx, file, type, libctx, propq); in = BIO_new_file(file, "r"); if (!in) { X509err(0, ERR_R_SYS_LIB); return 0; } - inf = PEM_X509_INFO_read_bio_with_libctx(in, NULL, NULL, "", libctx, propq); + inf = PEM_X509_INFO_read_bio_ex(in, NULL, NULL, "", libctx, propq); BIO_free(in); if (!inf) { X509err(0, ERR_R_PEM_LIB); @@ -257,6 +254,6 @@ int X509_load_cert_crl_file_with_libctx(X509_LOOKUP *ctx, const char *file, int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type) { - return X509_load_cert_crl_file_with_libctx(ctx, file, type, NULL, NULL); + return X509_load_cert_crl_file_ex(ctx, file, type, NULL, NULL); } |