Check for key size before files decryption
This commit is contained in:
parent
7d93817e49
commit
7d161133c3
|
@ -119,7 +119,8 @@ namespace gourou
|
|||
DRM_FILE_ERROR,
|
||||
DRM_FORMAT_NOT_SUPPORTED,
|
||||
DRM_IN_OUT_EQUALS,
|
||||
DRM_MISSING_PARAMETER
|
||||
DRM_MISSING_PARAMETER,
|
||||
DRM_INVALID_KEY_SIZE
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user