From 24c2ca2f9bc9ea30962a2a0ca3a636192494e9ad Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Tue, 12 Aug 2014 14:12:23 -0700 Subject: [PATCH] Integers encoded with PKCS#8 binary DER should have sign bit Copy of widevine change: https://widevine-internal-review.googlesource.com/#/c/10910/ This CL adds a leading 0 to integers in the RSA test key in oemcrypt_test.cpp. Before this CL, versions of OEMCrypto that correctly interpret the encoding were treating some large integers as negative. bug: 16876126 Change-Id: I1990fdb09509c15566d12d4cfcd055e9d200e08a --- libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index e90f84b2..0c436808 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -3080,6 +3080,7 @@ class DISABLED_AlternateRSAKey : public DISABLED_TestKeybox { void BuildRSAKey() { vector field_n = encode(0x02, wvcdm::a2b_hex( + "00" "df271fd25f8644496b0c81be4bd50297" "ef099b002a6fd67727eb449cea566ed6" "a3981a71312a141cabc9815c1209e320" @@ -3099,6 +3100,7 @@ class DISABLED_AlternateRSAKey : public DISABLED_TestKeybox { vector field_e = encode(0x02, wvcdm::a2b_hex("010001")); vector field_d = encode(0x02, wvcdm::a2b_hex( + "00" "5bd910257830dce17520b03441a51a8c" "ab94020ac6ecc252c808f3743c95b7c8" "3b8c8af1a5014346ebc4242cdfb5d718" @@ -3117,6 +3119,7 @@ class DISABLED_AlternateRSAKey : public DISABLED_TestKeybox { "d4c6591c807defd71ab06866bb5e7745")); vector field_p = encode(0x02, wvcdm::a2b_hex( + "00" "f44f5e4246391f482b2f5296e3602eb3" "4aa136427710f7c0416d403fd69d4b29" "130cfebef34e885abdb1a8a0a5f0e9b5" @@ -3127,6 +3130,7 @@ class DISABLED_AlternateRSAKey : public DISABLED_TestKeybox { "bd9efc123d9c54b6705590d006cfcf3f")); vector field_q = encode(0x02, wvcdm::a2b_hex( + "00" "e9d49841e0e0a6ad0d517857133e36dc" "72c1bdd90f9174b52e26570f373640f1" "c185e7ea8e2ed7f1e4ebb951f70a5802" @@ -3137,6 +3141,7 @@ class DISABLED_AlternateRSAKey : public DISABLED_TestKeybox { "9eec1cf85e80aba079b2e6106b97bced")); vector field_exp1 = encode(0x02, wvcdm::a2b_hex( + "00" "ed102acdb26871534d1c414ecad9a4d7" "32fe95b10eea370da62f05de2c393b1a" "633303ea741b6b3269c97f704b352702" @@ -3147,6 +3152,7 @@ class DISABLED_AlternateRSAKey : public DISABLED_TestKeybox { "0dcbbc9b528f64a01706e05b0b91106f")); vector field_exp2 = encode(0x02, wvcdm::a2b_hex( + "00" "6827924a85e88b55ba00f8219128bd37" "24c6b7d1dfe5629ef197925fecaff5ed" "b9cdf3a7befd8ea2e8dd3707138b3ff8" @@ -3157,6 +3163,7 @@ class DISABLED_AlternateRSAKey : public DISABLED_TestKeybox { "eec82d7f5458ec19e71b90eeef7dff61")); vector field_invq = encode(0x02, wvcdm::a2b_hex( + "00" "57b73888d183a99a6307422277551a3d" "9e18adf06a91e8b55ceffef9077c8496" "948ecb3b16b78155cb2a3a57c119d379"