Skip to content

Commit

Permalink
extract getaltname
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabian Mauchle committed Sep 4, 2020
1 parent 1bcc63a commit 946cef3
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions tlscommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,20 +604,14 @@ static int subjectaltnamerid(X509 *cert, const char *oid) {
}

static int subjectaltnameaddr(X509 *cert, int family, struct in6_addr *addr) {
int loc, i, l, n, r = 0;
int i, l, n, r = 0;
char *v;
X509_EXTENSION *ex;
STACK_OF(GENERAL_NAME) *alt;
GENERAL_NAME *gn;

debug(DBG_DBG, "subjectaltnameaddr");

loc = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1);
if (loc < 0)
return r;

ex = X509_get_ext(cert, loc);
alt = X509V3_EXT_d2i(ex);
alt = getaltname(cert);
if (!alt)
return r;

Expand All @@ -640,21 +634,15 @@ static int subjectaltnameaddr(X509 *cert, int family, struct in6_addr *addr) {
}

static int subjectaltnameregexp(X509 *cert, int type, char *othernametype, char *exact, regex_t *regex) {
int loc, i, l, n, r = 0;
int i, l, n, r = 0;
char *s, *v, *fail = NULL, *tmp;
X509_EXTENSION *ex;
STACK_OF(GENERAL_NAME) *alt;
GENERAL_NAME *gn;
ASN1_OBJECT *othernameoid;

debug(DBG_DBG, "subjectaltnameregexp");

loc = X509_get_ext_by_NID(cert, NID_subject_alt_name, -1);
if (loc < 0)
return r;

ex = X509_get_ext(cert, loc);
alt = X509V3_EXT_d2i(ex);
alt = getaltname(cert);
if (!alt)
return r;

Expand Down

0 comments on commit 946cef3

Please sign in to comment.