1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
//
// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
// file was obtained (LICENSE.txt). A copy of the license may also be
// found online at https://opensource.org/licenses/MIT.
//
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// This file is only used when TLS support is not build into the library.
// We provide stub functions only to satisfy linkage.
#include "core/nng_impl.h"
#include "supplemental/tls/tls.h"
#include "supplemental/tls/tls_api.h"
void
nni_tls_config_fini(nng_tls_config *cfg)
{
NNI_ARG_UNUSED(cfg);
}
int
nni_tls_config_init(nng_tls_config **cpp, enum nng_tls_mode mode)
{
NNI_ARG_UNUSED(cpp);
NNI_ARG_UNUSED(mode);
return (NNG_ENOTSUP);
}
void
nni_tls_config_hold(nng_tls_config *cfg)
{
NNI_ARG_UNUSED(cfg);
}
void
nni_tls_fini(nni_tls *tp)
{
NNI_ARG_UNUSED(tp);
}
int
nni_tls_init(nni_tls **tpp, nng_tls_config *cfg, nni_plat_tcp_pipe *tcp)
{
NNI_ARG_UNUSED(tpp);
NNI_ARG_UNUSED(cfg);
NNI_ARG_UNUSED(tcp);
return (NNG_ENOTSUP);
}
// nni_tls_send is the exported send function. It has a similar
// calling convention as the platform TCP pipe.
void
nni_tls_send(nni_tls *tp, nni_aio *aio)
{
NNI_ARG_UNUSED(tp);
nni_aio_finish_error(aio, NNG_ENOTSUP);
}
void
nni_tls_recv(nni_tls *tp, nni_aio *aio)
{
NNI_ARG_UNUSED(tp);
nni_aio_finish_error(aio, NNG_ENOTSUP);
}
int
nni_tls_peername(nni_tls *tp, nni_sockaddr *sa)
{
NNI_ARG_UNUSED(tp);
NNI_ARG_UNUSED(sa);
return (NNG_ENOTSUP);
}
int
nni_tls_sockname(nni_tls *tp, nni_sockaddr *sa)
{
NNI_ARG_UNUSED(tp);
NNI_ARG_UNUSED(sa);
return (NNG_ENOTSUP);
}
void
nni_tls_close(nni_tls *tp)
{
NNI_ARG_UNUSED(tp);
}
const char *
nni_tls_ciphersuite_name(nni_tls *tp)
{
NNI_ARG_UNUSED(tp);
return (NULL);
}
bool
nni_tls_verified(nni_tls *tp)
{
NNI_ARG_UNUSED(tp);
return (false);
}
int
nng_tls_config_server_name(nng_tls_config *cfg, const char *name)
{
NNI_ARG_UNUSED(cfg);
NNI_ARG_UNUSED(name);
return (NNG_ENOTSUP);
}
int
nng_tls_config_auth_mode(nng_tls_config *cfg, nng_tls_auth_mode mode)
{
NNI_ARG_UNUSED(cfg);
NNI_ARG_UNUSED(mode);
return (NNG_ENOTSUP);
}
int
nng_tls_config_ca_chain(
nng_tls_config *cfg, const char *certs, const char *crl)
{
NNI_ARG_UNUSED(cfg);
NNI_ARG_UNUSED(certs);
NNI_ARG_UNUSED(crl);
return (NNG_ENOTSUP);
}
int
nng_tls_config_own_cert(
nng_tls_config *cfg, const char *cert, const char *key, const char *pass)
{
NNI_ARG_UNUSED(cfg);
NNI_ARG_UNUSED(cert);
NNI_ARG_UNUSED(key);
NNI_ARG_UNUSED(pass);
return (NNG_ENOTSUP);
}
int
nng_tls_config_ca_file(nng_tls_config *cfg, const char *path)
{
NNI_ARG_UNUSED(cfg);
NNI_ARG_UNUSED(path);
return (NNG_ENOTSUP);
}
int
nng_tls_config_cert_key_file(
nng_tls_config *cfg, const char *path, const char *pass)
{
NNI_ARG_UNUSED(cfg);
NNI_ARG_UNUSED(path);
NNI_ARG_UNUSED(pass);
return (NNG_ENOTSUP);
}
int
nng_tls_config_alloc(nng_tls_config **cfgp, nng_tls_mode mode)
{
NNI_ARG_UNUSED(cfgp);
NNI_ARG_UNUSED(mode);
return (NNG_ENOTSUP);
}
void
nng_tls_config_free(nng_tls_config *cfg)
{
NNI_ARG_UNUSED(cfg);
}
|