OEMCrypto_GetRandom should only be called after init
Merge from master branch of Widevine repo of http://go/wvgerrit/66079 Merge from oemcrypto-v15 branch of Widevine repo of http://go/wvgerrit/65662 This CL forces OEMCrypto_Initialize to be called before OEMCrypto_GetRandom is called in the reference code. Bug: 34847139 Test: tested as part of http://go/ag/5501993 Change-Id: Ibb94e2fdc11cdb43c2c7bd2a3379f87b0155479a
This commit is contained in:
@@ -731,6 +731,10 @@ extern "C" OEMCryptoResult OEMCrypto_GetKeyData(uint8_t* keyData,
|
|||||||
|
|
||||||
extern "C" OEMCryptoResult OEMCrypto_GetRandom(uint8_t* randomData,
|
extern "C" OEMCryptoResult OEMCrypto_GetRandom(uint8_t* randomData,
|
||||||
size_t dataLength) {
|
size_t dataLength) {
|
||||||
|
if (!crypto_engine) {
|
||||||
|
LOGE("OEMCrypto_GetRandom: OEMCrypto Not Initialized.");
|
||||||
|
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
||||||
|
}
|
||||||
if (!randomData) {
|
if (!randomData) {
|
||||||
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
return OEMCrypto_ERROR_UNKNOWN_FAILURE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user