39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
#import <ObjFW/OFThread.h>
#import <ObjFW/OFHTTPRequest.h>
#import <ObjFW/OFDataArray.h>
#import <ObjFW/OFLocalization.h>
#import <ObjFW/OFAcceptFailedException.h>
#import <ObjFW/OFInitializationFailedException.h>
#import <ObjFW/OFInvalidArgumentException.h>
#import <ObjFW/OFNotOpenException.h>
#import <ObjFW/OFOutOfRangeException.h>
|
|
|
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
#import <ObjFW/OFThread.h>
#import <ObjFW/OFHTTPRequest.h>
#import <ObjFW/OFData.h>
#import <ObjFW/OFLocalization.h>
#import <ObjFW/OFAcceptFailedException.h>
#import <ObjFW/OFInitializationFailedException.h>
#import <ObjFW/OFInvalidArgumentException.h>
#import <ObjFW/OFNotOpenException.h>
#import <ObjFW/OFOutOfRangeException.h>
|
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
|
- (const char *)privateKeyPassphraseForSNIHost: (OFString *)SNIHost
{
/* TODO */
OF_UNRECOGNIZED_SELECTOR
}
- (OFDataArray *)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) {
/*
* We are either client or the session has been resumed
* => we have sent the finished message
*/
length = SSL_get_finished(_SSL, buffer, 64);
} else {
/* peer sent the finished message */
length = SSL_get_peer_finished(_SSL, buffer, 64);
}
data = [OFDataArray dataArray];
[data addItems: buffer
count: length];
return data;
}
- (X509Certificate *)peerCertificate
{
X509 *certificate = SSL_get_peer_certificate(_SSL);
if (certificate == NULL)
|
|
<
<
|
|
<
<
|
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
|
- (const char *)privateKeyPassphraseForSNIHost: (OFString *)SNIHost
{
/* TODO */
OF_UNRECOGNIZED_SELECTOR
}
- (OFData *)channelBindingDataWithType: (OFString *)type
{
size_t length;
char buffer[64];
if (![type isEqual: @"tls-unique"])
@throw [OFInvalidArgumentException exception];
if (SSL_session_reused(_SSL) ^ !_listening) {
/*
* We are either client or the session has been resumed
* => we have sent the finished message
*/
length = SSL_get_finished(_SSL, buffer, 64);
} else {
/* peer sent the finished message */
length = SSL_get_peer_finished(_SSL, buffer, 64);
}
return [OFData dataWithItems: buffer
count: length];
}
- (X509Certificate *)peerCertificate
{
X509 *certificate = SSL_get_peer_certificate(_SSL);
if (certificate == NULL)
|