Skip to content

Commit d382261

Browse files
author
Kanishk Panwar
committed
Updated pod spec and warning messages
Updated pod spec and warning messages during pod validation.
1 parent e9f48bf commit d382261

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

ADALiOS.podspec

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "ADALiOS"
3-
s.version = "1.1.5"
3+
s.version = "1.1.7"
44
s.summary = "The ADAL SDK for iOS gives you the ability to add Azure Identity authentication to your application"
55

66
s.description = <<-DESC
@@ -13,12 +13,11 @@ Pod::Spec.new do |s|
1313
}
1414
s.authors = { "Brandon Werner" => "brandwe@microsoft.com" }
1515
s.social_media_url = "https://twitter.com/azuread"
16-
s.platform = :ios, "6.0"
16+
s.platform = :ios, "7.0"
1717
s.source = {
1818
:git => "https://github.com/AzureAD/azure-activedirectory-library-for-objc.git",
1919
:tag => s.version.to_s
2020
}
21-
s.dependency 'OpenSSL', '1.0.1'
2221
s.source_files = "ADALiOS/ADALiOS/**/*.{h,m}"
2322
s.resources = "ADALiOS/ADALiOS/*.storyboard"
2423
s.preserve_paths = "ADALiOS/ADALiOS/**/*.{h,m}"

ADALiOS/ADALiOS/ADPkeyAuthHelper.m

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ + (NSString*) computeThumbprint:(NSData*) certificateData{
3131

3232
//compute SHA-1 thumbprint
3333
unsigned char sha1Buffer[CC_SHA1_DIGEST_LENGTH];
34-
CC_SHA1(certificateData.bytes, certificateData.length, sha1Buffer);
34+
CC_SHA1(certificateData.bytes, (CC_LONG)certificateData.length, sha1Buffer);
3535
NSMutableString *fingerprint = [NSMutableString stringWithCapacity:CC_SHA1_DIGEST_LENGTH * 3];
3636
for (int i = 0; i < CC_SHA1_DIGEST_LENGTH; ++i)
3737
{
@@ -79,11 +79,15 @@ + (NSString*) createDeviceAuthResponse:(NSString*) authorizationServer
7979
+ (NSString*) getOrgUnitFromIssuer:(NSString*) issuer{
8080
NSString *regexString = @"[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}";
8181
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regexString options:0 error:NULL];
82-
NSTextCheckingResult* matches = (NSTextCheckingResult*)[regex matchesInString:issuer options:0 range:NSMakeRange(0, [issuer length])];
83-
for (NSTextCheckingResult* match in matches)
84-
{
85-
return [NSString stringWithFormat:@"OU=%@", [issuer substringWithRange:match.range]];
82+
83+
for (NSTextCheckingResult* myMatch in [regex matchesInString:issuer options:0 range:NSMakeRange(0, [issuer length])]){
84+
for (NSUInteger i = 0; i < myMatch.numberOfRanges; ++i)
85+
{
86+
NSRange matchedRange = [myMatch rangeAtIndex: i];
87+
return [NSString stringWithFormat:@"OU=%@", [issuer substringWithRange: matchedRange]];
88+
}
8689
}
90+
8791
return nil;
8892
}
8993

@@ -93,14 +97,18 @@ + (BOOL) isValidIssuer:(NSString*) certAuths
9397
keychainCertIssuer = [keychainCertIssuer uppercaseString];
9498
certAuths = [certAuths uppercaseString];
9599
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regexString options:0 error:NULL];
96-
NSTextCheckingResult* matches = (NSTextCheckingResult*)[regex matchesInString:certAuths options:0 range:NSMakeRange(0, [certAuths length])];
97-
for (NSTextCheckingResult *match in matches)
98-
{
99-
NSString *text = [certAuths substringWithRange:match.range];
100-
if([NSString adSame:text toString:keychainCertIssuer]){
101-
return true;
100+
101+
for (NSTextCheckingResult* myMatch in [regex matchesInString:certAuths options:0 range:NSMakeRange(0, [certAuths length])]){
102+
for (NSUInteger i = 0; i < myMatch.numberOfRanges; ++i)
103+
{
104+
NSRange matchedRange = [myMatch rangeAtIndex: i];
105+
NSString *text = [certAuths substringWithRange:matchedRange];
106+
if([NSString adSame:text toString:keychainCertIssuer]){
107+
return true;
108+
}
102109
}
103110
}
111+
104112
return false;
105113
}
106114

0 commit comments

Comments
 (0)