Skip to content

Commit

Permalink
Remove deprecated signature::verify API.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Jul 16, 2019
1 parent dd60763 commit b791dd6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 69 deletions.
14 changes: 0 additions & 14 deletions src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,17 +405,3 @@ impl<B: AsRef<[u8]>> UnparsedPublicKey<B> {
)
}
}

/// Deprecated. Use [UnparsedPublicKey::verify()].
///
/// [UnparsedPublicKey::verify()]: UnparsedPublicKey::verify
#[deprecated(note = "Use UnparsedPublicKey::verify")]
pub fn verify(
algorithm: &'static dyn VerificationAlgorithm,
public_key: untrusted::Input,
msg: untrusted::Input,
signature: untrusted::Input,
) -> Result<(), error::Unspecified> {
UnparsedPublicKey::new(algorithm, public_key.as_slice_less_safe())
.verify(msg.as_slice_less_safe(), signature.as_slice_less_safe())
}
18 changes: 0 additions & 18 deletions tests/ecdsa_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,6 @@ fn signature_ecdsa_verify_asn1_test() {
signature::UnparsedPublicKey::new(alg, &public_key).verify(&msg, &sig);
assert_eq!(actual_result.is_ok(), is_valid);

#[allow(deprecated)]
let actual_result = signature::verify(
alg,
untrusted::Input::from(&public_key),
untrusted::Input::from(&msg),
untrusted::Input::from(&sig),
);
assert_eq!(actual_result.is_ok(), is_valid);

Ok(())
},
);
Expand Down Expand Up @@ -199,15 +190,6 @@ fn signature_ecdsa_verify_fixed_test() {
signature::UnparsedPublicKey::new(alg, &public_key).verify(&msg, &sig);
assert_eq!(actual_result.is_ok(), is_valid);

#[allow(deprecated)]
let actual_result = signature::verify(
alg,
untrusted::Input::from(&public_key),
untrusted::Input::from(&msg),
untrusted::Input::from(&sig),
);
assert_eq!(actual_result.is_ok(), is_valid);

Ok(())
},
);
Expand Down
18 changes: 0 additions & 18 deletions tests/ed25519_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,6 @@ fn test_signature_ed25519() {
.is_ok()
);

#[allow(deprecated)]
let actual_result = signature::verify(
&signature::ED25519,
untrusted::Input::from(&public_key),
untrusted::Input::from(&msg),
untrusted::Input::from(&expected_sig),
);
assert!(actual_result.is_ok());

let mut tampered_sig = expected_sig;
tampered_sig[0] ^= 1;

Expand All @@ -93,15 +84,6 @@ fn test_signature_ed25519() {
.is_err()
);

#[allow(deprecated)]
let actual_result = signature::verify(
&signature::ED25519,
untrusted::Input::from(&public_key),
untrusted::Input::from(&msg),
untrusted::Input::from(&tampered_sig),
);
assert!(actual_result.is_err());

Ok(())
});
}
Expand Down
19 changes: 0 additions & 19 deletions tests/rsa_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,6 @@ fn test_signature_rsa_pkcs1_verify() {
signature::UnparsedPublicKey::new(alg, &public_key).verify(&msg, &sig);
assert_eq!(actual_result.is_ok(), is_valid);

// Deprecated API.
#[allow(deprecated)]
let actual_result = signature::verify(
alg,
untrusted::Input::from(&public_key),
untrusted::Input::from(&msg),
untrusted::Input::from(&sig),
);
assert_eq!(actual_result.is_ok(), is_valid);

Ok(())
},
);
Expand Down Expand Up @@ -241,15 +231,6 @@ fn test_signature_rsa_pss_verify() {
signature::UnparsedPublicKey::new(alg, &public_key).verify(&msg, &sig);
assert_eq!(actual_result.is_ok(), is_valid);

#[allow(deprecated)]
let actual_result = signature::verify(
alg,
untrusted::Input::from(&public_key),
untrusted::Input::from(&msg),
untrusted::Input::from(&sig),
);
assert_eq!(actual_result.is_ok(), is_valid);

Ok(())
},
);
Expand Down

0 comments on commit b791dd6

Please sign in to comment.