Skip to content

Commit

Permalink
fix(deprecations): Wrap usage of CC_MD5 into diagnostic ignored
Browse files Browse the repository at this point in the history
As mentioned by @haoliu-amp in
amplitude#250 (comment),
> This crypto algorithm is used for our checksum field, actually you don't need to worry about the security concern for that.
> However, we will see if we wanna switch it to SHA256.
Based on this, we can silence the compile warning here until a fix is implemented.
  • Loading branch information
JanNash committed Oct 19, 2020
1 parent d397ac6 commit 24dabac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/Amplitude/Amplitude.m
Original file line number Diff line number Diff line change
Expand Up @@ -1534,7 +1534,15 @@ - (BOOL)isArgument:(id) argument validType:(Class) class methodName:(NSString*)m
- (NSString*)md5HexDigest:(NSString*)input {
const char* str = [input UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH];

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
// As mentioned by @haoliu-amp in // https://github.com/amplitude/Amplitude-iOS/issues/250#issuecomment-655224554,
// > This crypto algorithm is used for our checksum field, actually you don't need to worry about the security concern for that.
// > However, we will see if we wanna switch it to SHA256.
// Based on this, we can silence the compile warning here until a fix is implemented.
CC_MD5(str, (CC_LONG) strlen(str), result);
#pragma clang diagnostic pop

NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2];
for(int i = 0; i<CC_MD5_DIGEST_LENGTH; i++) {
Expand Down

0 comments on commit 24dabac

Please sign in to comment.