]>
Commit | Line | Data |
---|---|---|
bf8f2167 | 1 | /* |
e0edde6f | 2 | * Copyright (c) 2011 Nicira, Inc. |
bf8f2167 BP |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at: | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | ||
17 | #include <config.h> | |
18 | #include "stream-ssl.h" | |
19 | #include "vlog.h" | |
20 | ||
21 | VLOG_DEFINE_THIS_MODULE(stream_nossl); | |
22 | \f | |
23 | /* Dummy function definitions, used when OVS is built without OpenSSL. */ | |
24 | ||
25 | bool | |
26 | stream_ssl_is_configured(void) | |
27 | { | |
28 | return false; | |
29 | } | |
30 | ||
31 | static void NO_RETURN | |
32 | nossl_option(const char *detail) | |
33 | { | |
34 | VLOG_FATAL("%s specified but Open vSwitch was built without SSL support", | |
35 | detail); | |
36 | } | |
37 | ||
38 | void | |
39 | stream_ssl_set_private_key_file(const char *file_name) | |
40 | { | |
41 | if (file_name != NULL) { | |
42 | nossl_option("Private key"); | |
43 | } | |
44 | } | |
45 | ||
46 | void | |
47 | stream_ssl_set_certificate_file(const char *file_name) | |
48 | { | |
49 | if (file_name != NULL) { | |
50 | nossl_option("Certificate"); | |
51 | } | |
52 | } | |
53 | ||
54 | void | |
55 | stream_ssl_set_ca_cert_file(const char *file_name, bool bootstrap OVS_UNUSED) | |
56 | { | |
57 | if (file_name != NULL) { | |
58 | nossl_option("CA certificate"); | |
59 | } | |
60 | } | |
61 | ||
62 | void | |
63 | stream_ssl_set_peer_ca_cert_file(const char *file_name) | |
64 | { | |
65 | if (file_name != NULL) { | |
66 | nossl_option("Peer CA certificate"); | |
67 | } | |
68 | } | |
69 | ||
70 | void | |
71 | stream_ssl_set_key_and_cert(const char *private_key_file, | |
72 | const char *certificate_file) | |
73 | { | |
74 | stream_ssl_set_private_key_file(private_key_file); | |
75 | stream_ssl_set_certificate_file(certificate_file); | |
76 | } |