summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lockdown-cu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lockdown-cu.c b/src/lockdown-cu.c
index 11c70c5..c457cb2 100644
--- a/src/lockdown-cu.c
+++ b/src/lockdown-cu.c
@@ -961,12 +961,12 @@ lockdownd_error_t lockdownd_cu_send_request_and_get_reply(lockdownd_client_t cli
961 hkdf_md(MD_ALGO_SHA512, (unsigned char*)READ_KEY_SALT_MDLD, sizeof(READ_KEY_SALT_MDLD)-1, (unsigned char*)READ_KEY_INFO_MDLD, sizeof(READ_KEY_INFO_MDLD)-1, client->cu_key, client->cu_key_len, cu_read_key, &cu_read_key_len); 961 hkdf_md(MD_ALGO_SHA512, (unsigned char*)READ_KEY_SALT_MDLD, sizeof(READ_KEY_SALT_MDLD)-1, (unsigned char*)READ_KEY_INFO_MDLD, sizeof(READ_KEY_INFO_MDLD)-1, client->cu_key, client->cu_key_len, cu_read_key, &cu_read_key_len);
962 962
963 // Starting with iOS/tvOS 11.2 and WatchOS 4.2, this nonce is random and sent along with the request. Before, the request doesn't have a nonce and it uses hardcoded nonce "sendone01234". 963 // Starting with iOS/tvOS 11.2 and WatchOS 4.2, this nonce is random and sent along with the request. Before, the request doesn't have a nonce and it uses hardcoded nonce "sendone01234".
964 unsigned char cu_nonce[12] = "sendone01234"; // guaranteed to be random by fair dice troll 964 unsigned char cu_nonce[] = "sendone01234"; // guaranteed to be random by fair dice troll
965 if (client->device->version >= IDEVICE_DEVICE_VERSION(11,2,0)) { 965 if (client->device->version >= IDEVICE_DEVICE_VERSION(11,2,0)) {
966#if defined(HAVE_OPENSSL) 966#if defined(HAVE_OPENSSL)
967 RAND_bytes(cu_nonce, sizeof(cu_nonce)); 967 RAND_bytes(cu_nonce, sizeof(cu_nonce)-1);
968#elif defined(HAVE_GCRYPT) 968#elif defined(HAVE_GCRYPT)
969 gcry_create_nonce(cu_nonce, sizeof(cu_nonce)); 969 gcry_create_nonce(cu_nonce, sizeof(cu_nonce)-1);
970#endif 970#endif
971 } 971 }
972 972