X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fopenssl%2Frsa.c;h=5d3fe06240aed165222eee6780a8ef0ec62fb140;hb=ee03e05ebea39f8d30db87710985c729f7b8bc25;hp=0e811722038145e4662084bca3ae5c97acba8596;hpb=1c475ecb575367a6b3f9328b0f643ad636155341;p=tinc diff --git a/src/openssl/rsa.c b/src/openssl/rsa.c index 0e811722..5d3fe062 100644 --- a/src/openssl/rsa.c +++ b/src/openssl/rsa.c @@ -1,6 +1,6 @@ /* rsa.c -- RSA key handling - Copyright (C) 2007-2013 Guus Sliepen + Copyright (C) 2007-2021 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,6 +21,7 @@ #include #include +#include #define TINC_RSA_INTERNAL typedef RSA rsa_t; @@ -30,18 +31,6 @@ typedef RSA rsa_t; // Set RSA keys -#ifndef HAVE_RSA_SET0_KEY -int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) { - BN_free(r->n); - r->n = n; - BN_free(r->e); - r->e = e; - BN_free(r->d); - r->d = d; - return 1; -} -#endif - rsa_t *rsa_set_hex_public_key(char *n, char *e) { BIGNUM *bn_n = NULL; BIGNUM *bn_e = NULL; @@ -113,7 +102,7 @@ rsa_t *rsa_read_pem_private_key(FILE *fp) { return rsa; } -size_t rsa_size(rsa_t *rsa) { +size_t rsa_size(const rsa_t *rsa) { return RSA_size(rsa); } @@ -135,10 +124,6 @@ bool rsa_private_decrypt(rsa_t *rsa, void *in, size_t len, void *out) { return false; } -bool rsa_active(rsa_t *rsa) { - return rsa; -} - void rsa_free(rsa_t *rsa) { if(rsa) { RSA_free(rsa);