]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_ssl/regressions/SecureTransportTests/STLegacyTests+noconn.m
Security-59306.120.7.tar.gz
[apple/security.git] / OSX / libsecurity_ssl / regressions / SecureTransportTests / STLegacyTests+noconn.m
1 //
2 // ssl-52-noconn.c
3 // libsecurity_ssl
4 //
5
6 #include <stdio.h>
7 #include <Security/SecureTransport.h>
8 #import "STLegacyTests.h"
9
10 #pragma clang diagnostic push
11 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
12
13 @implementation STLegacyTests (dhe)
14
15 static
16 OSStatus r(SSLConnectionRef connection, void *data, size_t *dataLength) {
17 return errSSLWouldBlock;
18 }
19
20 static
21 OSStatus w(SSLConnectionRef connection, const void *data, size_t *dataLength) {
22 return errSSLWouldBlock;
23 }
24
25 //Testing <rdar://problem/13539215> Trivial SecureTransport example crashes on Cab, where it worked on Zin
26 -(void) testNoConn
27 {
28 OSStatus ortn;
29 SSLContextRef ctx;
30 ctx = SSLCreateContext(NULL, kSSLClientSide, kSSLStreamType);
31 SSLSetIOFuncs(ctx, r, w);
32 ortn = SSLHandshake(ctx);
33
34 XCTAssertEqual(ortn, errSSLWouldBlock, "SSLHandshake unexpected return\n");
35
36 CFRelease(ctx);
37 }
38
39 @end
40
41 #pragma clang diagnostic pop