| 1073 | } |
| 1074 | |
| 1075 | bool CryptConfig::InitGCMContentKey(const BYTE *key) |
| 1076 | { |
| 1077 | if (!m_HKDF) |
| 1078 | return true; |
| 1079 | |
| 1080 | m_pGcmContentKey = new LockZeroBuffer<BYTE>(MASTER_KEY_LEN, false); |
| 1081 | |
| 1082 | if (!m_pGcmContentKey->IsLocked()) |
| 1083 | return false; |
| 1084 | |
| 1085 | m_keybuf_manager.RegisterBuf(m_pGcmContentKey); |
| 1086 | |
| 1087 | |
| 1088 | if (!hkdfDerive(key, MASTER_KEY_LEN, m_pGcmContentKey->m_buf, m_pGcmContentKey->m_len, hkdfInfoGCMContent)) |
| 1089 | return false; |
| 1090 | |
| 1091 | return true; |
| 1092 | } |
| 1093 |
no test coverage detected