summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libtls/tls.h86
1 files changed, 44 insertions, 42 deletions
diff --git a/src/lib/libtls/tls.h b/src/lib/libtls/tls.h
index 071309242f..de58b92963 100644
--- a/src/lib/libtls/tls.h
+++ b/src/lib/libtls/tls.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls.h,v 1.10 2015/02/22 15:09:54 jsing Exp $ */ 1/* $OpenBSD: tls.h,v 1.11 2015/02/26 10:36:30 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -37,51 +37,53 @@ struct tls_config;
37 37
38int tls_init(void); 38int tls_init(void);
39 39
40const char *tls_error(struct tls *ctx); 40const char *tls_error(struct tls *_ctx);
41 41
42struct tls_config *tls_config_new(void); 42struct tls_config *tls_config_new(void);
43void tls_config_free(struct tls_config *config); 43void tls_config_free(struct tls_config *_config);
44 44
45int tls_config_set_ca_file(struct tls_config *config, const char *ca_file); 45int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file);
46int tls_config_set_ca_path(struct tls_config *config, const char *ca_path); 46int tls_config_set_ca_path(struct tls_config *_config, const char *_ca_path);
47int tls_config_set_ca_mem(struct tls_config *config, const uint8_t *ca, 47int tls_config_set_ca_mem(struct tls_config *_config, const uint8_t *_ca,
48 size_t len); 48 size_t _len);
49int tls_config_set_cert_file(struct tls_config *config, const char *cert_file); 49int tls_config_set_cert_file(struct tls_config *_config,
50int tls_config_set_cert_mem(struct tls_config *config, const uint8_t *cert, 50 const char *_cert_file);
51 size_t len); 51int tls_config_set_cert_mem(struct tls_config *_config, const uint8_t *_cert,
52int tls_config_set_ciphers(struct tls_config *config, const char *ciphers); 52 size_t _len);
53int tls_config_set_dheparams(struct tls_config *config, const char *params); 53int tls_config_set_ciphers(struct tls_config *_config, const char *_ciphers);
54int tls_config_set_ecdhecurve(struct tls_config *config, const char *name); 54int tls_config_set_dheparams(struct tls_config *_config, const char *_params);
55int tls_config_set_key_file(struct tls_config *config, const char *key_file); 55int tls_config_set_ecdhecurve(struct tls_config *_config, const char *_name);
56int tls_config_set_key_mem(struct tls_config *config, const uint8_t *key, 56int tls_config_set_key_file(struct tls_config *_config, const char *_key_file);
57 size_t len); 57int tls_config_set_key_mem(struct tls_config *_config, const uint8_t *_key,
58void tls_config_set_protocols(struct tls_config *config, uint32_t protocols); 58 size_t _len);
59void tls_config_set_verify_depth(struct tls_config *config, int verify_depth); 59void tls_config_set_protocols(struct tls_config *_config, uint32_t _protocols);
60 60void tls_config_set_verify_depth(struct tls_config *_config, int _verify_depth);
61void tls_config_clear_keys(struct tls_config *config); 61
62int tls_config_parse_protocols(uint32_t *protocols, const char *protostr); 62void tls_config_clear_keys(struct tls_config *_config);
63 63int tls_config_parse_protocols(uint32_t *_protocols, const char *_protostr);
64void tls_config_insecure_noverifycert(struct tls_config *config); 64
65void tls_config_insecure_noverifyname(struct tls_config *config); 65void tls_config_insecure_noverifycert(struct tls_config *_config);
66void tls_config_verify(struct tls_config *config); 66void tls_config_insecure_noverifyname(struct tls_config *_config);
67void tls_config_verify(struct tls_config *_config);
67 68
68struct tls *tls_client(void); 69struct tls *tls_client(void);
69struct tls *tls_server(void); 70struct tls *tls_server(void);
70int tls_configure(struct tls *ctx, struct tls_config *config); 71int tls_configure(struct tls *_ctx, struct tls_config *_config);
71void tls_reset(struct tls *ctx); 72void tls_reset(struct tls *_ctx);
72void tls_free(struct tls *ctx); 73void tls_free(struct tls *_ctx);
73 74
74int tls_accept_socket(struct tls *ctx, struct tls **cctx, int socket); 75int tls_accept_socket(struct tls *_ctx, struct tls **_cctx, int _socket);
75int tls_connect(struct tls *ctx, const char *host, const char *port); 76int tls_connect(struct tls *_ctx, const char *_host, const char *_port);
76int tls_connect_fds(struct tls *ctx, int fd_read, int fd_write, 77int tls_connect_fds(struct tls *_ctx, int _fd_read, int _fd_write,
77 const char *servername); 78 const char *_servername);
78int tls_connect_servername(struct tls *ctx, const char *host, const char *port, 79int tls_connect_servername(struct tls *_ctx, const char *_host,
79 const char *servername); 80 const char *_port, const char *_servername);
80int tls_connect_socket(struct tls *ctx, int s, const char *servername); 81int tls_connect_socket(struct tls *_ctx, int _s, const char *_servername);
81int tls_read(struct tls *ctx, void *buf, size_t buflen, size_t *outlen); 82int tls_read(struct tls *_ctx, void *_buf, size_t _buflen, size_t *_outlen);
82int tls_write(struct tls *ctx, const void *buf, size_t buflen, size_t *outlen); 83int tls_write(struct tls *_ctx, const void *_buf, size_t _buflen,
83int tls_close(struct tls *ctx); 84 size_t *_outlen);
84 85int tls_close(struct tls *_ctx);
85uint8_t *tls_load_file(const char *file, size_t *len, char *password); 86
87uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password);
86 88
87#endif /* HEADER_TLS_H */ 89#endif /* HEADER_TLS_H */