diff --git a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp index 7899868c..d9b95925 100644 --- a/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp +++ b/libwvdrmengine/oemcrypto/test/oemcrypto_test.cpp @@ -2631,7 +2631,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange1) { size_t wrapped_key_length = 0; ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, NULL, &wrapped_key_length)); @@ -2641,7 +2641,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange1) { ASSERT_NE( OEMCrypto_SUCCESS, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, &(wrapped_key.front()), &wrapped_key_length)); } @@ -2659,7 +2659,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange2) { size_t wrapped_key_length = 0; ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, NULL, &wrapped_key_length)); @@ -2670,7 +2670,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange2) { ASSERT_NE(OEMCrypto_SUCCESS, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, &bad_buffer[0], encrypted.rsa_key_length, encrypted.rsa_key_iv, &(wrapped_key.front()), &wrapped_key_length)); @@ -2690,7 +2690,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange3) { size_t wrapped_key_length = 0; ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, NULL, &wrapped_key_length)); @@ -2701,7 +2701,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRange3) { ASSERT_NE(OEMCrypto_SUCCESS, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, &bad_buffer[0], &(wrapped_key.front()), &wrapped_key_length)); @@ -2721,7 +2721,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadSignature) { size_t wrapped_key_length = 0; ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, NULL, &wrapped_key_length)); @@ -2730,7 +2730,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadSignature) { signature[4] ^= 42; // bad signature. ASSERT_NE(OEMCrypto_SUCCESS, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, &(wrapped_key.front()), &wrapped_key_length)); @@ -2750,7 +2750,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadNonce) { size_t wrapped_key_length = 0; ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, NULL, &wrapped_key_length)); @@ -2759,7 +2759,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadNonce) { encrypted.nonce ^= 42; // Almost surely a bad nonce. ASSERT_NE(OEMCrypto_SUCCESS, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, &(wrapped_key.front()), &wrapped_key_length)); @@ -2779,7 +2779,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRSAKey) { size_t wrapped_key_length = 0; ASSERT_EQ(OEMCrypto_ERROR_SHORT_BUFFER, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, NULL, &wrapped_key_length)); @@ -2788,7 +2788,7 @@ TEST_F(DISABLED_TestKeybox, CertificateProvisionBadRSAKey) { encrypted.rsa_key[1] ^= 42; // Almost surely a bad key. ASSERT_NE(OEMCrypto_SUCCESS, OEMCrypto_RewrapDeviceRSAKey( - s.session_id(), message_ptr, sizeof(MessageData), &signature[0], + s.session_id(), message_ptr, sizeof(encrypted), &signature[0], signature.size(), &encrypted.nonce, encrypted.rsa_key, encrypted.rsa_key_length, encrypted.rsa_key_iv, &(wrapped_key.front()), &wrapped_key_length));