IOS-2325 Decorate get_trustwords_for_fprs IOSAD-178
authorDirk Zimmermann <dz@pep.security>
Mon, 20 Jul 2020 17:00:22 +0200
branchIOSAD-178
changeset 1842bb9639575e44
parent 1841 6bb4517f7340
child 1843 0c1ab3384742
IOS-2325 Decorate get_trustwords_for_fprs
pEpObjCAdapter/PEPInternalSession.m
     1.1 --- a/pEpObjCAdapter/PEPInternalSession.m	Mon Jul 20 17:00:22 2020 +0200
     1.2 +++ b/pEpObjCAdapter/PEPInternalSession.m	Mon Jul 20 17:00:22 2020 +0200
     1.3 @@ -842,15 +842,15 @@
     1.4      const char *_fpr1 = [fpr1 UTF8String]; // fprs are NFC normalized anyway
     1.5      const char *_fpr2 = [fpr2 UTF8String];
     1.6      
     1.7 -    PEPStatus status;
     1.8 -    
     1.9      PEPAutoPointer *trustwords = [PEPAutoPointer new];
    1.10 -    size_t sizeWritten = 0;
    1.11 +    __block size_t sizeWritten = 0;
    1.12  
    1.13 -    status = (PEPStatus) get_trustwords_for_fprs(_session, _fpr1, _fpr2,
    1.14 -                                                 [[language precomposedStringWithCanonicalMapping]
    1.15 -                                                  UTF8String],
    1.16 -                                                 trustwords.charPointerPointer, &sizeWritten, full);
    1.17 +    PEPStatus status = (PEPStatus) [self runWithPasswords:^PEP_STATUS(PEP_SESSION session) {
    1.18 +        return get_trustwords_for_fprs(session, _fpr1, _fpr2,
    1.19 +                                       [[language precomposedStringWithCanonicalMapping]
    1.20 +                                        UTF8String],
    1.21 +                                       trustwords.charPointerPointer, &sizeWritten, full);
    1.22 +    }];
    1.23      
    1.24      NSString *result = nil;
    1.25