diff options
author | bcook <> | 2015-09-18 13:04:41 +0000 |
---|---|---|
committer | bcook <> | 2015-09-18 13:04:41 +0000 |
commit | 4fdb8cf7a66cb94037297860a53c51df4b381d59 (patch) | |
tree | e302977117766d44baf6760460707ff4928e05bb /src/lib | |
parent | 21872d1126eec5006b6dcb86debadefbe50113dd (diff) | |
download | openbsd-4fdb8cf7a66cb94037297860a53c51df4b381d59.tar.gz openbsd-4fdb8cf7a66cb94037297860a53c51df4b381d59.tar.bz2 openbsd-4fdb8cf7a66cb94037297860a53c51df4b381d59.zip |
avoid void * pointer arithmetic
ok miod@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/ecdh/ech_key.c | 4 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/ecdh/ech_key.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_key.c b/src/lib/libcrypto/ecdh/ech_key.c index e695b0b9ad..33ee244499 100644 --- a/src/lib/libcrypto/ecdh/ech_key.c +++ b/src/lib/libcrypto/ecdh/ech_key.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ech_key.c,v 1.5 2015/09/13 14:11:57 jsing Exp $ */ | 1 | /* $OpenBSD: ech_key.c,v 1.6 2015/09/18 13:04:41 bcook Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -187,7 +187,7 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, | |||
187 | } else { | 187 | } else { |
188 | /* No KDF, just copy out the key and zero the rest. */ | 188 | /* No KDF, just copy out the key and zero the rest. */ |
189 | if (outlen > buflen) { | 189 | if (outlen > buflen) { |
190 | memset(out + buflen, 0, outlen - buflen); | 190 | memset((void *)((uintptr_t)out + buflen), 0, outlen - buflen); |
191 | outlen = buflen; | 191 | outlen = buflen; |
192 | } | 192 | } |
193 | memcpy(out, buf, outlen); | 193 | memcpy(out, buf, outlen); |
diff --git a/src/lib/libssl/src/crypto/ecdh/ech_key.c b/src/lib/libssl/src/crypto/ecdh/ech_key.c index e695b0b9ad..33ee244499 100644 --- a/src/lib/libssl/src/crypto/ecdh/ech_key.c +++ b/src/lib/libssl/src/crypto/ecdh/ech_key.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ech_key.c,v 1.5 2015/09/13 14:11:57 jsing Exp $ */ | 1 | /* $OpenBSD: ech_key.c,v 1.6 2015/09/18 13:04:41 bcook Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -187,7 +187,7 @@ ecdh_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, | |||
187 | } else { | 187 | } else { |
188 | /* No KDF, just copy out the key and zero the rest. */ | 188 | /* No KDF, just copy out the key and zero the rest. */ |
189 | if (outlen > buflen) { | 189 | if (outlen > buflen) { |
190 | memset(out + buflen, 0, outlen - buflen); | 190 | memset((void *)((uintptr_t)out + buflen), 0, outlen - buflen); |
191 | outlen = buflen; | 191 | outlen = buflen; |
192 | } | 192 | } |
193 | memcpy(out, buf, outlen); | 193 | memcpy(out, buf, outlen); |