Skip to content
This repository was archived by the owner on Jan 9, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions NSData+CommonCrypto.m
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ static void FixKeyLengths( CCAlgorithm algorithm, NSMutableData * keyData, NSMut
{
case kCCAlgorithmAES128:
{
if ( keyLength < 16 )
if ( keyLength <= 16 )
{
[keyData setLength: 16];
}
else if ( keyLength < 24 )
else if ( keyLength <= 24 )
{
[keyData setLength: 24];
}
Expand Down Expand Up @@ -543,4 +543,4 @@ - (NSData *) HMACWithAlgorithm: (CCHmacAlgorithm) algorithm key: (id) key
return ( [NSData dataWithBytes: buf length: (algorithm == kCCHmacAlgMD5 ? CC_MD5_DIGEST_LENGTH : CC_SHA1_DIGEST_LENGTH)] );
}

@end
@end