ThingWorx C SDK
twNoTls.h
1 /*
2  * Copyright (C) 2015 ThingWorx Inc.
3  *
4  * NoTLS Client wrapper layer
5  */
6 
7 #ifndef NO_TLS_H
8 #define NO_TLS_H
9 
10 #include "twOSPort.h"
11 #include "tomcrypt.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 int16_t returnValue(int16_t v);
18 void * mallocByte();
19 
20 #define TW_SSL_CTX void
21 #define TW_NEW_SSL_CTX mallocByte()
22 
23 #define TW_SSL twSocket
24 #define TW_NEW_SSL_CLIENT(a,b,c,d) b
25 
26 #define TW_SSL_SESSION_ID_SIZE 0
27 #define TW_GET_CERT_SIZE 0
28 #define TW_GET_CA_CERT_SIZE 0
29 #define TW_HANDSHAKE_SUCCEEDED(a) returnValue(1)
30 #define TW_SSL_SESSION_ID(a) NULL
31 #define TW_NEW_SERVER(a,b) NULL
32 #define TW_SSL_FREE(a) returnValue(0)
33 #define TW_SSL_CTX_FREE(a) returnValue(0)
34 #define TW_SSL_ACCEPT(a) returnValue(0)
35 #define TW_SSL_WRITE(a,b,c) twSocket_Write(a, b, c, 0)
36 #define TW_USE_CERT_FILE(a,b,c) returnValue(0)
37 #define TW_USE_KEY_FILE(a,b,c,d) returnValue(0)
38 #define TW_USE_CERT_CHAIN_FILE(a,b,c) returnValue(0)
39 #define TW_SET_CLIENT_CA_LIST(a,b) returnValue(0)
40 #define TW_SSL_READ(a,b, c, d) twSocket_Read(a, b, c, d)
41 #define TW_VALIDATE_CERT(a,b) returnValue(0)
42 #define TW_ENABLE_FIPS_MODE(a) returnValue(TW_FIPS_MODE_NOT_SUPPORTED)
43 #define TW_SHA1_CTX hash_state
44 #define TW_SHA1_INIT(a) sha1_init(a)
45 #define TW_SHA1_UPDATE(a,b,c) sha1_process(a,b,c)
46 #define TW_SHA1_FINAL(a,b) sha1_done(b,a)
47 
48 #define TW_MD5_CTX hash_state
49 #define TW_MD5_INIT(a) md5_init(a)
50 #define TW_MD5_UPDATE(a,b,c) md5_process(a,b,c)
51 #define TW_MD5_FINAL(a,b) md5_done(b,a)
52 
53 static INLINE char * TW_GET_X509_FIELD(TW_SSL * ssl, char field) {
54  return NULL;
55 }
56 
57 #ifdef __cplusplus
58 }
59 #endif
60 
61 #endif /* NO_TLS_H */
static INLINE char * TW_GET_X509_FIELD(TW_SSL *ssl, char field)
Gets an X509 field of ssl.
Definition: twOpenSSL.h:385
Wrappers for OS-specific functionality.