diff options
author | David Timber <mieabby@gmail.com> | 2021-07-12 16:16:22 +1000 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2021-07-12 16:16:22 +1000 |
commit | 15bde4c46b707f7a95c7ea6650a3f02d67e50530 (patch) | |
tree | 1aa069521941a41171302dba837d57d35a2d9e41 /src/mbedtls.c | |
parent | 3fbf08ab6522c91e8209b21d66430a2db4ea71cb (diff) |
Impl proone-htbtclient, bugfix, --enable-mttools
* Remove --enable-hostinfod and add --enable-mttools, which enables
hostinfod and htbtclient
* Change PRNE_HTBT_PROTO_PORT so that the macro can be used in another
macro expression(for help message)
* Add prne_mbedtls_perror()
* proone-htbtclient: implement hostinfo command
* proone-htbthost
* Add --hostcred option
* Response with status frame on ENOMEM
* htbt: add prne_htbt_serrc_tostr() and prne_htbt_gen_msgid()
* Add prne_ctoupper(), prne_ctolower(), prne_cisspace(), prne_cisprint()
* The added functions are the locale-independent equivalent of their
POSIX counterparts
* Remove Use of the POSIX functions
* Add test unit
Diffstat (limited to 'src/mbedtls.c')
-rw-r--r-- | src/mbedtls.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mbedtls.c b/src/mbedtls.c index 6b8b600..3372ee6 100644 --- a/src/mbedtls.c +++ b/src/mbedtls.c @@ -11,6 +11,7 @@ #include <mbedtls/ssl.h> #include <mbedtls/entropy_poll.h> +#include <mbedtls/error.h> int prne_mbedtls_x509_crt_verify_cb ( @@ -206,3 +207,12 @@ bool prne_mbedtls_verify_alp ( mbedtls_ssl_get_alpn_protocol(ctx), alp); } + +void prne_mbedtls_perror (const int err, const char *s) { + char str[256]; + + str[0] = 0; + mbedtls_strerror(err, str, sizeof(str)); + + fprintf(stderr, "%s: %s\n", s, str); +} |