diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index 6d9e0252..11d2aacc 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -2879,14 +2879,15 @@ TEST_F(DISABLED_TestKeybox, RSASignature) { OEMCrypto_GetRandom(&licenseRequest[0], licenseRequest.size()); size_t signature_length = 0; + uint8_t signature[500]; + sts = OEMCrypto_GenerateRSASignature(s.session_id(), &licenseRequest[0], - licenseRequest.size(), NULL, + licenseRequest.size(), signature, &signature_length, kSign_RSASSA_PSS); ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, sts); ASSERT_NE(static_cast(0), signature_length); - - uint8_t* signature = new uint8_t[signature_length]; + ASSERT_GE(sizeof(signature), signature_length); sts = OEMCrypto_GenerateRSASignature(s.session_id(), &licenseRequest[0], licenseRequest.size(), signature, @@ -2898,7 +2899,6 @@ TEST_F(DISABLED_TestKeybox, RSASignature) { s.PreparePublicKey(); s.VerifyRSASignature(&licenseRequest[0], licenseRequest.size(), signature, signature_length, kSign_RSASSA_PSS); - delete[] signature; } TEST_F(DISABLED_TestKeybox, LoadRSASessionKey) {