From c3e3d02b01421879638bad33c1278c5dd6f0bcd1 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Wed, 27 Sep 2023 14:28:58 +1300 Subject: [PATCH] =?UTF-8?q?hcrypto:=20Don=E2=80=99t=20cast=20away=20const?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Sutton --- lib/hcrypto/bn.c | 4 ++-- lib/hcrypto/pkcs12.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/hcrypto/bn.c b/lib/hcrypto/bn.c index 62297b145..9e9db4ec8 100644 --- a/lib/hcrypto/bn.c +++ b/lib/hcrypto/bn.c @@ -235,7 +235,7 @@ static const unsigned char is_set[8] = { 1, 2, 4, 8, 16, 32, 64, 128 }; int BN_is_bit_set(const BIGNUM *bn, int bit) { - heim_integer *hi = (heim_integer *)bn; + const heim_integer *hi = (const heim_integer *)bn; unsigned char *p = hi->data; if ((bit / 8) >= hi->length || hi->length == 0) @@ -306,7 +306,7 @@ BN_set_word(BIGNUM *bn, unsigned long num) unsigned long BN_get_word(const BIGNUM *bn) { - heim_integer *hi = (heim_integer *)bn; + const heim_integer *hi = (const heim_integer *)bn; unsigned long num = 0; int i; diff --git a/lib/hcrypto/pkcs12.c b/lib/hcrypto/pkcs12.c index 5f0791fee..29fc52436 100644 --- a/lib/hcrypto/pkcs12.c +++ b/lib/hcrypto/pkcs12.c @@ -78,7 +78,7 @@ PKCS12_key_gen(const void *key, size_t keylen, if (salt && saltlen > 0) { for (i = 0; i < vlen; i++) - I[i] = ((unsigned char*)salt)[i % saltlen]; + I[i] = ((const unsigned char*)salt)[i % saltlen]; size_I += vlen; } /* @@ -89,7 +89,7 @@ PKCS12_key_gen(const void *key, size_t keylen, if (key) { for (i = 0; i < vlen / 2; i++) { I[(i * 2) + size_I] = 0; - I[(i * 2) + size_I + 1] = ((unsigned char*)key)[i % (keylen + 1)]; + I[(i * 2) + size_I + 1] = ((const unsigned char*)key)[i % (keylen + 1)]; } size_I += vlen; }