no more space in fingerprints
authorEdouard Tisserant
Wed, 02 Mar 2016 13:20:31 +0100
changeset 92b34d0574722a
parent 91 16c430a152e9
child 93 2816a2023e9f
no more space in fingerprints
iOSTests/iOSTests.m
pEpiOSAdapter/PEPSession.m
     1.1 --- a/iOSTests/iOSTests.m	Tue Mar 01 19:11:53 2016 +0100
     1.2 +++ b/iOSTests/iOSTests.m	Wed Mar 02 13:20:31 2016 +0100
     1.3 @@ -209,10 +209,12 @@
     1.4  - (void)testTrustWords {
     1.5      [self pEpSetUp];
     1.6  
     1.7 -    NSArray *trustwords = [session trustwords:@"DB4713183660A12ABAFA7714EBE90D44146F62F4" forLanguage:@"en" shortened:false];
     1.8 +    NSArray *trustwords = [session trustwords:@"DB47DB47DB47DB47DB47DB47DB47DB47DB47DB47" forLanguage:@"en" shortened:false];
     1.9      XCTAssertEqual([trustwords count], 10);
    1.10 -    XCTAssertEqualObjects([trustwords firstObject], @"BAPTISMAL");
    1.11      
    1.12 +    for(id word in trustwords)
    1.13 +        XCTAssertEqualObjects(word, @"BAPTISMAL");
    1.14 +
    1.15      [self pEpCleanUp];
    1.16      
    1.17  }
    1.18 @@ -315,6 +317,14 @@
    1.19      clr = [session outgoingMessageColor:msg];
    1.20      XCTAssert( clr == PEP_rating_unencrypted);
    1.21      
    1.22 +    /*
    1.23 +    identBob = [NSMutableDictionary dictionaryWithObjectsAndKeys:
    1.24 +                @"pEp Test Bob", @"username",
    1.25 +                @"pep.test.bob@pep-project.org", @"address",
    1.26 +                @"42", @"user_id",
    1.27 +                @"BFCDB7F301DEEEBBF947F29659BFF488C9C2EE39",@"fpr",
    1.28 +                nil];
    1.29 +*/
    1.30      // Forget
    1.31      [session keyResetTrust:identBob];
    1.32      
     2.1 --- a/pEpiOSAdapter/PEPSession.m	Tue Mar 01 19:11:53 2016 +0100
     2.2 +++ b/pEpiOSAdapter/PEPSession.m	Wed Mar 02 13:20:31 2016 +0100
     2.3 @@ -195,15 +195,13 @@
     2.4  
     2.5  - (NSArray *)trustwords:(NSString *)fpr forLanguage:(NSString *)languageID shortened:(BOOL)shortened
     2.6  {
     2.7 -    NSString *fprStripped = [fpr stringByReplacingOccurrencesOfString:@" " withString:@""];
     2.8 -
     2.9      NSMutableArray *array = [NSMutableArray array];
    2.10  
    2.11 -    for (int i = 0; i < [fprStripped length]; i += 4) {
    2.12 +    for (int i = 0; i < [fpr length]; i += 4) {
    2.13          if (shortened && i >= 20)
    2.14              break;
    2.15          
    2.16 -        NSString *str = [fprStripped substringWithRange:NSMakeRange(i, 4)];
    2.17 +        NSString *str = [fpr substringWithRange:NSMakeRange(i, 4)];
    2.18  
    2.19          unsigned int value;
    2.20          [[NSScanner scannerWithString:str] scanHexInt:&value];