kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

tls_none.c (3149B)



      1 /*
      2  * Copyright (c) 2022 Joris Vink <joris@coders.se>
      3  *
      4  * Permission to use, copy, modify, and distribute this software for any
      5  * purpose with or without fee is hereby granted, provided that the above
      6  * copyright notice and this permission notice appear in all copies.
      7  *
      8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
      9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     15  */
     16 
     17 /*
     18  * An empty TLS backend that does nothing, useful if you do
     19  * not require any TLS stuff in Kore.
     20  */
     21 
     22 #include <sys/types.h>
     23 
     24 #include "kore.h"
     25 
     26 struct kore_privsep	keymgr_privsep;
     27 char			*kore_rand_file = NULL;
     28 int			kore_keymgr_active = 0;
     29 
     30 int
     31 kore_tls_supported(void)
     32 {
     33 	return (KORE_RESULT_ERROR);
     34 }
     35 
     36 void
     37 kore_keymgr_cleanup(int final)
     38 {
     39 }
     40 
     41 void
     42 kore_tls_init(void)
     43 {
     44 	kore_log(LOG_NOTICE, "No compiled in TLS backend");
     45 }
     46 
     47 void
     48 kore_tls_cleanup(void)
     49 {
     50 }
     51 
     52 void
     53 kore_tls_dh_check(void)
     54 {
     55 }
     56 
     57 void
     58 kore_tls_keymgr_init(void)
     59 {
     60 }
     61 
     62 void
     63 kore_tls_connection_cleanup(struct connection *c)
     64 {
     65 }
     66 
     67 void
     68 kore_tls_domain_cleanup(struct kore_domain *dom)
     69 {
     70 }
     71 
     72 void
     73 kore_tls_seed(const void *data, size_t len)
     74 {
     75 }
     76 
     77 void
     78 kore_keymgr_run(void)
     79 {
     80 	fatal("%s: not supported", __func__);
     81 }
     82 
     83 void
     84 kore_tls_version_set(int version)
     85 {
     86 	fatal("%s: not supported", __func__);
     87 }
     88 
     89 int
     90 kore_tls_dh_load(const char *path)
     91 {
     92 	fatal("%s: not supported", __func__);
     93 }
     94 
     95 int
     96 kore_tls_ciphersuite_set(const char *list)
     97 {
     98 	fatal("%s: not supported", __func__);
     99 }
    100 
    101 void
    102 kore_tls_domain_setup(struct kore_domain *dom, int type,
    103     const void *data, size_t datalen)
    104 {
    105 	fatal("%s: not supported", __func__);
    106 }
    107 
    108 void
    109 kore_tls_domain_crl(struct kore_domain *dom, const void *pem, size_t pemlen)
    110 {
    111 	fatal("%s: not supported", __func__);
    112 }
    113 
    114 int
    115 kore_tls_connection_accept(struct connection *c)
    116 {
    117 	fatal("%s: not supported", __func__);
    118 }
    119 
    120 int
    121 kore_tls_read(struct connection *c, size_t *bytes)
    122 {
    123 	fatal("%s: not supported", __func__);
    124 }
    125 
    126 int
    127 kore_tls_write(struct connection *c, size_t len, size_t *written)
    128 {
    129 	fatal("%s: not supported", __func__);
    130 }
    131 
    132 KORE_PRIVATE_KEY *
    133 kore_tls_rsakey_load(const char *path)
    134 {
    135 	fatal("%s: not supported", __func__);
    136 }
    137 
    138 KORE_PRIVATE_KEY *
    139 kore_tls_rsakey_generate(const char *path)
    140 {
    141 	fatal("%s: not supported", __func__);
    142 }
    143 
    144 KORE_X509_NAMES *
    145 kore_tls_x509_subject_name(struct connection *c)
    146 {
    147 	fatal("%s: not supported", __func__);
    148 }
    149 
    150 KORE_X509_NAMES *
    151 kore_tls_x509_issuer_name(struct connection *c)
    152 {
    153 	fatal("%s: not supported", __func__);
    154 }
    155 
    156 int
    157 kore_tls_x509name_foreach(KORE_X509_NAMES *name, int flags, void *udata,
    158     int (*cb)(void *, int, int, const char *, const void *, size_t, int))
    159 {
    160 	fatal("%s: not supported", __func__);
    161 }
    162 
    163 int
    164 kore_tls_x509_data(struct connection *c, u_int8_t **ptr, size_t *olen)
    165 {
    166 	fatal("%s: not supported", __func__);
    167 }