diff options
Diffstat (limited to 'src/lib/libssl/t1_lib.c')
-rw-r--r-- | src/lib/libssl/t1_lib.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c index 4e4fa21687..958c105dd9 100644 --- a/src/lib/libssl/t1_lib.c +++ b/src/lib/libssl/t1_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: t1_lib.c,v 1.96 2016/12/21 16:44:31 jsing Exp $ */ | 1 | /* $OpenBSD: t1_lib.c,v 1.97 2017/01/22 05:14:42 beck Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -371,8 +371,8 @@ tls1_get_formatlist(SSL *s, int client_formats, const uint8_t **pformats, | |||
371 | size_t *pformatslen) | 371 | size_t *pformatslen) |
372 | { | 372 | { |
373 | if (client_formats != 0) { | 373 | if (client_formats != 0) { |
374 | *pformats = s->session->tlsext_ecpointformatlist; | 374 | *pformats = SSI(s)->tlsext_ecpointformatlist; |
375 | *pformatslen = s->session->tlsext_ecpointformatlist_length; | 375 | *pformatslen = SSI(s)->tlsext_ecpointformatlist_length; |
376 | return; | 376 | return; |
377 | } | 377 | } |
378 | 378 | ||
@@ -394,8 +394,8 @@ tls1_get_curvelist(SSL *s, int client_curves, const uint16_t **pcurves, | |||
394 | size_t *pcurveslen) | 394 | size_t *pcurveslen) |
395 | { | 395 | { |
396 | if (client_curves != 0) { | 396 | if (client_curves != 0) { |
397 | *pcurves = s->session->tlsext_ellipticcurvelist; | 397 | *pcurves = SSI(s)->tlsext_ellipticcurvelist; |
398 | *pcurveslen = s->session->tlsext_ellipticcurvelist_length; | 398 | *pcurveslen = SSI(s)->tlsext_ellipticcurvelist_length; |
399 | return; | 399 | return; |
400 | } | 400 | } |
401 | 401 | ||
@@ -956,7 +956,7 @@ ssl_add_serverhello_tlsext(SSL *s, unsigned char *p, unsigned char *limit) | |||
956 | alg_a = s->s3->tmp.new_cipher->algorithm_auth; | 956 | alg_a = s->s3->tmp.new_cipher->algorithm_auth; |
957 | alg_k = s->s3->tmp.new_cipher->algorithm_mkey; | 957 | alg_k = s->s3->tmp.new_cipher->algorithm_mkey; |
958 | using_ecc = ((alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA)) && | 958 | using_ecc = ((alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA)) && |
959 | s->session->tlsext_ecpointformatlist != NULL; | 959 | SSI(s)->tlsext_ecpointformatlist != NULL; |
960 | 960 | ||
961 | ret += 2; | 961 | ret += 2; |
962 | if (ret >= limit) | 962 | if (ret >= limit) |
@@ -1343,9 +1343,9 @@ ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, | |||
1343 | } | 1343 | } |
1344 | 1344 | ||
1345 | if (!s->hit) { | 1345 | if (!s->hit) { |
1346 | free(s->session->tlsext_ecpointformatlist); | 1346 | free(SSI(s)->tlsext_ecpointformatlist); |
1347 | s->session->tlsext_ecpointformatlist = NULL; | 1347 | SSI(s)->tlsext_ecpointformatlist = NULL; |
1348 | s->session->tlsext_ecpointformatlist_length = 0; | 1348 | SSI(s)->tlsext_ecpointformatlist_length = 0; |
1349 | 1349 | ||
1350 | if ((formats = reallocarray(NULL, formatslen, | 1350 | if ((formats = reallocarray(NULL, formatslen, |
1351 | sizeof(uint8_t))) == NULL) { | 1351 | sizeof(uint8_t))) == NULL) { |
@@ -1353,8 +1353,8 @@ ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, | |||
1353 | return 0; | 1353 | return 0; |
1354 | } | 1354 | } |
1355 | memcpy(formats, sdata, formatslen); | 1355 | memcpy(formats, sdata, formatslen); |
1356 | s->session->tlsext_ecpointformatlist = formats; | 1356 | SSI(s)->tlsext_ecpointformatlist = formats; |
1357 | s->session->tlsext_ecpointformatlist_length = | 1357 | SSI(s)->tlsext_ecpointformatlist_length = |
1358 | formatslen; | 1358 | formatslen; |
1359 | } | 1359 | } |
1360 | } else if (type == TLSEXT_TYPE_elliptic_curves && | 1360 | } else if (type == TLSEXT_TYPE_elliptic_curves && |
@@ -1375,11 +1375,11 @@ ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, | |||
1375 | curveslen /= 2; | 1375 | curveslen /= 2; |
1376 | 1376 | ||
1377 | if (!s->hit) { | 1377 | if (!s->hit) { |
1378 | if (s->session->tlsext_ellipticcurvelist) { | 1378 | if (SSI(s)->tlsext_ellipticcurvelist) { |
1379 | *al = TLS1_AD_DECODE_ERROR; | 1379 | *al = TLS1_AD_DECODE_ERROR; |
1380 | return 0; | 1380 | return 0; |
1381 | } | 1381 | } |
1382 | s->session->tlsext_ellipticcurvelist_length = 0; | 1382 | SSI(s)->tlsext_ellipticcurvelist_length = 0; |
1383 | if ((curves = reallocarray(NULL, curveslen, | 1383 | if ((curves = reallocarray(NULL, curveslen, |
1384 | sizeof(uint16_t))) == NULL) { | 1384 | sizeof(uint16_t))) == NULL) { |
1385 | *al = TLS1_AD_INTERNAL_ERROR; | 1385 | *al = TLS1_AD_INTERNAL_ERROR; |
@@ -1387,8 +1387,8 @@ ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, | |||
1387 | } | 1387 | } |
1388 | for (i = 0; i < curveslen; i++) | 1388 | for (i = 0; i < curveslen; i++) |
1389 | n2s(sdata, curves[i]); | 1389 | n2s(sdata, curves[i]); |
1390 | s->session->tlsext_ellipticcurvelist = curves; | 1390 | SSI(s)->tlsext_ellipticcurvelist = curves; |
1391 | s->session->tlsext_ellipticcurvelist_length = curveslen; | 1391 | SSI(s)->tlsext_ellipticcurvelist_length = curveslen; |
1392 | } | 1392 | } |
1393 | } | 1393 | } |
1394 | else if (type == TLSEXT_TYPE_session_ticket) { | 1394 | else if (type == TLSEXT_TYPE_session_ticket) { |
@@ -1671,9 +1671,9 @@ ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, size_t n, int *al) | |||
1671 | } | 1671 | } |
1672 | 1672 | ||
1673 | if (!s->hit) { | 1673 | if (!s->hit) { |
1674 | free(s->session->tlsext_ecpointformatlist); | 1674 | free(SSI(s)->tlsext_ecpointformatlist); |
1675 | s->session->tlsext_ecpointformatlist = NULL; | 1675 | SSI(s)->tlsext_ecpointformatlist = NULL; |
1676 | s->session->tlsext_ecpointformatlist_length = 0; | 1676 | SSI(s)->tlsext_ecpointformatlist_length = 0; |
1677 | 1677 | ||
1678 | if ((formats = reallocarray(NULL, formatslen, | 1678 | if ((formats = reallocarray(NULL, formatslen, |
1679 | sizeof(uint8_t))) == NULL) { | 1679 | sizeof(uint8_t))) == NULL) { |
@@ -1681,8 +1681,8 @@ ssl_parse_serverhello_tlsext(SSL *s, unsigned char **p, size_t n, int *al) | |||
1681 | return 0; | 1681 | return 0; |
1682 | } | 1682 | } |
1683 | memcpy(formats, sdata, formatslen); | 1683 | memcpy(formats, sdata, formatslen); |
1684 | s->session->tlsext_ecpointformatlist = formats; | 1684 | SSI(s)->tlsext_ecpointformatlist = formats; |
1685 | s->session->tlsext_ecpointformatlist_length = | 1685 | SSI(s)->tlsext_ecpointformatlist_length = |
1686 | formatslen; | 1686 | formatslen; |
1687 | } | 1687 | } |
1688 | } | 1688 | } |
@@ -1946,15 +1946,15 @@ ssl_check_serverhello_tlsext(SSL *s) | |||
1946 | unsigned long alg_a = s->s3->tmp.new_cipher->algorithm_auth; | 1946 | unsigned long alg_a = s->s3->tmp.new_cipher->algorithm_auth; |
1947 | if ((s->tlsext_ecpointformatlist != NULL) && | 1947 | if ((s->tlsext_ecpointformatlist != NULL) && |
1948 | (s->tlsext_ecpointformatlist_length > 0) && | 1948 | (s->tlsext_ecpointformatlist_length > 0) && |
1949 | (s->session->tlsext_ecpointformatlist != NULL) && | 1949 | (SSI(s)->tlsext_ecpointformatlist != NULL) && |
1950 | (s->session->tlsext_ecpointformatlist_length > 0) && | 1950 | (SSI(s)->tlsext_ecpointformatlist_length > 0) && |
1951 | ((alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA))) { | 1951 | ((alg_k & SSL_kECDHE) || (alg_a & SSL_aECDSA))) { |
1952 | /* we are using an ECC cipher */ | 1952 | /* we are using an ECC cipher */ |
1953 | size_t i; | 1953 | size_t i; |
1954 | unsigned char *list; | 1954 | unsigned char *list; |
1955 | int found_uncompressed = 0; | 1955 | int found_uncompressed = 0; |
1956 | list = s->session->tlsext_ecpointformatlist; | 1956 | list = SSI(s)->tlsext_ecpointformatlist; |
1957 | for (i = 0; i < s->session->tlsext_ecpointformatlist_length; i++) { | 1957 | for (i = 0; i < SSI(s)->tlsext_ecpointformatlist_length; i++) { |
1958 | if (*(list++) == TLSEXT_ECPOINTFORMAT_uncompressed) { | 1958 | if (*(list++) == TLSEXT_ECPOINTFORMAT_uncompressed) { |
1959 | found_uncompressed = 1; | 1959 | found_uncompressed = 1; |
1960 | break; | 1960 | break; |