projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add cleanup hook for integration tests
[tinc]
/
src
/
openssl
/
rsa.c
diff --git
a/src/openssl/rsa.c
b/src/openssl/rsa.c
index
e1ae4f6
..
f8ec6d5
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;
@@
-46,7
+47,7
@@
rsa_t *rsa_set_hex_public_key(char *n, char *e) {
BIGNUM *bn_n = NULL;
BIGNUM *bn_e = NULL;
BIGNUM *bn_n = NULL;
BIGNUM *bn_e = NULL;
- if(
BN_hex2bn(&bn_n, n) != strlen(n) ||
BN_hex2bn(&bn_e, e) != strlen(e)) {
+ if(
(size_t)BN_hex2bn(&bn_n, n) != strlen(n) || (size_t)
BN_hex2bn(&bn_e, e) != strlen(e)) {
BN_free(bn_e);
BN_free(bn_n);
return false;
BN_free(bn_e);
BN_free(bn_n);
return false;
@@
-68,7
+69,7
@@
rsa_t *rsa_set_hex_private_key(char *n, char *e, char *d) {
BIGNUM *bn_e = NULL;
BIGNUM *bn_d = NULL;
BIGNUM *bn_e = NULL;
BIGNUM *bn_d = NULL;
- if(
BN_hex2bn(&bn_n, n) != strlen(n) || BN_hex2bn(&bn_e, e) != strlen(e) ||
BN_hex2bn(&bn_d, d) != strlen(d)) {
+ if(
(size_t)BN_hex2bn(&bn_n, n) != strlen(n) || (size_t)BN_hex2bn(&bn_e, e) != strlen(e) || (size_t)
BN_hex2bn(&bn_d, d) != strlen(d)) {
BN_free(bn_d);
BN_free(bn_e);
BN_free(bn_n);
BN_free(bn_d);
BN_free(bn_e);
BN_free(bn_n);
@@
-118,7
+119,7
@@
size_t rsa_size(rsa_t *rsa) {
}
bool rsa_public_encrypt(rsa_t *rsa, void *in, size_t len, void *out) {
}
bool rsa_public_encrypt(rsa_t *rsa, void *in, size_t len, void *out) {
- if(RSA_public_encrypt(len, in, out, rsa, RSA_NO_PADDING) == len) {
+ if(
(size_t)
RSA_public_encrypt(len, in, out, rsa, RSA_NO_PADDING) == len) {
return true;
}
return true;
}
@@
-127,7
+128,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(RSA_private_decrypt(len, in, out, rsa, RSA_NO_PADDING) == len) {
+ if(
(size_t)
RSA_private_decrypt(len, in, out, rsa, RSA_NO_PADDING) == len) {
return true;
}
return true;
}