/* Generate a 'random' blob of data used for the generation of keys.  */
static void ICACHE_FLASH_ATTR generate_key_block(uint8_t *client_random, uint8_t *server_random, uint8_t *master_secret, uint8_t *key_block, int key_block_size)
/* Generate a 'random' blob of data used for the generation of keys.  */
static void ICACHE_FLASH_ATTR generate_key_block(uint8_t *client_random, uint8_t *server_random, uint8_t *master_secret, uint8_t *key_block, int key_block_size)
{
    uint8_t buf[128];
    strcpy((char *)buf, "key expansion");
    memcpy(&buf[13], server_random, SSL_RANDOM_SIZE);
    memcpy(&buf[45], client_random, SSL_RANDOM_SIZE);
    prf(master_secret, SSL_SECRET_SIZE, buf, 77, key_block, key_block_size);
}