Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'develop'

  • Loading branch information...
commit 6848b5825a2d042296b4f45e7b38ba3f078f04f2 2 parents 989ddf4 + e019fe5
Danny Greg authored
View
20 objc/CFobError.h
@@ -0,0 +1,20 @@
+//
+// CFobError.h
+// cocoafob
+//
+// Created by Danny Greg on 24/08/2010.
+// Copyright 2010 Realmac Software. All rights reserved.
+// Licensed under CC Attribution Licence 3.0 <http://creativecommons.org/licenses/by/3.0/>
+//
+
+#import <Foundation/Foundation.h>
+
+enum _CFobErrorCode {
+ CFobErrorCodeInvalidKey = -1,
+ CFobErrorCodeCouldNotDecode = -2,
+ CFobErrorCodeSigningFailed = -3,
+ CFobErrorCodeCouldNotEncode = -4,
+ CFobErrorCodeNoName = -5,
+};
+
+void CFobAssignErrorWithDescriptionAndCode(NSError **err, NSString *description, NSInteger code);
View
18 objc/CFobError.m
@@ -0,0 +1,18 @@
+//
+// CFobError.h
+// cocoafob
+//
+// Created by Danny Greg on 24/08/2010.
+// Copyright 2010 Realmac Software. All rights reserved.
+// Licensed under CC Attribution Licence 3.0 <http://creativecommons.org/licenses/by/3.0/>
+//
+
+#import "CFobError.h"
+
+#import "CFobLicVerifier.h"
+
+void CFobAssignErrorWithDescriptionAndCode(NSError **err, NSString *description, NSInteger code)
+{
+ if (err != NULL)
+ *err = [NSError errorWithDomain:[[NSBundle bundleForClass:[CFobLicVerifier class]] bundleIdentifier] code:code userInfo:[NSDictionary dictionaryWithObject:NSLocalizedStringFromTableInBundle(description, nil, [NSBundle bundleForClass:[CFobLicVerifier class]], nil) forKey:NSLocalizedDescriptionKey]];
+}
View
34 objc/CFobLicGenerator.h
@@ -18,34 +18,9 @@
@discussion Given user name and DSA private key, generates a human-readable registration code.
*/
@interface CFobLicGenerator : NSObject {
- DSA *dsa;
- NSString *regName;
- NSString *regCode;
- NSString *lastError;
+ DSA *_dsa;
}
-@property (nonatomic, copy) NSString *regName;
-@property (nonatomic, copy) NSString *regCode;
-@property (nonatomic, copy) NSString *lastError;
-
-/*!
- @method generatorWithPrivateKey:
- @abstract Creates a new registration code generator given DSA private key.
- @discussion Use this class method to create an autoreleased registration code generator.
- @param privKey PEM-encoded non-encrypted DSA private key.
- @result A new autoreleased registration code generator object.
-*/
-+ (id)generatorWithPrivateKey:(NSString *)privKey;
-
-/*!
- @method initWithPrivateKey:
- @abstract Designated initializer that takes a DSA private key.
- @discussion Initializes registration code generator using a DSA private key.
- @param privKey PEM-encoded non-encrypted DSA private key.
- @result An initialized registration code generator object.
-*/
-- (id)initWithPrivateKey:(NSString *)privKey;
-
/*!
@method setPrivateKey:
@abstract Sets a new DSA private key.
@@ -53,14 +28,15 @@
@param privKey PEM-encoded non-encrypted DSA private key.
@result YES on success, NO on error.
*/
-- (BOOL)setPrivateKey:(NSString *)privKey;
+- (BOOL)setPrivateKey:(NSString *)privKey error:(NSError **)err;
/*!
@method generate
@abstract Generates a registration code from regName property.
@discussion Takes regName property and DSA private key and generates a new registration code that is placed in regCode property.
- @result YES on success, NO on error.
+ @param The name or registration string to generate a serial number for.
+ @result The serial number as a string, nil on failure.
*/
-- (BOOL)generate;
+- (NSString *)generateRegCodeForName:(NSString *)name error:(NSError **)err;
@end
View
109 objc/CFobLicGenerator.m
@@ -8,62 +8,60 @@
// Licensed under CC Attribution Licence 3.0 <http://creativecommons.org/licenses/by/3.0/>
//
+#import "CFobLicGenerator.h"
+
+#import "CFobError.h"
+
#import "NSData+PECrypt.h"
#import "NSString+PECrypt.h"
-#import "CFobLicGenerator.h"
+
#import <openssl/evp.h>
#import <openssl/err.h>
#import <openssl/pem.h>
+//***************************************************************************
@interface CFobLicGenerator ()
+
+@property (nonatomic, assign) DSA *dsa;
+
- (void)initOpenSSL;
- (void)shutdownOpenSSL;
+
@end
@implementation CFobLicGenerator
-@synthesize regName;
-@synthesize regCode;
-@synthesize lastError;
-
-#pragma mark -
-#pragma mark Class methods
-
-+ (id)generatorWithPrivateKey:(NSString *)privKey {
- return [[[CFobLicGenerator alloc] initWithPrivateKey:privKey] autorelease];
-}
+@synthesize dsa = _dsa;
#pragma mark -
#pragma mark Lifecycle
-- (id)init {
- return [self initWithPrivateKey:nil];
-}
-
-- (id)initWithPrivateKey:(NSString *)privKey {
- if (![super init])
+- (id)init
+{
+ if ([super init] == nil)
return nil;
+
[self initOpenSSL];
- [self setPrivateKey:privKey];
+
return self;
}
- (void)finalize
{
- if (dsa)
- DSA_free(dsa);
+ if (self.dsa)
+ DSA_free(self.dsa);
+
[self shutdownOpenSSL];
[super finalize];
}
-- (void)dealloc {
- if (dsa)
- DSA_free(dsa);
- self.regCode = nil;
- self.regName = nil;
- self.lastError = nil;
+- (void)dealloc
+{
+ if (self.dsa)
+ DSA_free(self.dsa);
+
[self shutdownOpenSSL];
[super dealloc];
}
@@ -71,23 +69,25 @@ - (void)dealloc {
#pragma mark -
#pragma mark API
-- (BOOL)setPrivateKey:(NSString *)privKey {
+- (BOOL)setPrivateKey:(NSString *)privKey error:(NSError **)err
+{
// Validate the argument.
- if (!privKey || ![privKey length]) {
- self.lastError = @"Invalid key";
+ if (privKey == nil || [privKey length] < 1) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"Invalid private key.", CFobErrorCodeInvalidKey);
return NO;
}
- if (dsa)
- DSA_free(dsa);
- dsa = DSA_new();
+
+ if (self.dsa)
+ DSA_free(self.dsa);
+ self.dsa = DSA_new();
// Prepare BIO to read PEM-encoded private key from memory.
// Prepare buffer given NSString.
const char *privkeyCString = [privKey UTF8String];
BIO *bio = BIO_new_mem_buf((void *)privkeyCString, -1);
- PEM_read_bio_DSAPrivateKey(bio, &dsa, NULL, NULL);
+ PEM_read_bio_DSAPrivateKey(bio, &_dsa, NULL, NULL);
BOOL result = YES;
- if (!dsa->priv_key) {
- self.lastError = @"Unable to decode key";
+ if (!self.dsa->priv_key) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"Unable to decode key.", CFobErrorCodeCouldNotDecode);
result = NO;
}
// Cleanup BIO
@@ -95,29 +95,42 @@ - (BOOL)setPrivateKey:(NSString *)privKey {
return result;
}
-- (BOOL)generate {
- if (![regName length] || !dsa || !dsa->priv_key)
- return NO;
- NSData *digest = [regName sha1];
+- (NSString *)generateRegCodeForName:(NSString *)name error:(NSError **)err
+{
+ if (name == nil || [name length] < 1) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"No name provided.", CFobErrorCodeNoName);
+ return nil;
+ }
+
+ if (!self.dsa || !self.dsa->priv_key) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"Invalid private key.", CFobErrorCodeInvalidKey);
+ return nil;
+ }
+
+ NSData *digest = [name sha1];
unsigned int siglen;
unsigned char sig[100];
- int check = DSA_sign(NID_sha1, [digest bytes], [digest length], sig, &siglen, dsa);
+ int check = DSA_sign(NID_sha1, [digest bytes], [digest length], sig, &siglen, self.dsa);
if (!check) {
- self.lastError = @"Signing failed";
+ CFobAssignErrorWithDescriptionAndCode(err, @"Signing failed.", CFobErrorCodeSigningFailed);
return NO;
}
+
// Encode signature in Base32
NSData *signature = [NSData dataWithBytes:sig length:siglen];
NSString *b32Orig = [signature base32];
if (!b32Orig || ![b32Orig length]) {
- self.lastError = @"Unable to encode in base32";
+ CFobAssignErrorWithDescriptionAndCode(err, @"Unable to encode in base32", CFobErrorCodeCouldNotEncode);
return NO;
}
+
// Replace Os with 8s and Is with 9s
NSString *replacedOWith8 = [b32Orig stringByReplacingOccurrencesOfString:@"O" withString:@"8"];
NSString *b32 = [replacedOWith8 stringByReplacingOccurrencesOfString:@"I" withString:@"9"];
+
// Cut off the padding.
- NSString *regKeyNoPadding = [b32 stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"="]];
+ NSString *regKeyNoPadding = [b32 stringByReplacingOccurrencesOfString:@"=" withString:@""];
+
// Add dashes every 5 characters.
NSMutableString *serial = [NSMutableString stringWithString:regKeyNoPadding];
NSUInteger index = 5;
@@ -125,19 +138,21 @@ - (BOOL)generate {
[serial insertString:@"-" atIndex:index];
index += 6;
}
- self.regCode = serial;
- return YES;
+
+ return serial;
}
#pragma mark -
#pragma mark OpenSSL Lifecycle
-- (void)initOpenSSL {
+- (void)initOpenSSL
+{
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
}
-- (void)shutdownOpenSSL {
+- (void)shutdownOpenSSL
+{
EVP_cleanup();
ERR_free_strings();
}
View
38 objc/CFobLicVerifier.h
@@ -18,26 +18,11 @@
@discussion Verifies CocoaFob-style registration key given licensing information (for example, application name, user name, and number of copies as suggested in Potion Store) and signature in human-readable format. A signature is a base32-encoded bignum with padding removed and dashes inserted.
*/
@interface CFobLicVerifier : NSObject {
- DSA *dsa;
- NSString *regName;
- NSString *regCode;
- NSArray *blacklist;
- NSString *lastError;
+ DSA *_dsa;
+ NSArray *_blacklist;
}
-@property (nonatomic, copy) NSString *regName;
-@property (nonatomic, copy) NSString *regCode;
-@property (nonatomic, retain) NSArray *blacklist;
-@property (nonatomic, copy) NSString *lastError;
-
-/*!
- @method verifierWithPublicKey:
- @abstract Creates a new registration code verifier object given a DSA public key.
- @discussion Creates a new registration code verifier object. Use setRegName: and setRegKey: on it, then call verify to verify registration key.
- @param pubKey A DSA public key in PEM encoding. See completePublicKeyPEM: for help on how to construct a PEM-encoded DSA public key.
- @result A new autoreleased registration code verifier object.
-*/
-+ (id)verifierWithPublicKey:(NSString *)pubKey;
+@property (nonatomic, copy) NSArray *blacklist;
/*!
@method completePublicKeyPEM:
@@ -49,29 +34,20 @@
+ (NSString *)completePublicKeyPEM:(NSString *)partialPEM;
/*!
- @method initWithPublicKey:
- @abstract Designated initialiser.
- @discussion Initialises a newly allocated registration code verifier object with a PEM-encoded DSA public key.
- @param pubKey A PEM-encoded DSA public key. See completePublicKeyPEM: for help on how to constuct a PEM-encoded DSA key string from base64-encoded lines.
- @result An initialised registration code verifier object.
-*/
-- (id)initWithPublicKey:(NSString *)pubKey;
-
-/*!
@method setPubKey:
@abstract Sets DSA public key to the passed key in PEM format.
@discussion Sets DSA public key in the verifier object to the argument which is a PEM-encoded DSA public key.
@param pubKey PEM-encoded DSA public key.
- @result YES on success, NO on error (check lastError property).
+ @result YES on success, NO on error (err may or may not be populated).
*/
-- (BOOL)setPublicKey:(NSString *)pubKey;
+- (BOOL)setPublicKey:(NSString *)pubKey error:(NSError **)err;
/*!
@method verify
@abstract Verifies registration code in the regName property using public DSA key.
@discussion Takes regName and regCode properties and verifies regCode against regName using public DSA certificate.
- @result YES if regCode is valid, NO if not.
+ @result YES if regCode is valid, NO if not. If an error was recovered it will be set in the err paramater
*/
-- (BOOL)verify;
+- (BOOL)verifyRegCode:(NSString *)regCode forName:(NSString *)name error:(NSError **)err;
@end
View
103 objc/CFobLicVerifier.m
@@ -8,35 +8,39 @@
// Licensed under CC Attribution License 3.0 <http://creativecommons.org/licenses/by/3.0/>
//
-#import "NSString-Base64Extensions.h"
-#import "NSString+PECrypt.h"
#import "CFobLicVerifier.h"
+
+#import "CFobError.h"
+
#import "decoder.h"
+
+#import "NSString-Base64Extensions.h"
+#import "NSString+PECrypt.h"
+
#import <openssl/evp.h>
#import <openssl/err.h>
#import <openssl/pem.h>
@interface CFobLicVerifier ()
+
+@property (nonatomic, assign) DSA *dsa;
+
- (void)initOpenSSL;
- (void)shutdownOpenSSL;
+
@end
@implementation CFobLicVerifier
-@synthesize regName;
-@synthesize regCode;
-@synthesize blacklist;
-@synthesize lastError;
+@synthesize blacklist = _blacklist;
+
+@synthesize dsa = _dsa;
#pragma mark -
#pragma mark Class methods
-+ (id)verifierWithPublicKey:(NSString *)pubKey {
- return [[[CFobLicVerifier alloc] initWithPublicKey:pubKey] autorelease];
-}
-
+ (NSString *)completePublicKeyPEM:(NSString *)partialPEM {
NSString *dashes = @"-----";
NSString *begin = @"BEGIN";
@@ -67,33 +71,30 @@ + (NSString *)completePublicKeyPEM:(NSString *)partialPEM {
#pragma mark -
#pragma mark Lifecycle
-- (id)init {
- return [self initWithPublicKey:nil];
-}
-
-- (id)initWithPublicKey:(NSString *)pubKey {
- if (![super init])
+- (id)init
+{
+ if ([super init] == nil)
return nil;
+
[self initOpenSSL];
- [self setPublicKey:pubKey];
+
return self;
}
- (void)finalize
{
- if (dsa)
- DSA_free(dsa);
+ if (self.dsa)
+ DSA_free(self.dsa);
[self shutdownOpenSSL];
[super finalize];
}
-- (void)dealloc {
- if (dsa)
- DSA_free(dsa);
- self.regName = nil;
- self.regCode = nil;
+- (void)dealloc
+{
+ if (self.dsa)
+ DSA_free(self.dsa);
+
self.blacklist = nil;
- self.lastError = nil;
[self shutdownOpenSSL];
[super dealloc];
}
@@ -101,34 +102,47 @@ - (void)dealloc {
#pragma mark -
#pragma mark API
-- (BOOL)setPublicKey:(NSString *)pubKey {
+- (BOOL)setPublicKey:(NSString *)pubKey error:(NSError **)err
+{
// Validate the argument.
- if (!pubKey || ![pubKey length]) {
- self.lastError = @"Invalid key";
+ if (pubKey == nil || [pubKey length] < 1) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"Invalid key.", CFobErrorCodeInvalidKey);
return NO;
}
- if (dsa)
- DSA_free(dsa);
- dsa = DSA_new();
+
+ if (self.dsa)
+ DSA_free(self.dsa);
+ self.dsa = DSA_new();
+
// Prepare BIO to read PEM-encoded public key from memory.
// Prepare buffer given NSString
const char *pubkeyCString = [pubKey UTF8String];
BIO *bio = BIO_new_mem_buf((void *)pubkeyCString, -1);
- PEM_read_bio_DSA_PUBKEY(bio, &dsa, NULL, NULL);
+ PEM_read_bio_DSA_PUBKEY(bio, &_dsa, NULL, NULL);
+
BOOL result = YES;
- if (!dsa->pub_key) {
- self.lastError = @"Unable to decode key";
+ if (!self.dsa->pub_key) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"Unable to decode key.", CFobErrorCodeCouldNotDecode);
result = NO;
}
+
// Cleanup BIO
BIO_vfree(bio);
return result;
}
-- (BOOL)verify {
- if (![regName length] || ![regCode length] || !dsa || !dsa->pub_key)
+- (BOOL)verifyRegCode:(NSString *)regCode forName:(NSString *)name error:(NSError **)err
+{
+ if (name == nil || [name length] < 1) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"No name for the registration code.", CFobErrorCodeNoName);
+ return NO;
+ }
+
+ if (!self.dsa || !self.dsa->pub_key) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"Invalid key.", CFobErrorCodeInvalidKey);
return NO;
- BOOL result = NO;
+ }
+
// Replace 9s with Is and 8s with Os
NSString *regKeyTemp = [regCode stringByReplacingOccurrencesOfString:@"9" withString:@"I"];
NSString *regKeyBase32 = [regKeyTemp stringByReplacingOccurrencesOfString:@"8" withString:@"O"];
@@ -149,13 +163,18 @@ - (BOOL)verify {
return NO;
// Decode signature from Base32 to a byte buffer.
size_t sigSize = base32_decode(sig, decodeBufSize, (unsigned char *)keyBase32Utf8, base32Length);
- if (!sigSize)
- self.lastError = @"Unable to decode registration key";
+ if (!sigSize) {
+ CFobAssignErrorWithDescriptionAndCode(err, @"Unable to decode registration key.", CFobErrorCodeCouldNotDecode);
+ free(sig);
+ return NO;
+ }
+
// Produce a SHA-1 hash of the registration name string. This is what was signed during registration key generation.
- NSData *digest = [regName sha1];
+ NSData *digest = [name sha1];
// Verify DSA signature.
- int check = DSA_verify(0, [digest bytes], [digest length], sig, sigSize, dsa);
- result = check > 0;
+ int check = DSA_verify(0, [digest bytes], [digest length], sig, sigSize, self.dsa);
+
+ BOOL result = check > 0;
// Cleanup
free(sig);
return result;
View
2  objc/CocoaFob-Info.plist
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <string>com.dannygreg.cocoafob</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
View
78 objc/cocoafob.m
@@ -9,8 +9,9 @@
//
#import <Foundation/Foundation.h>
-#import "CFobLicGenerator.h"
-#import "CFobLicVerifier.h"
+
+#import <CocoaFob/CFobLicGenerator.h>
+#import <CocoaFob/CFobLicVerifier.h>
//#define TEST
@@ -28,9 +29,20 @@ void smoketest()
"keUwLHBtpClnD5E8\n"
"-----END DSA PRIVATE KEY-----\n";
NSString *regName = @"decloner|Joe Bloggs";
- CFobLicGenerator *generator = [CFobLicGenerator generatorWithPrivateKey:privKey];
- generator.regName = regName;
- [generator generate];
+
+ CFobLicGenerator *generator = [[[CFobLicGenerator alloc] init] autorelease];
+
+ NSError *err = nil;
+ if (![generator setPrivateKey:privKey error:&err]) {
+ NSLog(@"Could not set private key: %@", err);
+ return;
+ }
+
+ NSString *regCode = [generator generateRegCodeForName:regName error:&err];
+ if (regCode == nil) {
+ NSLog(@"Could not generate serial number: %@", err);
+ return;
+ }
// Modelled after AquaticPrime's method of splitting public key to obfuscate it.
// It is probably better if you invent your own splitting pattern. Go wild.
@@ -51,15 +63,20 @@ void smoketest()
[pubKeyBase64 appendString:@"MP/+"];
[pubKeyBase64 appendString:@"2Z7ekydHfX0sTMDgkxhtRm6qtcywg01X847Y9ySgNepqleD+Ka2Wbucj1pOr\n"];
[pubKeyBase64 appendString:@"y8MoDQ==\n"];
+
NSString *pubKey = [CFobLicVerifier completePublicKeyPEM:pubKeyBase64];
- CFobLicVerifier *verifier = [CFobLicVerifier verifierWithPublicKey:pubKey];
- verifier.regName = regName;
- verifier.regCode = generator.regCode;
- puts([verifier.regCode UTF8String]);
- if ([verifier verify])
+ CFobLicVerifier *verifier = [[[CFobLicVerifier alloc] init] autorelease];
+ if (![verifier setPublicKey:pubKey error:&err]) {
+ NSLog(@"Could not set public key on verifier %@", err);
+ return;
+ }
+
+ puts([regCode UTF8String]);
+ if ([verifier verifyRegCode:regCode forName:regName error:&err]) {
puts("PASS");
- else
- puts("FAIL");
+ } else {
+ NSLog(@"FAIL: %@", err);
+ }
}
#endif
@@ -68,13 +85,22 @@ void smoketest()
{
NSError *err = nil;
NSString *privKey = [NSString stringWithContentsOfFile:privKeyFileName encoding:NSASCIIStringEncoding error:&err];
- if (!privKey || err)
+ if (privKey == nil)
return nil;
- CFobLicGenerator *generator = [CFobLicGenerator generatorWithPrivateKey:privKey];
- generator.regName = regName;
- if (![generator generate])
+
+ CFobLicGenerator *generator = [[[CFobLicGenerator alloc] init] autorelease];
+ if (![generator setPrivateKey:privKey error:&err]) {
+ NSLog(@"%@", err);
return nil;
- return generator.regCode;
+ }
+
+ NSString *regCode = [generator generateRegCodeForName:regName error:&err];
+ if (regCode == nil) {
+ NSLog(@"%@", err);
+ return nil;
+ }
+
+ return regCode;
}
// Pass public key, registration name and registration code to verify it
@@ -82,12 +108,20 @@ BOOL codecheck(NSString *pubKeyFileName, NSString *regName, NSString *regCode)
{
NSError *err = nil;
NSString *pubKey = [NSString stringWithContentsOfFile:pubKeyFileName encoding:NSASCIIStringEncoding error:&err];
- if (!pubKey || err)
+ if (pubKey == nil)
return NO;
- CFobLicVerifier *verifier = [CFobLicVerifier verifierWithPublicKey:pubKey];
- verifier.regName = regName;
- verifier.regCode = regCode;
- return [verifier verify];
+
+ CFobLicVerifier *verifier = [[[CFobLicVerifier alloc] init] autorelease];
+ if (![verifier setPublicKey:pubKey error:&err]) {
+ NSLog(@"%@", err);
+ return NO;
+ }
+
+ BOOL result = [verifier verifyRegCode:regCode forName:regName error:&err];
+ if (!result)
+ NSLog(@"%@", err);
+
+ return result;
}
// Uses NSUserDefaults to parse command-line arguments:
View
147 objc/cocoafob.xcodeproj/project.pbxproj
@@ -7,7 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
- 3035240F1223BC2200AACD22 /* cocoafob.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* cocoafob.m */; };
303524101223BC2200AACD22 /* decoder.c in Sources */ = {isa = PBXBuildFile; fileRef = C7E378410F59D737002061CD /* decoder.c */; };
303524111223BC2200AACD22 /* encoder.c in Sources */ = {isa = PBXBuildFile; fileRef = C7E378430F59D737002061CD /* encoder.c */; };
303524121223BC2200AACD22 /* CFobLicGenerator.m in Sources */ = {isa = PBXBuildFile; fileRef = C7E378480F59DB15002061CD /* CFobLicGenerator.m */; };
@@ -24,15 +23,31 @@
3035258E1223C01100AACD22 /* NSString+PECrypt.h in Headers */ = {isa = PBXBuildFile; fileRef = C7E3784D0F59DB15002061CD /* NSString+PECrypt.h */; };
3035258F1223C01100AACD22 /* NSString-Base64Extensions.h in Headers */ = {isa = PBXBuildFile; fileRef = C7A731670F5F42D500D40AFE /* NSString-Base64Extensions.h */; };
303525A81223C19D00AACD22 /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 303524D01223BE4D00AACD22 /* libcrypto.dylib */; };
+ 303526851223D4DA00AACD22 /* CFobError.h in Headers */ = {isa = PBXBuildFile; fileRef = 303526831223D4DA00AACD22 /* CFobError.h */; };
+ 303526981223DC9600AACD22 /* CFobError.m in Sources */ = {isa = PBXBuildFile; fileRef = 303526971223DC9600AACD22 /* CFobError.m */; };
+ 303526F41223E4C900AACD22 /* CocoaFob.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 303524081223BB9600AACD22 /* CocoaFob.framework */; };
+ 303526FC1223E56000AACD22 /* cocoafob.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* cocoafob.m */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ 303526F01223E4C200AACD22 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 303524071223BB9600AACD22 /* CocoaFob */;
+ remoteInfo = CocoaFob;
+ };
+/* End PBXContainerItemProxy section */
+
/* Begin PBXFileReference section */
08FB7796FE84155DC02AAC07 /* cocoafob.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = cocoafob.m; sourceTree = "<group>"; };
303524081223BB9600AACD22 /* CocoaFob.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CocoaFob.framework; sourceTree = BUILT_PRODUCTS_DIR; };
303524091223BB9600AACD22 /* CocoaFob-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CocoaFob-Info.plist"; sourceTree = "<group>"; };
303524D01223BE4D00AACD22 /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = usr/lib/libcrypto.dylib; sourceTree = SDKROOT; };
303524D61223BE6700AACD22 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 32A70AAB03705E1F00C91783 /* cocoafob_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cocoafob_Prefix.pch; sourceTree = "<group>"; };
+ 303526831223D4DA00AACD22 /* CFobError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFobError.h; sourceTree = "<group>"; };
+ 303526971223DC9600AACD22 /* CFobError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CFobError.m; sourceTree = "<group>"; };
+ 303526E91223E45100AACD22 /* cocoafob */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = cocoafob; sourceTree = BUILT_PRODUCTS_DIR; };
C6859EA3029092ED04C91782 /* cocoafob.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = cocoafob.1; sourceTree = "<group>"; };
C7A731670F5F42D500D40AFE /* NSString-Base64Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString-Base64Extensions.h"; sourceTree = "<group>"; };
C7A731680F5F42D500D40AFE /* NSString-Base64Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString-Base64Extensions.m"; sourceTree = "<group>"; };
@@ -60,6 +75,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ 303526E71223E45100AACD22 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 303526F41223E4C900AACD22 /* CocoaFob.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -67,6 +90,7 @@
isa = PBXGroup;
children = (
08FB7795FE84155DC02AAC07 /* Source */,
+ 303526E01223E39D00AACD22 /* Tests */,
3035240E1223BC0400AACD22 /* Framework */,
C6859EA2029092E104C91782 /* Documentation */,
08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
@@ -78,6 +102,7 @@
08FB7795FE84155DC02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
+ 303526E21223E3FF00AACD22 /* Cmd Line Tool */,
C7A731660F5F42C000D40AFE /* Dave Dribin */,
C7E378540F59DB33002061CD /* Base32 */,
C7E378530F59DB1E002061CD /* PECategories */,
@@ -85,8 +110,8 @@
C7E378480F59DB15002061CD /* CFobLicGenerator.m */,
C7E378490F59DB15002061CD /* CFobLicVerifier.h */,
C7E3784A0F59DB15002061CD /* CFobLicVerifier.m */,
- 32A70AAB03705E1F00C91783 /* cocoafob_Prefix.pch */,
- 08FB7796FE84155DC02AAC07 /* cocoafob.m */,
+ 303526831223D4DA00AACD22 /* CFobError.h */,
+ 303526971223DC9600AACD22 /* CFobError.m */,
);
name = Source;
sourceTree = "<group>";
@@ -104,6 +129,7 @@
isa = PBXGroup;
children = (
303524081223BB9600AACD22 /* CocoaFob.framework */,
+ 303526E91223E45100AACD22 /* cocoafob */,
);
name = Products;
sourceTree = "<group>";
@@ -116,6 +142,21 @@
name = Framework;
sourceTree = "<group>";
};
+ 303526E01223E39D00AACD22 /* Tests */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ name = Tests;
+ sourceTree = "<group>";
+ };
+ 303526E21223E3FF00AACD22 /* Cmd Line Tool */ = {
+ isa = PBXGroup;
+ children = (
+ 08FB7796FE84155DC02AAC07 /* cocoafob.m */,
+ );
+ name = "Cmd Line Tool";
+ sourceTree = "<group>";
+ };
C6859EA2029092E104C91782 /* Documentation */ = {
isa = PBXGroup;
children = (
@@ -169,6 +210,7 @@
303525891223BFFF00AACD22 /* encoder.h in Headers */,
303524231223BCB500AACD22 /* CFobLicVerifier.h in Headers */,
303524241223BCBA00AACD22 /* CFobLicGenerator.h in Headers */,
+ 303526851223D4DA00AACD22 /* CFobError.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -193,6 +235,23 @@
productReference = 303524081223BB9600AACD22 /* CocoaFob.framework */;
productType = "com.apple.product-type.framework";
};
+ 303526E81223E45100AACD22 /* cocoafob */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 303526EE1223E48200AACD22 /* Build configuration list for PBXNativeTarget "cocoafob" */;
+ buildPhases = (
+ 303526E61223E45100AACD22 /* Sources */,
+ 303526E71223E45100AACD22 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 303526F11223E4C200AACD22 /* PBXTargetDependency */,
+ );
+ name = cocoafob;
+ productName = cocoafob;
+ productReference = 303526E91223E45100AACD22 /* cocoafob */;
+ productType = "com.apple.product-type.tool";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -206,6 +265,7 @@
projectRoot = "";
targets = (
303524071223BB9600AACD22 /* CocoaFob */,
+ 303526E81223E45100AACD22 /* cocoafob */,
);
};
/* End PBXProject section */
@@ -225,7 +285,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 3035240F1223BC2200AACD22 /* cocoafob.m in Sources */,
303524101223BC2200AACD22 /* decoder.c in Sources */,
303524111223BC2200AACD22 /* encoder.c in Sources */,
303524121223BC2200AACD22 /* CFobLicGenerator.m in Sources */,
@@ -233,11 +292,28 @@
303524141223BC2200AACD22 /* NSData+PECrypt.m in Sources */,
303524151223BC2200AACD22 /* NSString+PECrypt.m in Sources */,
303524161223BC2200AACD22 /* NSString-Base64Extensions.m in Sources */,
+ 303526981223DC9600AACD22 /* CFobError.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 303526E61223E45100AACD22 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 303526FC1223E56000AACD22 /* cocoafob.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ 303526F11223E4C200AACD22 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 303524071223BB9600AACD22 /* CocoaFob */;
+ targetProxy = 303526F01223E4C200AACD22 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin XCBuildConfiguration section */
1DEB927908733DD40010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
@@ -292,7 +368,7 @@
);
PREBINDING = NO;
PRODUCT_NAME = CocoaFob;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx10.5;
};
name = Debug;
};
@@ -323,7 +399,55 @@
);
PREBINDING = NO;
PRODUCT_NAME = CocoaFob;
- SDKROOT = macosx10.6;
+ SDKROOT = macosx10.5;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
+ 303526EB1223E45100AACD22 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_MODEL_TUNING = G5;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ INSTALL_PATH = /usr/local/bin;
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = cocoafob;
+ };
+ name = Debug;
+ };
+ 303526EC1223E45100AACD22 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_MODEL_TUNING = G5;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+ INSTALL_PATH = /usr/local/bin;
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ PREBINDING = NO;
+ PRODUCT_NAME = cocoafob;
ZERO_LINK = NO;
};
name = Release;
@@ -349,6 +473,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
+ 303526EE1223E48200AACD22 /* Build configuration list for PBXNativeTarget "cocoafob" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 303526EB1223E45100AACD22 /* Debug */,
+ 303526EC1223E45100AACD22 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
View
7 objc/cocoafob_Prefix.pch
@@ -1,7 +0,0 @@
-//
-// Prefix header for all source files of the 'cocoafob' target in the 'cocoafob' project.
-//
-
-#ifdef __OBJC__
- #import <Foundation/Foundation.h>
-#endif
Please sign in to comment.
Something went wrong with that request. Please try again.