diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2016-12-03 12:34:36 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2016-12-03 12:34:36 +0000 |
commit | cad14f51aebc7375358f11d389b249d008b2b434 (patch) | |
tree | 29442a1b124f969635f620047500a59986fda82c /lib | |
parent | f74ccc422671ae68ab7bc64fe9e5d174019d1056 (diff) |
Avoid signed vs unsigned warnings from clang by adding two casts,
slightly rewriting some code and changing the type of an array.
ok bcook@ doug@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/bs_ber.c | 6 | ||||
-rw-r--r-- | lib/libssl/s3_clnt.c | 4 | ||||
-rw-r--r-- | lib/libssl/s3_srvr.c | 4 | ||||
-rw-r--r-- | lib/libssl/ssl_asn1.c | 4 |
4 files changed, 10 insertions, 8 deletions
diff --git a/lib/libssl/bs_ber.c b/lib/libssl/bs_ber.c index 6e945a02466..7863b8be0cd 100644 --- a/lib/libssl/bs_ber.c +++ b/lib/libssl/bs_ber.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs_ber.c,v 1.8 2015/06/21 16:10:45 doug Exp $ */ +/* $OpenBSD: bs_ber.c,v 1.9 2016/12/03 12:34:35 jsing Exp $ */ /* * Copyright (c) 2014, Google Inc. * @@ -103,7 +103,9 @@ is_primitive_type(unsigned int tag) static char is_eoc(size_t header_len, CBS *contents) { - return header_len == 2 && CBS_mem_equal(contents, "\x00\x00", 2); + const unsigned char eoc[] = {0x0, 0x0}; + + return header_len == 2 && CBS_mem_equal(contents, eoc, 2); } /* diff --git a/lib/libssl/s3_clnt.c b/lib/libssl/s3_clnt.c index 57c11f458a7..08b804dcfe4 100644 --- a/lib/libssl/s3_clnt.c +++ b/lib/libssl/s3_clnt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_clnt.c,v 1.145 2016/11/06 09:44:51 bcook Exp $ */ +/* $OpenBSD: s3_clnt.c,v 1.146 2016/12/03 12:34:35 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1574,7 +1574,7 @@ ssl3_get_certificate_request(SSL *s) if (ctype_num > SSL3_CT_NUMBER) ctype_num = SSL3_CT_NUMBER; if (!CBS_get_bytes(&cert_request, &ctypes, ctype_num) || - !CBS_write_bytes(&ctypes, s->s3->tmp.ctype, + !CBS_write_bytes(&ctypes, (uint8_t *)s->s3->tmp.ctype, sizeof(s->s3->tmp.ctype), NULL)) { SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_DATA_LENGTH_TOO_LONG); diff --git a/lib/libssl/s3_srvr.c b/lib/libssl/s3_srvr.c index e0d16e5cf2f..0873437fcba 100644 --- a/lib/libssl/s3_srvr.c +++ b/lib/libssl/s3_srvr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_srvr.c,v 1.133 2016/11/17 15:22:41 jsing Exp $ */ +/* $OpenBSD: s3_srvr.c,v 1.134 2016/12/03 12:34:35 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1632,7 +1632,7 @@ err: static int ssl3_get_client_kex_rsa(SSL *s, unsigned char *p, long n) { - char fakekey[SSL_MAX_MASTER_KEY_LENGTH]; + unsigned char fakekey[SSL_MAX_MASTER_KEY_LENGTH]; unsigned char *d; RSA *rsa = NULL; EVP_PKEY *pkey = NULL; diff --git a/lib/libssl/ssl_asn1.c b/lib/libssl/ssl_asn1.c index 02124da5204..1b938868685 100644 --- a/lib/libssl/ssl_asn1.c +++ b/lib/libssl/ssl_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_asn1.c,v 1.43 2016/11/05 19:59:01 miod Exp $ */ +/* $OpenBSD: ssl_asn1.c,v 1.44 2016/12/03 12:34:35 jsing Exp $ */ /* * Copyright (c) 2016 Joel Sing <jsing@openbsd.org> @@ -158,7 +158,7 @@ i2d_SSL_SESSION(SSL_SESSION *s, unsigned char **pp) goto err; if (!CBB_add_asn1(&hostname, &value, CBS_ASN1_OCTETSTRING)) goto err; - if (!CBB_add_bytes(&value, s->tlsext_hostname, + if (!CBB_add_bytes(&value, (const uint8_t *)s->tlsext_hostname, strlen(s->tlsext_hostname))) goto err; } |