MYCryptoTest.m
changeset 11 3568d5fd4b6a
parent 8 4c0eafa7b233
child 12 e4c971be4079
     1.1 --- a/MYCryptoTest.m	Sun Apr 12 22:02:20 2009 -0700
     1.2 +++ b/MYCryptoTest.m	Tue Apr 14 18:34:52 2009 -0700
     1.3 @@ -17,6 +17,9 @@
     1.4  
     1.5  #if DEBUG
     1.6  
     1.7 +
     1.8 +#define kTestCaseRSAKeySize 2048
     1.9 +
    1.10  #pragma mark -
    1.11  #pragma mark KEYCHAIN:
    1.12  
    1.13 @@ -224,7 +227,7 @@
    1.14      RequireTestCase(MYKeychain);
    1.15      
    1.16      Log(@"Generating key pair...");
    1.17 -    MYPrivateKey *pair = [[MYKeychain defaultKeychain] generateRSAKeyPairOfSize: 512];
    1.18 +    MYPrivateKey *pair = [[MYKeychain defaultKeychain] generateRSAKeyPairOfSize: kTestCaseRSAKeySize];
    1.19      MYPublicKey *publicKey = pair.publicKey;
    1.20      Log(@"...created { %@ , %@ }.", pair, publicKey);
    1.21      
    1.22 @@ -284,7 +287,7 @@
    1.23  static void testKeyPairExportWithPrompt(BOOL withPrompt) {
    1.24      MYKeychain *keychain = [MYKeychain allKeychains];
    1.25      Log(@"Generating key pair...");
    1.26 -    MYPrivateKey *pair = [keychain generateRSAKeyPairOfSize: 512];
    1.27 +    MYPrivateKey *pair = [keychain generateRSAKeyPairOfSize: kTestCaseRSAKeySize];
    1.28      CAssert(pair);
    1.29      CAssert(pair.keyRef);
    1.30      CAssert(pair.publicKey.keyRef);
    1.31 @@ -292,7 +295,7 @@
    1.32      
    1.33      @try{
    1.34          NSData *pubKeyData = pair.publicKey.keyData;
    1.35 -        CAssert(pubKeyData.length >= 512/8);
    1.36 +        CAssert(pubKeyData.length >= kTestCaseRSAKeySize/8);
    1.37          [pair setName: @"Test KeyPair Label"];
    1.38          CAssertEqual(pair.name, @"Test KeyPair Label");
    1.39  #if !TARGET_OS_IPHONE