Check for key size before files decryption

This commit is contained in:
2022-02-22 20:58:26 +01:00
parent 7d93817e49
commit 7d161133c3
2 changed files with 6 additions and 1 deletions

View File

@@ -927,8 +927,12 @@ namespace gourou
void DRMProcessor::decryptADEPTKey(const std::string& encryptedKey, unsigned char* decryptedKey)
{
if (encryptedKey.size() != 172)
EXCEPTION(DRM_INVALID_KEY_SIZE, "Invalid encrypted key size (" << encryptedKey.size() << "). DRM version not supported");
ByteArray arrayEncryptedKey = ByteArray::fromBase64(encryptedKey);
std::string privateKeyData = user->getPrivateLicenseKey();
ByteArray privateRSAKey = ByteArray::fromBase64(privateKeyData);