Skip to content

Commit

Permalink
Fix typo (sha265 -> sha256)
Browse files Browse the repository at this point in the history
  • Loading branch information
jogu authored and WilliamDenniss committed Sep 18, 2018
1 parent b4ca39a commit 87b0823
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/OIDAuthorizationRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ + (nullable NSString *)codeChallengeS256ForVerifier:(NSString *)codeVerifier {
// generates the code_challenge per spec https://tools.ietf.org/html/rfc7636#section-4.2
// code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))
// NB. the ASCII conversion on the code_verifier entropy was done at time of generation.
NSData *sha256Verifier = [OIDTokenUtilities sha265:codeVerifier];
NSData *sha256Verifier = [OIDTokenUtilities sha256:codeVerifier];
return [OIDTokenUtilities encodeBase64urlNoPadding:sha256Verifier];
}

Expand Down
2 changes: 1 addition & 1 deletion Source/OIDTokenUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ NS_ASSUME_NONNULL_BEGIN
@param inputString The input string.
@return The SHA256 data.
*/
+ (NSData *)sha265:(NSString *)inputString;
+ (NSData *)sha256:(NSString *)inputString;

/*! @brief Truncated intput string after first 6 characters followed by ellipses
@param inputString The input string.
Expand Down
2 changes: 1 addition & 1 deletion Source/OIDTokenUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ + (nullable NSString *)randomURLSafeStringWithSize:(NSUInteger)size {
return [[self class] encodeBase64urlNoPadding:randomData];
}

+ (NSData *)sha265:(NSString *)inputString {
+ (NSData *)sha256:(NSString *)inputString {
NSData *verifierData = [inputString dataUsingEncoding:NSUTF8StringEncoding];
NSMutableData *sha256Verifier = [NSMutableData dataWithLength:CC_SHA256_DIGEST_LENGTH];
CC_SHA256(verifierData.bytes, (CC_LONG)verifierData.length, sha256Verifier.mutableBytes);
Expand Down

0 comments on commit 87b0823

Please sign in to comment.