Skip to content
This repository has been archived by the owner on Mar 19, 2023. It is now read-only.

Commit

Permalink
Require at least 4096 iterations for password derivation in SCRAM whe…
Browse files Browse the repository at this point in the history
…n password is not empty as per the SCRAM RFC.

The server current requests only 1 iteration for accounts with an empty password, but 4096 iterations for accounts with a password.
  • Loading branch information
pixelspark committed May 1, 2016
1 parent d4a7502 commit af01783
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Rethink/SCRAM.m
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,11 @@ - (NSString*) clientFinalMessage {

- (BOOL) calculateProofs {
// Check to see that we have a password, salt and iteration count above 4096 (from RFC5802)
if(!self.salt.length /* || self.count.unsignedIntegerValue < 4096 */) {
if(!self.salt.length) {
return NO;
}

if(self.password.length > 0 && self.count.integerValue < 4096) {
return NO;
}

Expand Down

0 comments on commit af01783

Please sign in to comment.