]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_ssl/regressions/ssl-52-noconn.c
Security-57740.20.22.tar.gz
[apple/security.git] / OSX / libsecurity_ssl / regressions / ssl-52-noconn.c
1 //
2 // ssl-52-noconn.c
3 // libsecurity_ssl
4 //
5
6 #include <stdio.h>
7 #include <Security/SecureTransport.h>
8 #include "ssl_regressions.h"
9
10 static
11 OSStatus r(SSLConnectionRef connection, void *data, size_t *dataLength) {
12 return errSSLWouldBlock;
13 }
14
15 static
16 OSStatus w(SSLConnectionRef connection, const void *data, size_t *dataLength) {
17 return errSSLWouldBlock;
18 }
19
20 //Testing <rdar://problem/13539215> Trivial SecureTransport example crashes on Cab, where it worked on Zin
21 static
22 void tests()
23 {
24 OSStatus ortn;
25 SSLContextRef ctx;
26 ctx = SSLCreateContext(NULL, kSSLClientSide, kSSLStreamType);
27 SSLSetIOFuncs(ctx, r, w);
28 ortn = SSLHandshake(ctx);
29
30 is(ortn, errSSLWouldBlock, "SSLHandshake unexpected return\n");
31
32 CFRelease(ctx);
33 }
34
35
36 int ssl_52_noconn(int argc, char *const *argv)
37 {
38
39 plan_tests(1);
40
41 tests();
42
43 return 0;
44 }