OSDN Git Service

FIX: ABEND when encrypting.
authorHirami <tomohisa.hirami@nifty.com>
Thu, 12 Apr 2012 13:45:42 +0000 (22:45 +0900)
committerHirami <tomohisa.hirami@nifty.com>
Thu, 12 Apr 2012 13:45:42 +0000 (22:45 +0900)
iOS/Tombo/Tombo/CryptCore.m
iOS/Tombo/Tombo/PasswordManager.m

index 28ca2a7..e5835d8 100644 (file)
 
 + (NSData *)encrypt:(NSString *)key data:(NSData *)plain error:(NSError **)error {
     const char *plainByte = (const char *)[plain bytes];
-    NSUInteger n = strlen(plainByte);
+    NSUInteger n = [plain length];
     NSUInteger nBlocks = (n + 7) / 8;
     
     NSUInteger dataLen = 32 + nBlocks * 8;
index 68da5f2..f41ef73 100644 (file)
@@ -46,6 +46,7 @@
             [mismatch show];
             return NO;
         }
+        self.password = pass1;
     }
 
     [self resetTimer];