hcrypto: Don’t cast away const
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
This commit is contained in:

committed by
Nico Williams

parent
c922303dd0
commit
c3e3d02b01
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user