summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2014-06-10 14:49:15 +0000
committerjsing <jsing@openbsd.org>2014-06-10 14:49:15 +0000
commit896861f891623ef12c9d979b39e7e28b532300e1 (patch)
treecc8a23e795afcfd82efe0bc8f3559000131996a0
parentIn tls1_cert_verify_mac(), check the return value of EVP_MD_CTX_copy_ex() (diff)
downloadwireguard-openbsd-896861f891623ef12c9d979b39e7e28b532300e1.tar.xz
wireguard-openbsd-896861f891623ef12c9d979b39e7e28b532300e1.zip
Remove pointless casts and use c instead of &c[0], since it is the same
thing for an unsigned char array. ok deraadt@
-rw-r--r--lib/libssl/src/ssl/s3_enc.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/libssl/src/ssl/s3_enc.c b/lib/libssl/src/ssl/s3_enc.c
index c934e04eea5..8f88a4a88df 100644
--- a/lib/libssl/src/ssl/s3_enc.c
+++ b/lib/libssl/src/ssl/s3_enc.c
@@ -805,11 +805,7 @@ int
ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
int len)
{
- static const unsigned char *salt[3] = {
- (const unsigned char *)"A",
- (const unsigned char *)"BB",
- (const unsigned char *)"CCC",
- };
+ static const unsigned char *salt[3] = { "A", "BB", "CCC", };
unsigned char buf[EVP_MAX_MD_SIZE];
EVP_MD_CTX ctx;
int i, ret = 0;
@@ -820,10 +816,8 @@ ssl3_generate_master_secret(SSL *s, unsigned char *out, unsigned char *p,
EVP_DigestInit_ex(&ctx, s->ctx->sha1, NULL);
EVP_DigestUpdate(&ctx, salt[i], strlen((const char *)salt[i]));
EVP_DigestUpdate(&ctx, p, len);
- EVP_DigestUpdate(&ctx, &(s->s3->client_random[0]),
- SSL3_RANDOM_SIZE);
- EVP_DigestUpdate(&ctx, &(s->s3->server_random[0]),
- SSL3_RANDOM_SIZE);
+ EVP_DigestUpdate(&ctx, s->s3->client_random, SSL3_RANDOM_SIZE);
+ EVP_DigestUpdate(&ctx, s->s3->server_random, SSL3_RANDOM_SIZE);
EVP_DigestFinal_ex(&ctx, buf, &n);
EVP_DigestInit_ex(&ctx, s->ctx->md5, NULL);