summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-15 18:29:31 +0100
committerFelix Fietkau <nbd@openwrt.org>2016-01-15 18:29:31 +0100
commitc19d5b22e779848941c51aeb7c3030a18c80aa73 (patch)
tree5440936678053bdd8af94a087c45a55f38c08459
parentb03607e0293aea21d857b31fb9c0db9422bd1d24 (diff)
downloadustream-ssl-c19d5b22e779848941c51aeb7c3030a18c80aa73.tar.gz
polarssl: remove support for version 1.2
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--ustream-polarssl.c21
-rw-r--r--ustream-polarssl.h10
2 files changed, 0 insertions, 31 deletions
diff --git a/ustream-polarssl.c b/ustream-polarssl.c
index e1a6da0..9ddf931 100644
--- a/ustream-polarssl.c
+++ b/ustream-polarssl.c
@@ -99,11 +99,7 @@ __ustream_ssl_context_new(bool server)
return NULL;
ctx->server = server;
-#ifdef USE_VERSION_1_3
pk_init(&ctx->key);
-#else
- rsa_init(&ctx->key, RSA_PKCS_V15, 0);
-#endif
return ctx;
}
@@ -112,11 +108,7 @@ __hidden int __ustream_ssl_add_ca_crt_file(struct ustream_ssl_ctx *ctx, const ch
{
int ret;
-#ifdef USE_VERSION_1_3
ret = x509_crt_parse_file(&ctx->ca_cert, file);
-#else
- ret = x509parse_crtfile(&ctx->ca_cert, file);
-#endif
if (ret)
return -1;
@@ -127,11 +119,7 @@ __hidden int __ustream_ssl_set_crt_file(struct ustream_ssl_ctx *ctx, const char
{
int ret;
-#ifdef USE_VERSION_1_3
ret = x509_crt_parse_file(&ctx->cert, file);
-#else
- ret = x509parse_crtfile(&ctx->cert, file);
-#endif
if (ret)
return -1;
@@ -142,11 +130,7 @@ __hidden int __ustream_ssl_set_key_file(struct ustream_ssl_ctx *ctx, const char
{
int ret;
-#ifdef USE_VERSION_1_3
ret = pk_parse_keyfile(&ctx->key, file, NULL);
-#else
- ret = x509parse_keyfile(&ctx->key, file, NULL);
-#endif
if (ret)
return -1;
@@ -155,13 +139,8 @@ __hidden int __ustream_ssl_set_key_file(struct ustream_ssl_ctx *ctx, const char
__hidden void __ustream_ssl_context_free(struct ustream_ssl_ctx *ctx)
{
-#ifdef USE_VERSION_1_3
pk_free(&ctx->key);
x509_crt_free(&ctx->cert);
-#else
- rsa_free(&ctx->key);
- x509_free(&ctx->cert);
-#endif
free(ctx);
}
diff --git a/ustream-polarssl.h b/ustream-polarssl.h
index 3265472..3c4a5ed 100644
--- a/ustream-polarssl.h
+++ b/ustream-polarssl.h
@@ -28,18 +28,8 @@
#include <polarssl/version.h>
#include <polarssl/entropy.h>
-#if POLARSSL_VERSION_MAJOR > 1 || POLARSSL_VERSION_MINOR >= 3
-#define USE_VERSION_1_3
-#else
-#define x509_crt x509_cert
-#endif
-
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;