Generate PeriodMetadataIdentifierKey

This commit is contained in:
Patrick Rathje 2020-11-03 16:11:32 +01:00
parent 4a7fcafdbb
commit af833f58d2
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,9 @@ static void check_keys(struct k_work *work){
// we now generate the new interval identifier and re-encrypt the metadata
en_derive_interval_identifier(&intervalIdentifier, &periods[current_period_index].periodKey, currentInterval);
en_derive_period_metadata_encryption_key(&periodMetadataEncryptionKey, &periods[current_period_index].periodKey);
en_encrypt_interval_metadata(&periodMetadataEncryptionKey, &intervalIdentifier, (unsigned char*)&bt_metadata, (unsigned char*)&encryptedMetadata, sizeof(associated_encrypted_metadata_t));
// broadcast intervalIdentifier plus encryptedMetada according to specs