diff --git a/src/SSLSocket.h b/src/SSLSocket.h index d439c0f..54406f3 100644 --- a/src/SSLSocket.h +++ b/src/SSLSocket.h @@ -45,7 +45,7 @@ OF_ASSUME_NONNULL_BEGIN X509Certificate *peerCertificate; - initWithSocket: (OFTCPSocket *)socket; -- (OFDataArray *)channelBindingDataWithType: (OFString *)type; +- (OFData *)channelBindingDataWithType: (OFString *)type; - (nullable X509Certificate *)peerCertificate; @end diff --git a/src/SSLSocket.m b/src/SSLSocket.m index 4425fbe..f1822ac 100644 --- a/src/SSLSocket.m +++ b/src/SSLSocket.m @@ -43,7 +43,7 @@ #import #import -#import +#import #import #import @@ -423,11 +423,10 @@ locking_callback(int mode, int n, const char *file, int line) OF_UNRECOGNIZED_SELECTOR } -- (OFDataArray *)channelBindingDataWithType: (OFString *)type +- (OFData *)channelBindingDataWithType: (OFString *)type { size_t length; char buffer[64]; - OFDataArray *data; if (![type isEqual: @"tls-unique"]) @throw [OFInvalidArgumentException exception]; @@ -443,11 +442,8 @@ locking_callback(int mode, int n, const char *file, int line) length = SSL_get_peer_finished(_SSL, buffer, 64); } - data = [OFDataArray dataArray]; - [data addItems: buffer - count: length]; - - return data; + return [OFData dataWithItems: buffer + count: length]; } - (X509Certificate *)peerCertificate diff --git a/src/X509Certificate.m b/src/X509Certificate.m index dd9ba7c..db17607 100644 --- a/src/X509Certificate.m +++ b/src/X509Certificate.m @@ -37,7 +37,7 @@ #import #import -#import +#import #import #import #import @@ -72,11 +72,10 @@ OF_ASSUME_NONNULL_END @try { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; - OFDataArray *data = [OFDataArray - dataArrayWithContentsOfFile: path]; - const unsigned char *dataCArray = [data items]; + OFData *data = [OFData dataWithContentsOfFile: path]; + const unsigned char *dataC = [data items]; - _certificate = d2i_X509(NULL, &dataCArray, [data count]); + _certificate = d2i_X509(NULL, &dataC, [data count]); if (_certificate == NULL) @throw [OFInitializationFailedException exceptionWithClass: [self class]];