diff options
Diffstat (limited to 'srp/src')
-rw-r--r-- | srp/src/client.rs | 1 | ||||
-rw-r--r-- | srp/src/server.rs | 3 | ||||
-rw-r--r-- | srp/src/utils.rs | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/srp/src/client.rs b/srp/src/client.rs index 845c6f8..dd21982 100644 --- a/srp/src/client.rs +++ b/srp/src/client.rs @@ -209,6 +209,7 @@ impl<'a, D: Digest> SrpClient<'a, D> { let m1 = compute_m1::<D>( self.params, username_hash.as_slice(), + salt, &a_pub.to_bytes_be(), &b_pub.to_bytes_be(), &key.to_bytes_be(), diff --git a/srp/src/server.rs b/srp/src/server.rs index 08c0475..e48c8e8 100644 --- a/srp/src/server.rs +++ b/srp/src/server.rs @@ -121,11 +121,13 @@ impl<'a, D: Digest> SrpServer<'a, D> { /// Process client reply to the handshake. /// b is a random value, + /// s is the salt, /// v is the provided during initial user registration pub fn process_reply( &self, username: &str, b: &[u8], + s: &[u8], v: &[u8], a_pub: &[u8], ) -> Result<SrpServerVerifier<D>, SrpAuthError> { @@ -152,6 +154,7 @@ impl<'a, D: Digest> SrpServer<'a, D> { let m1 = compute_m1::<D>( self.params, username_hash.as_slice(), + s, &a_pub.to_bytes_be(), &b_pub.to_bytes_be(), &key.to_bytes_be(), diff --git a/srp/src/utils.rs b/srp/src/utils.rs index d053f5d..5258c7a 100644 --- a/srp/src/utils.rs +++ b/srp/src/utils.rs @@ -29,6 +29,7 @@ pub fn compute_k<D: Digest>(params: &SrpGroup) -> BigUint { pub fn compute_m1<D: Digest>( params: &SrpGroup, identity_hash: &[u8], + salt: &[u8], a_pub: &[u8], b_pub: &[u8], key: &[u8], @@ -46,6 +47,7 @@ pub fn compute_m1<D: Digest>( let mut d = D::new(); d.update(ng_xor); d.update(identity_hash); + d.update(salt); d.update(a_pub); d.update(b_pub); d.update(key); |