ports/security/libsrtp/patches/patch-crypto_cipher_cipher_c

13 lines
542 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: crypto/cipher/cipher.c
--- crypto/cipher/cipher.c.orig
+++ crypto/cipher/cipher.c
@@ -462,7 +462,7 @@ srtp_err_status_t srtp_cipher_type_test(
uint8_t iv[MAX_KEY_LEN];
/* choose a length at random (leaving room for IV and padding) */
- length = srtp_cipher_rand_u32_for_tests() % (SELF_TEST_BUF_OCTETS - 64);
+ length = arc4random_uniform(SELF_TEST_BUF_OCTETS - 64);
debug_print(srtp_mod_cipher, "random plaintext length %d\n", length);
srtp_cipher_rand_for_tests(buffer, length);