diff options
author | Teddy Wing | 2018-10-25 17:10:21 +0200 |
---|---|---|
committer | Teddy Wing | 2018-10-25 17:10:21 +0200 |
commit | 0c25fdc79f6aeec643c9c91caeaacbc0813d206c (patch) | |
tree | 51869c0932d41b2619f8a852cf6f41a3c40d307d | |
parent | cf3a3a5cb29afb169ef776ac3fe634a217dab1b3 (diff) | |
download | DomeKey-0c25fdc79f6aeec643c9c91caeaacbc0813d206c.tar.bz2 |
LicenseHandler: Handle `APSetKey` returning false
If `APSetKey()` returns false, the public key failed to get loaded by
the AquaticPrime library, and we won't subsequently be able to
`APVerifyLicenseFile()`. If `APSetKey()` fails, return `NO` from this
`validateLicense` method.
-rw-r--r-- | DomeKey/LicenseHandler.m | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/DomeKey/LicenseHandler.m b/DomeKey/LicenseHandler.m index 52c5bcf..1bad0b8 100644 --- a/DomeKey/LicenseHandler.m +++ b/DomeKey/LicenseHandler.m @@ -88,9 +88,12 @@ static NSString * const LICENSE_FILE_NAME = @"license.plist"; CFStringAppend(key, CFSTR("9AEF648830DA73C584DE402")); CFStringAppend(key, CFSTR("4AFD071F4F4E90021B")); - // TODO: returns false on failure - APSetKey(key); - BOOL validated = APVerifyLicenseFile(cf_path); + BOOL is_key_loaded = APSetKey(key); + BOOL validated = NO; + + if (is_key_loaded) { + validated = APVerifyLicenseFile(cf_path); + } CFRelease(cf_path); |