Skip to content

Commit

Permalink
Guarding against nil group name
Browse files Browse the repository at this point in the history
  • Loading branch information
halo committed Nov 10, 2015
1 parent dc0c808 commit a60146d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions macosvpn/Classes/VPNServiceConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,15 @@ - (CFDictionaryRef) ciscoConfig {
keys[count] = kSCPropNetIPSecXAuthPasswordEncryption;
vals[count++] = kSCValNetIPSecXAuthPasswordEncryptionKeychain;

keys[count] = kSCPropNetIPSecLocalIdentifier;
vals[count++] = (__bridge CFStringRef)self.localIdentifier;
if (self.localIdentifier) {
DDLogDebug(@"Assigning group name <%@> to cisco service config", self.localIdentifier);

keys[count] = kSCPropNetIPSecLocalIdentifier;
vals[count++] = (__bridge CFStringRef)self.localIdentifier;

keys[count] = kSCPropNetIPSecLocalIdentifierType;
vals[count++] = kSCValNetIPSecLocalIdentifierTypeKeyID;
keys[count] = kSCPropNetIPSecLocalIdentifierType;
vals[count++] = kSCValNetIPSecLocalIdentifierTypeKeyID;
}

return CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&vals, count, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
}
Expand Down

0 comments on commit a60146d

Please sign in to comment.