test/src/crypto/sr25519/sr25519_provider_test.cpp
TEST_F(SR25519ProviderTest, DISABLED_VerifyInvalidKeyFail) {
  auto kp = sr25519_provider->generateKeypair();
  EXPECT_OUTCOME_TRUE(signature, sr25519_provider->sign(kp, message_span));
  // make public key invalid
  kp.public_key.fill(1);
  EXPECT_OUTCOME_FALSE_1(
      sr25519_provider->verify(signature, message_span, kp.public_key));
}
/**
 * Don't try to verify a message and signature against an invalid key, this may
 * lead to program termination
 *
 * @given sr25519 provider instance configured with boost random generator
 * @and and a predefined message
 * @when generate keypair @and sign message
 * @and generate another keypair and take public part for verification
 * @and verify signed message
 * @then verification fails
 */
Don't try to verify a message and signature against an invalid key, this may
lead to program termination


Don ' t try to verify a message and signature against an invalid key this may lead to program termination
TEST_F(SR25519ProviderTest, DISABLED_VerifyInvalidKeyFail) {
  auto kp = sr25519_provider->generateKeypair();
  EXPECT_OUTCOME_TRUE(signature, sr25519_provider->sign(kp, message_span));
  kp.public_key.fill(1);
  EXPECT_OUTCOME_FALSE_1(
      sr25519_provider->verify(signature, message_span, kp.public_key));
}
TEST_F ( SR25519ProviderTest , DISABLED_VerifyInvalidKeyFail ) { auto kp = sr25519_provider -> generateKeypair ( ) ; EXPECT_OUTCOME_TRUE ( signature , sr25519_provider -> sign ( kp , message_span ) ) ; kp . public_key . fill ( 1 ) ; EXPECT_OUTCOME_FALSE_1 ( sr25519_provider -> verify ( signature , message_span , kp . public_key ) ) ; }
Don't try to verify a message and signature against an invalid key, this may
 lead to program termination
Don ' t try to verify a message and signature against an invalid key this may lead to program termination
// make public key invalid