session-ios/SignalServiceKit/src/Devices/OWSProvisioningCipher.h
Michael Kirk 01d0117f9b provisioning cipher: Fix memory leak, handle failure
Explicitly malloc'd buffer should either be explicitly free'd or
ownership given to NSData via `freeWhenDone:YES`

Instead I opted to avoid the explict malloc altogether, and avoided some
unnecessary allocations.

Also made sure encryption failures propogate to error handler

// FREEBIE
2017-08-30 09:47:29 -04:00

17 lines
342 B
Objective-C

//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
NS_ASSUME_NONNULL_BEGIN
@interface OWSProvisioningCipher : NSObject
@property (nonatomic, readonly) NSData *ourPublicKey;
- (instancetype)initWithTheirPublicKey:(NSData *)theirPublicKey;
- (nullable NSData *)encrypt:(NSData *)plainText;
@end
NS_ASSUME_NONNULL_END