diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libtls/tls.h | 86 |
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 | ||
| 38 | int tls_init(void); | 38 | int tls_init(void); |
| 39 | 39 | ||
| 40 | const char *tls_error(struct tls *ctx); | 40 | const char *tls_error(struct tls *_ctx); |
| 41 | 41 | ||
| 42 | struct tls_config *tls_config_new(void); | 42 | struct tls_config *tls_config_new(void); |
| 43 | void tls_config_free(struct tls_config *config); | 43 | void tls_config_free(struct tls_config *_config); |
| 44 | 44 | ||
| 45 | int tls_config_set_ca_file(struct tls_config *config, const char *ca_file); | 45 | int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file); |
| 46 | int tls_config_set_ca_path(struct tls_config *config, const char *ca_path); | 46 | int tls_config_set_ca_path(struct tls_config *_config, const char *_ca_path); |
| 47 | int tls_config_set_ca_mem(struct tls_config *config, const uint8_t *ca, | 47 | int tls_config_set_ca_mem(struct tls_config *_config, const uint8_t *_ca, |
| 48 | size_t len); | 48 | size_t _len); |
| 49 | int tls_config_set_cert_file(struct tls_config *config, const char *cert_file); | 49 | int tls_config_set_cert_file(struct tls_config *_config, |
| 50 | int tls_config_set_cert_mem(struct tls_config *config, const uint8_t *cert, | 50 | const char *_cert_file); |
| 51 | size_t len); | 51 | int tls_config_set_cert_mem(struct tls_config *_config, const uint8_t *_cert, |
| 52 | int tls_config_set_ciphers(struct tls_config *config, const char *ciphers); | 52 | size_t _len); |
| 53 | int tls_config_set_dheparams(struct tls_config *config, const char *params); | 53 | int tls_config_set_ciphers(struct tls_config *_config, const char *_ciphers); |
| 54 | int tls_config_set_ecdhecurve(struct tls_config *config, const char *name); | 54 | int tls_config_set_dheparams(struct tls_config *_config, const char *_params); |
| 55 | int tls_config_set_key_file(struct tls_config *config, const char *key_file); | 55 | int tls_config_set_ecdhecurve(struct tls_config *_config, const char *_name); |
| 56 | int tls_config_set_key_mem(struct tls_config *config, const uint8_t *key, | 56 | int tls_config_set_key_file(struct tls_config *_config, const char *_key_file); |
| 57 | size_t len); | 57 | int tls_config_set_key_mem(struct tls_config *_config, const uint8_t *_key, |
| 58 | void tls_config_set_protocols(struct tls_config *config, uint32_t protocols); | 58 | size_t _len); |
| 59 | void tls_config_set_verify_depth(struct tls_config *config, int verify_depth); | 59 | void tls_config_set_protocols(struct tls_config *_config, uint32_t _protocols); |
| 60 | 60 | void tls_config_set_verify_depth(struct tls_config *_config, int _verify_depth); | |
| 61 | void tls_config_clear_keys(struct tls_config *config); | 61 | |
| 62 | int tls_config_parse_protocols(uint32_t *protocols, const char *protostr); | 62 | void tls_config_clear_keys(struct tls_config *_config); |
| 63 | 63 | int tls_config_parse_protocols(uint32_t *_protocols, const char *_protostr); | |
| 64 | void tls_config_insecure_noverifycert(struct tls_config *config); | 64 | |
| 65 | void tls_config_insecure_noverifyname(struct tls_config *config); | 65 | void tls_config_insecure_noverifycert(struct tls_config *_config); |
| 66 | void tls_config_verify(struct tls_config *config); | 66 | void tls_config_insecure_noverifyname(struct tls_config *_config); |
| 67 | void tls_config_verify(struct tls_config *_config); | ||
| 67 | 68 | ||
| 68 | struct tls *tls_client(void); | 69 | struct tls *tls_client(void); |
| 69 | struct tls *tls_server(void); | 70 | struct tls *tls_server(void); |
| 70 | int tls_configure(struct tls *ctx, struct tls_config *config); | 71 | int tls_configure(struct tls *_ctx, struct tls_config *_config); |
| 71 | void tls_reset(struct tls *ctx); | 72 | void tls_reset(struct tls *_ctx); |
| 72 | void tls_free(struct tls *ctx); | 73 | void tls_free(struct tls *_ctx); |
| 73 | 74 | ||
| 74 | int tls_accept_socket(struct tls *ctx, struct tls **cctx, int socket); | 75 | int tls_accept_socket(struct tls *_ctx, struct tls **_cctx, int _socket); |
| 75 | int tls_connect(struct tls *ctx, const char *host, const char *port); | 76 | int tls_connect(struct tls *_ctx, const char *_host, const char *_port); |
| 76 | int tls_connect_fds(struct tls *ctx, int fd_read, int fd_write, | 77 | int tls_connect_fds(struct tls *_ctx, int _fd_read, int _fd_write, |
| 77 | const char *servername); | 78 | const char *_servername); |
| 78 | int tls_connect_servername(struct tls *ctx, const char *host, const char *port, | 79 | int tls_connect_servername(struct tls *_ctx, const char *_host, |
| 79 | const char *servername); | 80 | const char *_port, const char *_servername); |
| 80 | int tls_connect_socket(struct tls *ctx, int s, const char *servername); | 81 | int tls_connect_socket(struct tls *_ctx, int _s, const char *_servername); |
| 81 | int tls_read(struct tls *ctx, void *buf, size_t buflen, size_t *outlen); | 82 | int tls_read(struct tls *_ctx, void *_buf, size_t _buflen, size_t *_outlen); |
| 82 | int tls_write(struct tls *ctx, const void *buf, size_t buflen, size_t *outlen); | 83 | int tls_write(struct tls *_ctx, const void *_buf, size_t _buflen, |
| 83 | int tls_close(struct tls *ctx); | 84 | size_t *_outlen); |
| 84 | 85 | int tls_close(struct tls *_ctx); | |
| 85 | uint8_t *tls_load_file(const char *file, size_t *len, char *password); | 86 | |
| 87 | uint8_t *tls_load_file(const char *_file, size_t *_len, char *_password); | ||
| 86 | 88 | ||
| 87 | #endif /* HEADER_TLS_H */ | 89 | #endif /* HEADER_TLS_H */ |
