Index: src/SSLSocket.h ================================================================== --- src/SSLSocket.h +++ src/SSLSocket.h @@ -43,10 +43,10 @@ bool requestClientCertificatesEnabled; @property OF_NULLABLE_PROPERTY (readonly, nonatomic) X509Certificate *peerCertificate; - initWithSocket: (OFTCPSocket *)socket; -- (OFDataArray *)channelBindingDataWithType: (OFString *)type; +- (OFData *)channelBindingDataWithType: (OFString *)type; - (nullable X509Certificate *)peerCertificate; @end OF_ASSUME_NONNULL_END Index: src/SSLSocket.m ================================================================== --- src/SSLSocket.m +++ src/SSLSocket.m @@ -41,11 +41,11 @@ # pragma clang diagnostic pop #endif #import #import -#import +#import #import #import #import #import @@ -421,15 +421,14 @@ { /* TODO */ 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]; if (SSL_session_reused(_SSL) ^ !_listening) { @@ -441,15 +440,12 @@ } else { /* peer sent the finished message */ 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 { X509 *certificate = SSL_get_peer_certificate(_SSL); Index: src/X509Certificate.m ================================================================== --- src/X509Certificate.m +++ src/X509Certificate.m @@ -35,11 +35,11 @@ #import "X509Certificate.h" #import #import -#import +#import #import #import #import #import #import @@ -70,15 +70,14 @@ { self = [super init]; @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]]; [pool release];