aboutsummaryrefslogtreecommitdiff
path: root/srp/tests/bad_public.rs
diff options
context:
space:
mode:
authorJosh Brown <josh9051@gmail.com>2022-01-22 09:38:33 -0500
committerGitHub <noreply@github.com>2022-01-22 07:38:33 -0700
commit6d963225520f0d8e5948457b8ba25bd563382f5e (patch)
tree12c05900061a93c74242d37f5dc1935977c9bd8c /srp/tests/bad_public.rs
parent689dc0ab6af950b027b4bab96f73c427d2c42d6e (diff)
downloadPAKEs-6d963225520f0d8e5948457b8ba25bd563382f5e.tar.xz
srp: rebuild library (#79)
Complete rewrite of the SRP library. Includes many improvements over the old library: - Improved file and code organization - Access to individual SRP computations - Consistent sever and client API - Simpler API - Improved documentation with tests in documentation - New tests for compatibility with the RFC - Bumps dependencies - Timing safe verification comparisons - Modernized error handling
Diffstat (limited to 'srp/tests/bad_public.rs')
-rw-r--r--srp/tests/bad_public.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/srp/tests/bad_public.rs b/srp/tests/bad_public.rs
new file mode 100644
index 0000000..e18b38d
--- /dev/null
+++ b/srp/tests/bad_public.rs
@@ -0,0 +1,24 @@
+use num_bigint::BigUint;
+use num_traits::identities::Zero;
+use sha1::Sha1;
+use srp::client::SrpClient;
+use srp::groups::G_1024;
+use srp::server::SrpServer;
+
+#[test]
+#[should_panic]
+fn bad_a_pub() {
+ let server = SrpServer::<Sha1>::new(&G_1024);
+ server
+ .process_reply(b"", b"", &BigUint::zero().to_bytes_be())
+ .unwrap();
+}
+
+#[test]
+#[should_panic]
+fn bad_b_pub() {
+ let client = SrpClient::<Sha1>::new(&G_1024);
+ client
+ .process_reply(b"", b"", b"", b"", &BigUint::zero().to_bytes_be())
+ .unwrap();
+}