summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2022-08-30 00:22:35 +0000
committerDaiki Ueno <ueno@gnu.org>2022-08-30 00:22:35 +0000
commit9bf62ca7952c126df8f1befc5c42c4bd9105011d (patch)
tree06ea69949062f4152d1a1bd5f0b19a92476a57f5
parentf3b1543fb13b607996652c1c1dadda2ccbeb8c02 (diff)
parent0e703646331e66d2d3e6bb5001c2872b82e5a20b (diff)
downloadgnutls-9bf62ca7952c126df8f1befc5c42c4bd9105011d.tar.gz
Merge branch 'fix_nettle_alignment' into 'master'
cipher: Ensure correct alignment See merge request gnutls/gnutls!1633
-rw-r--r--lib/nettle/cipher.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/nettle/cipher.c b/lib/nettle/cipher.c
index b41862d1ea..c9c59fb0ba 100644
--- a/lib/nettle/cipher.c
+++ b/lib/nettle/cipher.c
@@ -1096,7 +1096,7 @@ wrap_nettle_cipher_init(gnutls_cipher_algorithm_t algo, void **_ctx,
int enc)
{
struct nettle_cipher_ctx *ctx;
- ptrdiff_t cur_alignment;
+ uintptr_t cur_alignment;
int idx = -1;
unsigned i;
uint8_t *ctx_ptr;
@@ -1120,7 +1120,7 @@ wrap_nettle_cipher_init(gnutls_cipher_algorithm_t algo, void **_ctx,
ctx->enc = enc;
ctx_ptr = ((uint8_t*)ctx) + sizeof(*ctx);
- cur_alignment = ((ptrdiff_t)ctx_ptr) % 16;
+ cur_alignment = ((uintptr_t)ctx_ptr) % 16;
if (cur_alignment > 0)
ctx_ptr += 16 - cur_alignment;