Loading crypto/x509/x509.h +3 −0 Original line number Diff line number Diff line Loading @@ -1011,6 +1011,7 @@ int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); X509_EXTENSION *X509_get_ext(X509 *x, int loc); X509_EXTENSION *X509_delete_ext(X509 *x, int loc); int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); int X509_CRL_get_ext_count(X509_CRL *x); int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); Loading @@ -1019,6 +1020,7 @@ int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); int X509_REVOKED_get_ext_count(X509_REVOKED *x); int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); Loading @@ -1027,6 +1029,7 @@ int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, ASN1_OCTET_STRING *data); Loading crypto/x509/x509_ext.c +17 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ #include <openssl/objects.h> #include <openssl/evp.h> #include <openssl/x509.h> #include <openssl/x509v3.h> int X509_CRL_get_ext_count(X509_CRL *x) { Loading Loading @@ -94,6 +96,11 @@ X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc) return(X509v3_delete_ext(x->crl->extensions,loc)); } void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); } int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) { return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL); Loading Loading @@ -134,6 +141,11 @@ int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) return(X509v3_add_ext(&(x->cert_info->extensions),ex,loc) != NULL); } void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); } int X509_REVOKED_get_ext_count(X509_REVOKED *x) { return(X509v3_get_ext_count(x->extensions)); Loading Loading @@ -170,5 +182,10 @@ int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) return(X509v3_add_ext(&(x->extensions),ex,loc) != NULL); } void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->extensions, nid, crit, idx); } IMPLEMENT_STACK_OF(X509_EXTENSION) IMPLEMENT_ASN1_SET_OF(X509_EXTENSION) crypto/x509v3/v3_lib.c +0 −17 Original line number Diff line number Diff line Loading @@ -219,20 +219,3 @@ void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx) if(crit) *crit = -1; return NULL; } /* As above but for a passed certificate */ void *X509V3_X509_get_d2i(X509 *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); } void *X509V3_CRL_get_d2i(X509_CRL *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); } void *X509V3_REVOKED_get_d2i(X509_REVOKED *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->extensions, nid, crit, idx); } crypto/x509v3/v3_purp.c +4 −4 Original line number Diff line number Diff line Loading @@ -263,7 +263,7 @@ static void x509v3_cache_extensions(X509 *x) /* V1 should mean no extensions ... */ if(!X509_get_version(x)) x->ex_flags |= EXFLAG_V1; /* Handle basic constraints */ if((bs=X509V3_X509_get_d2i(x, NID_basic_constraints, NULL, NULL))) { if((bs=X509_get_ext_d2i(x, NID_basic_constraints, NULL, NULL))) { if(bs->ca) x->ex_flags |= EXFLAG_CA; if(bs->pathlen) { if((bs->pathlen->type == V_ASN1_NEG_INTEGER) Loading @@ -276,7 +276,7 @@ static void x509v3_cache_extensions(X509 *x) x->ex_flags |= EXFLAG_BCONS; } /* Handle key usage */ if((usage=X509V3_X509_get_d2i(x, NID_key_usage, NULL, NULL))) { if((usage=X509_get_ext_d2i(x, NID_key_usage, NULL, NULL))) { if(usage->length > 0) { x->ex_kusage = usage->data[0]; if(usage->length > 1) Loading @@ -286,7 +286,7 @@ static void x509v3_cache_extensions(X509 *x) ASN1_BIT_STRING_free(usage); } x->ex_xkusage = 0; if((extusage=X509V3_X509_get_d2i(x, NID_ext_key_usage, NULL, NULL))) { if((extusage=X509_get_ext_d2i(x, NID_ext_key_usage, NULL, NULL))) { x->ex_flags |= EXFLAG_XKUSAGE; for(i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) { switch(OBJ_obj2nid(sk_ASN1_OBJECT_value(extusage,i))) { Loading Loading @@ -314,7 +314,7 @@ static void x509v3_cache_extensions(X509 *x) sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free); } if((ns=X509V3_X509_get_d2i(x, NID_netscape_cert_type, NULL, NULL))) { if((ns=X509_get_ext_d2i(x, NID_netscape_cert_type, NULL, NULL))) { if(ns->length > 0) x->ex_nscert = ns->data[0]; else x->ex_nscert = 0; x->ex_flags |= EXFLAG_NSCERT; Loading crypto/x509v3/x509v3.h +0 −3 Original line number Diff line number Diff line Loading @@ -515,9 +515,6 @@ int X509V3_add_standard_extensions(void); STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line); void *X509V3_EXT_d2i(X509_EXTENSION *ext); void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); void *X509V3_X509_get_d2i(X509 *x, int nid, int *crit, int *idx); void *X509V3_CRL_get_d2i(X509_CRL *x, int nid, int *crit, int *idx); void *X509V3_REVOKED_get_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); Loading Loading
crypto/x509/x509.h +3 −0 Original line number Diff line number Diff line Loading @@ -1011,6 +1011,7 @@ int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); X509_EXTENSION *X509_get_ext(X509 *x, int loc); X509_EXTENSION *X509_delete_ext(X509 *x, int loc); int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); int X509_CRL_get_ext_count(X509_CRL *x); int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); Loading @@ -1019,6 +1020,7 @@ int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); int X509_REVOKED_get_ext_count(X509_REVOKED *x); int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); Loading @@ -1027,6 +1029,7 @@ int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, ASN1_OCTET_STRING *data); Loading
crypto/x509/x509_ext.c +17 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ #include <openssl/objects.h> #include <openssl/evp.h> #include <openssl/x509.h> #include <openssl/x509v3.h> int X509_CRL_get_ext_count(X509_CRL *x) { Loading Loading @@ -94,6 +96,11 @@ X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc) return(X509v3_delete_ext(x->crl->extensions,loc)); } void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); } int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) { return(X509v3_add_ext(&(x->crl->extensions),ex,loc) != NULL); Loading Loading @@ -134,6 +141,11 @@ int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) return(X509v3_add_ext(&(x->cert_info->extensions),ex,loc) != NULL); } void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); } int X509_REVOKED_get_ext_count(X509_REVOKED *x) { return(X509v3_get_ext_count(x->extensions)); Loading Loading @@ -170,5 +182,10 @@ int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) return(X509v3_add_ext(&(x->extensions),ex,loc) != NULL); } void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->extensions, nid, crit, idx); } IMPLEMENT_STACK_OF(X509_EXTENSION) IMPLEMENT_ASN1_SET_OF(X509_EXTENSION)
crypto/x509v3/v3_lib.c +0 −17 Original line number Diff line number Diff line Loading @@ -219,20 +219,3 @@ void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx) if(crit) *crit = -1; return NULL; } /* As above but for a passed certificate */ void *X509V3_X509_get_d2i(X509 *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); } void *X509V3_CRL_get_d2i(X509_CRL *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); } void *X509V3_REVOKED_get_d2i(X509_REVOKED *x, int nid, int *crit, int *idx) { return X509V3_get_d2i(x->extensions, nid, crit, idx); }
crypto/x509v3/v3_purp.c +4 −4 Original line number Diff line number Diff line Loading @@ -263,7 +263,7 @@ static void x509v3_cache_extensions(X509 *x) /* V1 should mean no extensions ... */ if(!X509_get_version(x)) x->ex_flags |= EXFLAG_V1; /* Handle basic constraints */ if((bs=X509V3_X509_get_d2i(x, NID_basic_constraints, NULL, NULL))) { if((bs=X509_get_ext_d2i(x, NID_basic_constraints, NULL, NULL))) { if(bs->ca) x->ex_flags |= EXFLAG_CA; if(bs->pathlen) { if((bs->pathlen->type == V_ASN1_NEG_INTEGER) Loading @@ -276,7 +276,7 @@ static void x509v3_cache_extensions(X509 *x) x->ex_flags |= EXFLAG_BCONS; } /* Handle key usage */ if((usage=X509V3_X509_get_d2i(x, NID_key_usage, NULL, NULL))) { if((usage=X509_get_ext_d2i(x, NID_key_usage, NULL, NULL))) { if(usage->length > 0) { x->ex_kusage = usage->data[0]; if(usage->length > 1) Loading @@ -286,7 +286,7 @@ static void x509v3_cache_extensions(X509 *x) ASN1_BIT_STRING_free(usage); } x->ex_xkusage = 0; if((extusage=X509V3_X509_get_d2i(x, NID_ext_key_usage, NULL, NULL))) { if((extusage=X509_get_ext_d2i(x, NID_ext_key_usage, NULL, NULL))) { x->ex_flags |= EXFLAG_XKUSAGE; for(i = 0; i < sk_ASN1_OBJECT_num(extusage); i++) { switch(OBJ_obj2nid(sk_ASN1_OBJECT_value(extusage,i))) { Loading Loading @@ -314,7 +314,7 @@ static void x509v3_cache_extensions(X509 *x) sk_ASN1_OBJECT_pop_free(extusage, ASN1_OBJECT_free); } if((ns=X509V3_X509_get_d2i(x, NID_netscape_cert_type, NULL, NULL))) { if((ns=X509_get_ext_d2i(x, NID_netscape_cert_type, NULL, NULL))) { if(ns->length > 0) x->ex_nscert = ns->data[0]; else x->ex_nscert = 0; x->ex_flags |= EXFLAG_NSCERT; Loading
crypto/x509v3/x509v3.h +0 −3 Original line number Diff line number Diff line Loading @@ -515,9 +515,6 @@ int X509V3_add_standard_extensions(void); STACK_OF(CONF_VALUE) *X509V3_parse_list(char *line); void *X509V3_EXT_d2i(X509_EXTENSION *ext); void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); void *X509V3_X509_get_d2i(X509 *x, int nid, int *crit, int *idx); void *X509V3_CRL_get_d2i(X509_CRL *x, int nid, int *crit, int *idx); void *X509V3_REVOKED_get_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); Loading