IOSAD-122 Correctly clean up sequoia keys. IOSAD-122
authorDirk Zimmermann <dz@pep.security>
Wed, 10 Jul 2019 11:28:31 +0200
branchIOSAD-122
changeset 10653f181e63e1a6
parent 1064 69d744025cc9
child 1066 a869e1640ef0
IOSAD-122 Correctly clean up sequoia keys.
pEpObjCTests/TestUtils/PEPTestUtils.m
     1.1 --- a/pEpObjCTests/TestUtils/PEPTestUtils.m	Wed Jul 10 11:16:48 2019 +0200
     1.2 +++ b/pEpObjCTests/TestUtils/PEPTestUtils.m	Wed Jul 10 11:28:31 2019 +0200
     1.3 @@ -120,13 +120,20 @@
     1.4  {
     1.5      // Only files whose content is affected by tests.
     1.6      NSString *home = [[[NSProcessInfo processInfo]environment]objectForKey:@"HOME"];
     1.7 -    NSString *gpgHome = [home stringByAppendingPathComponent:@".gnupg"];
     1.8 -    return @[[home stringByAppendingPathComponent:@".pEp_keys.db"],
     1.9 -             [home stringByAppendingPathComponent:@".pEp_keys.db-shm"],
    1.10 -             [home stringByAppendingPathComponent:@".pEp_keys.db-wal"],
    1.11 -             [gpgHome stringByAppendingPathComponent:@"pubring.gpg"],
    1.12 -             [gpgHome stringByAppendingPathComponent:@"secring.gpg"]];
    1.13  
    1.14 +    NSArray *baseNames = @[@".pEp_keys", @".pEp_management"];
    1.15 +    NSArray *baseEndings = @[@"db", @"db-shm", @"db-wal"];
    1.16 +
    1.17 +    NSMutableArray *result = [NSMutableArray array];
    1.18 +
    1.19 +    for (NSString *base in baseNames) {
    1.20 +        for (NSString *ending in baseEndings) {
    1.21 +            NSString *filename = [NSString stringWithFormat:@"%@.%@", base, ending];
    1.22 +            [result addObject:[home stringByAppendingPathComponent:filename]];
    1.23 +        }
    1.24 +    }
    1.25 +
    1.26 +    return result;
    1.27  }
    1.28  
    1.29  + (void)cleanUp