src/crypto/rsa_private_key_unittest.cc
TEST(RSAPrivateKeyUnitTest, ExtraData) {
  std::vector<uint8_t> input(kTestPrivateKeyInfo,
                             kTestPrivateKeyInfo + sizeof(kTestPrivateKeyInfo));
  input.push_back(0);

  std::unique_ptr<crypto::RSAPrivateKey> key(
      crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(input));

  // Import should fail.
  EXPECT_FALSE(key);
}
// Test that CreateFromPrivateKeyInfo fails if there is extra data after the RSA
// key.
Test that CreateFromPrivateKeyInfo fails if there is extra data after the RSA
key.
Test that CreateFromPrivateKeyInfo fails if there is extra data after the RSA key .
TEST(RSAPrivateKeyUnitTest, ExtraData) {
  std::vector<uint8_t> input(kTestPrivateKeyInfo,
                             kTestPrivateKeyInfo + sizeof(kTestPrivateKeyInfo));
  input.push_back(0);
  std::unique_ptr<crypto::RSAPrivateKey> key(
      crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(input));
  EXPECT_FALSE(key);
}
TEST ( RSAPrivateKeyUnitTest , ExtraData ) { std :: vector < uint8_t > input ( kTestPrivateKeyInfo , kTestPrivateKeyInfo + sizeof ( kTestPrivateKeyInfo ) ) ; input . push_back ( 0 ) ; std :: unique_ptr < crypto :: RSAPrivateKey > key ( crypto :: RSAPrivateKey :: CreateFromPrivateKeyInfo ( input ) ) ; EXPECT_FALSE ( key ) ; }
Test that CreateFromPrivateKeyInfo fails if there is extra data after the RSA
key.
Test that CreateFromPrivateKeyInfo fails if there is extra data after the RSA key .
// Import should fail.