Commit 0124f32a authored by Mingtao Yang's avatar Mingtao Yang Committed by Richard Levitte
Browse files

Add APIs for custom X509_LOOKUP_METHOD creation



OpenSSL 1.1.0 made the X509_LOOKUP_METHOD structure opaque, so
applications that were previously able to define a custom lookup method
are not able to be ported.

This commit adds getters and setters for each of the current fields of
X509_LOOKUP_METHOD, along with getters and setters on several associated
opaque types (such as X509_LOOKUP and X509_OBJECT).

Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
Reviewed-by: default avatarRichard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6152)
parent f3a246c6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1685,6 +1685,7 @@ X509_F_X509_GET_PUBKEY_PARAMETERS:110:X509_get_pubkey_parameters
X509_F_X509_LOAD_CERT_CRL_FILE:132:X509_load_cert_crl_file
X509_F_X509_LOAD_CERT_FILE:111:X509_load_cert_file
X509_F_X509_LOAD_CRL_FILE:112:X509_load_crl_file
X509_F_X509_LOOKUP_METH_NEW:160:X509_LOOKUP_meth_new
X509_F_X509_LOOKUP_NEW:155:X509_LOOKUP_new
X509_F_X509_NAME_ADD_ENTRY:113:X509_NAME_add_entry
X509_F_X509_NAME_CANON:156:x509_name_canon
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ SOURCE[../../libcrypto]=\
        x509_obj.c x509_req.c x509spki.c x509_vfy.c \
        x509_set.c x509cset.c x509rset.c x509_err.c \
        x509name.c x509_v3.c x509_ext.c x509_att.c \
        x509type.c x509_lu.c x_all.c x509_txt.c \
        x509type.c x509_meth.c x509_lu.c x_all.c x509_txt.c \
        x509_trs.c by_file.c by_dir.c x509_vpm.c \
        x_crl.c t_crl.c x_req.c t_req.c x_x509.c t_x509.c \
        x_pubkey.c x_x509a.c x_attrib.c x_exten.c x_name.c
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ static int new_dir(X509_LOOKUP *lu)
        X509err(X509_F_NEW_DIR, ERR_R_MALLOC_FAILURE);
        goto err;
    }
    lu->method_data = (char *)a;
    lu->method_data = a;
    return 1;

 err:
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ static const ERR_STRING_DATA X509_str_functs[] = {
     "X509_load_cert_file"},
    {ERR_PACK(ERR_LIB_X509, X509_F_X509_LOAD_CRL_FILE, 0),
     "X509_load_crl_file"},
    {ERR_PACK(ERR_LIB_X509, X509_F_X509_LOOKUP_METH_NEW, 0),
     "X509_LOOKUP_meth_new"},
    {ERR_PACK(ERR_LIB_X509, X509_F_X509_LOOKUP_NEW, 0), "X509_LOOKUP_new"},
    {ERR_PACK(ERR_LIB_X509, X509_F_X509_NAME_ADD_ENTRY, 0),
     "X509_NAME_add_entry"},
+2 −2
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ struct x509_crl_method_st {
};

struct x509_lookup_method_st {
    const char *name;
    char *name;
    int (*new_item) (X509_LOOKUP *ctx);
    void (*free) (X509_LOOKUP *ctx);
    int (*init) (X509_LOOKUP *ctx);
@@ -93,7 +93,7 @@ struct x509_lookup_st {
    int init;                   /* have we been started */
    int skip;                   /* don't use us. */
    X509_LOOKUP_METHOD *method; /* the functions */
    char *method_data;          /* method data */
    void *method_data;          /* method data */
    X509_STORE *store_ctx;      /* who owns us */
};

Loading