summaryrefslogtreecommitdiff
path: root/src/crypto/x509v3
diff options
context:
space:
mode:
authorRobert Sloan <varomodt@google.com>2017-02-27 08:17:21 -0800
committerRobert Sloan <varomodt@google.com>2017-02-27 08:22:04 -0800
commit7c50ec5c48b3e57a3de77aab90ef2f7bf9d3ec52 (patch)
tree13317a12aab19f7e85280e7b93294ba7beab8ff5 /src/crypto/x509v3
parent9d94cee4fbc3ada5b20b20d8803744d75687c151 (diff)
downloadboringssl-7c50ec5c48b3e57a3de77aab90ef2f7bf9d3ec52.tar.gz
external/boringssl: Sync to be2ee342d3781ddb954f91f8a7e660c6f59e87e5.
This includes the following changes: https://boringssl.googlesource.com/boringssl/+log/c4796c92e0aced2342ed5687201aea07189c3bc1..be2ee342d3781ddb954f91f8a7e660c6f59e87e5 Test: Libcore CTS Presubmits Change-Id: Ic76542985c98caa096cdf1c72b00a77a88cae5de
Diffstat (limited to 'src/crypto/x509v3')
-rw-r--r--src/crypto/x509v3/v3_utl.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/src/crypto/x509v3/v3_utl.c b/src/crypto/x509v3/v3_utl.c
index b6032740..fe7787bb 100644
--- a/src/crypto/x509v3/v3_utl.c
+++ b/src/crypto/x509v3/v3_utl.c
@@ -824,32 +824,16 @@ static const unsigned char *valid_star(const unsigned char *p, size_t len,
return NULL;
star = &p[i];
state &= ~LABEL_START;
- } else if ((state & LABEL_START) != 0) {
- /*
- * At the start of a label, skip any "xn--" and
- * remain in the LABEL_START state, but set the
- * IDNA label state
- */
- if ((state & LABEL_IDNA) == 0 && len - i >= 4
- && OPENSSL_strncasecmp((char *)&p[i], "xn--", 4) == 0) {
- i += 3;
- state |= LABEL_IDNA;
- continue;
- }
- /* Labels must start with a letter or digit */
- state &= ~LABEL_START;
- if (('a' <= p[i] && p[i] <= 'z')
- || ('A' <= p[i] && p[i] <= 'Z')
- || ('0' <= p[i] && p[i] <= '9'))
- continue;
- return NULL;
} else if (('a' <= p[i] && p[i] <= 'z')
|| ('A' <= p[i] && p[i] <= 'Z')
|| ('0' <= p[i] && p[i] <= '9')) {
- state &= LABEL_IDNA;
- continue;
+ if ((state & LABEL_START) != 0
+ && len - i >= 4
+ && OPENSSL_strncasecmp((char *)&p[i], "xn--", 4) == 0)
+ state |= LABEL_IDNA;
+ state &= ~(LABEL_HYPHEN | LABEL_START);
} else if (p[i] == '.') {
- if (state & (LABEL_HYPHEN | LABEL_START))
+ if ((state & (LABEL_HYPHEN | LABEL_START)) != 0)
return NULL;
state = LABEL_START;
++dots;