projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace pointers to cipher_t/digest_t in connection_t with structs.
[tinc]
/
src
/
openssl
/
rsa.c
diff --git
a/src/openssl/rsa.c
b/src/openssl/rsa.c
index
0e81172
..
e7428ad
100644
(file)
--- a/
src/openssl/rsa.c
+++ b/
src/openssl/rsa.c
@@
-1,6
+1,6
@@
/*
rsa.c -- RSA key handling
/*
rsa.c -- RSA key handling
- Copyright (C) 2007-20
13
Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2007-20
21
Guus Sliepen <guus@tinc-vpn.org>
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
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 <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/pem.h>
#include <openssl/err.h>
+#include <openssl/rsa.h>
#define TINC_RSA_INTERNAL
typedef RSA rsa_t;
#define TINC_RSA_INTERNAL
typedef RSA rsa_t;
@@
-30,18
+31,6
@@
typedef RSA rsa_t;
// Set RSA keys
// 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;
rsa_t *rsa_set_hex_public_key(char *n, char *e) {
BIGNUM *bn_n = NULL;
BIGNUM *bn_e = NULL;
@@
-113,12
+102,12
@@
rsa_t *rsa_read_pem_private_key(FILE *fp) {
return rsa;
}
return rsa;
}
-size_t rsa_size(rsa_t *rsa) {
+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) {
return RSA_size(rsa);
}
bool rsa_public_encrypt(rsa_t *rsa, void *in, size_t len, void *out) {
- if((size_t)RSA_public_encrypt(len, in, out, rsa, RSA_NO_PADDING) == len) {
+ if((size_t)RSA_public_encrypt(
(int)
len, in, out, rsa, RSA_NO_PADDING) == len) {
return true;
}
return true;
}
@@
-127,7
+116,7
@@
bool rsa_public_encrypt(rsa_t *rsa, void *in, size_t len, void *out) {
}
bool rsa_private_decrypt(rsa_t *rsa, void *in, size_t len, void *out) {
}
bool rsa_private_decrypt(rsa_t *rsa, void *in, size_t len, void *out) {
- if((size_t)RSA_private_decrypt(len, in, out, rsa, RSA_NO_PADDING) == len) {
+ if((size_t)RSA_private_decrypt(
(int)
len, in, out, rsa, RSA_NO_PADDING) == len) {
return true;
}
return true;
}
@@
-135,10
+124,6
@@
bool rsa_private_decrypt(rsa_t *rsa, void *in, size_t len, void *out) {
return false;
}
return false;
}
-bool rsa_active(rsa_t *rsa) {
- return rsa;
-}
-
void rsa_free(rsa_t *rsa) {
if(rsa) {
RSA_free(rsa);
void rsa_free(rsa_t *rsa) {
if(rsa) {
RSA_free(rsa);