accept >= 0 and valid return codes from RAND_bytes due to broken engine from the isc bind implementation, reported by Sam Liddicott
This commit is contained in:
@@ -3991,7 +3991,7 @@ krb5_generate_random_block(void *buf, size_t len)
|
|||||||
rng_initialized = 1;
|
rng_initialized = 1;
|
||||||
}
|
}
|
||||||
HEIMDAL_MUTEX_unlock(&crypto_mutex);
|
HEIMDAL_MUTEX_unlock(&crypto_mutex);
|
||||||
if (RAND_bytes(buf, len) != 1)
|
if (RAND_bytes(buf, len) <= 0)
|
||||||
krb5_abortx(NULL, "Failed to generate random block");
|
krb5_abortx(NULL, "Failed to generate random block");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -38,7 +38,7 @@ krb5_generate_seq_number(krb5_context context,
|
|||||||
const krb5_keyblock *key,
|
const krb5_keyblock *key,
|
||||||
uint32_t *seqno)
|
uint32_t *seqno)
|
||||||
{
|
{
|
||||||
if (RAND_bytes((void *)seqno, sizeof(*seqno)) != 1)
|
if (RAND_bytes((void *)seqno, sizeof(*seqno)) <= 0)
|
||||||
krb5_abortx(context, "Failed to generate random block");
|
krb5_abortx(context, "Failed to generate random block");
|
||||||
/* MIT used signed numbers, lets not stomp into that space directly */
|
/* MIT used signed numbers, lets not stomp into that space directly */
|
||||||
*seqno &= 0x3fffffff;
|
*seqno &= 0x3fffffff;
|
||||||
|
Reference in New Issue
Block a user