X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fustream-ssl.git;a=blobdiff_plain;f=ustream-polarssl.h;h=3c4a5ed2140746fd77e99a49cc7030d8e7ce602b;hp=70e8b42805287cf77bf93e2aa32c4036d25c6e35;hb=add9c19ae46263e9c2ca85c0baad22cd758f6c63;hpb=f19b2ec17f0c3d663a5f349de07b12af40016902 diff --git a/ustream-polarssl.h b/ustream-polarssl.h index 70e8b42..3c4a5ed 100644 --- a/ustream-polarssl.h +++ b/ustream-polarssl.h @@ -26,19 +26,11 @@ #include #include #include - -#if POLARSSL_VERSION_MAJOR > 1 || POLARSSL_VERSION_MINOR >= 3 -#define USE_VERSION_1_3 -#else -#define x509_crt x509_cert -#endif +#include struct ustream_ssl_ctx { -#ifdef USE_VERSION_1_3 pk_context key; -#else - rsa_context key; -#endif + x509_crt ca_cert; x509_crt cert; bool server; }; @@ -49,6 +41,12 @@ static inline char *__ustream_ssl_strerror(int error, char *buffer, int len) return buffer; } +static inline void __ustream_ssl_set_server_name(struct ustream_ssl *us) +{ + ssl_set_hostname(us->ssl, us->server_name); +} + +void __ustream_ssl_update_peer_cn(struct ustream_ssl *us); void __ustream_ssl_session_free(void *ssl); void *__ustream_ssl_session_new(struct ustream_ssl_ctx *ctx);