IOSAD-172 Implement adding of a passphrase IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Fri, 26 Jun 2020 16:54:34 +0200
branchIOSAD-172
changeset 1459a2d09a38d424
parent 1458 8e31ce01a795
child 1460 4cacc1f773c4
IOSAD-172 Implement adding of a passphrase
pEpObjCAdapter/PEPPassphraseCache.m
     1.1 --- a/pEpObjCAdapter/PEPPassphraseCache.m	Thu Jun 25 17:08:21 2020 +0200
     1.2 +++ b/pEpObjCAdapter/PEPPassphraseCache.m	Fri Jun 26 16:54:34 2020 +0200
     1.3 @@ -39,6 +39,12 @@
     1.4  
     1.5  - (void)addPassphrase:(NSString *)passphrase
     1.6  {
     1.7 +    dispatch_sync(self.queue, ^{
     1.8 +        [self.mutablePassphrases addObject:passphrase];
     1.9 +        if (self.mutablePassphrases.count > s_numberOfPassphrases) {
    1.10 +            [self.mutablePassphrases removeObjectAtIndex:0];
    1.11 +        }
    1.12 +    });
    1.13  }
    1.14  
    1.15  - (NSArray *)passphrases