X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fopenssl%2Frsa.c;h=d50ba1d7ad39c41be455ced0e3e0829ef6f267b1;hb=28b7a53b6;hp=e7428add874f8435e5d6a9533f0c6380e9fef97a;hpb=0912276c6467aa3ee6f570b31245367319da572a;p=tinc diff --git a/src/openssl/rsa.c b/src/openssl/rsa.c index e7428add..d50ba1d7 100644 --- a/src/openssl/rsa.c +++ b/src/openssl/rsa.c @@ -1,6 +1,6 @@ /* rsa.c -- RSA key handling - Copyright (C) 2007-2021 Guus Sliepen + Copyright (C) 2007-2022 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 @@ -31,7 +31,7 @@ typedef RSA rsa_t; // Set RSA keys -rsa_t *rsa_set_hex_public_key(char *n, char *e) { +rsa_t *rsa_set_hex_public_key(const char *n, const char *e) { BIGNUM *bn_n = NULL; BIGNUM *bn_e = NULL; @@ -52,7 +52,7 @@ rsa_t *rsa_set_hex_public_key(char *n, char *e) { return rsa; } -rsa_t *rsa_set_hex_private_key(char *n, char *e, char *d) { +rsa_t *rsa_set_hex_private_key(const char *n, const char *e, const char *d) { BIGNUM *bn_n = NULL; BIGNUM *bn_e = NULL; BIGNUM *bn_d = NULL; @@ -106,7 +106,7 @@ size_t rsa_size(const rsa_t *rsa) { return RSA_size(rsa); } -bool rsa_public_encrypt(rsa_t *rsa, void *in, size_t len, void *out) { +bool rsa_public_encrypt(rsa_t *rsa, const void *in, size_t len, void *out) { if((size_t)RSA_public_encrypt((int) len, in, out, rsa, RSA_NO_PADDING) == len) { return true; } @@ -115,7 +115,7 @@ bool rsa_public_encrypt(rsa_t *rsa, void *in, size_t len, void *out) { return false; } -bool rsa_private_decrypt(rsa_t *rsa, void *in, size_t len, void *out) { +bool rsa_private_decrypt(rsa_t *rsa, const void *in, size_t len, void *out) { if((size_t)RSA_private_decrypt((int) len, in, out, rsa, RSA_NO_PADDING) == len) { return true; }