projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Send broadcast packets using a random socket, and properly support IPv6.
[tinc]
/
src
/
openssl
/
ecdsa.c
diff --git
a/src/openssl/ecdsa.c
b/src/openssl/ecdsa.c
index
a2c7deb
..
e2af6f9
100644
(file)
--- a/
src/openssl/ecdsa.c
+++ b/
src/openssl/ecdsa.c
@@
-1,6
+1,6
@@
/*
ecdsa.c -- ECDSA key handling
/*
ecdsa.c -- ECDSA key handling
- Copyright (C) 2011 Guus Sliepen <guus@tinc-vpn.org>
+ Copyright (C) 2011
-2012
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
@@
-30,6
+30,10
@@
//
bool ecdsa_set_base64_public_key(ecdsa_t *ecdsa, const char *p) {
*ecdsa = EC_KEY_new_by_curve_name(NID_secp521r1);
//
bool ecdsa_set_base64_public_key(ecdsa_t *ecdsa, const char *p) {
*ecdsa = EC_KEY_new_by_curve_name(NID_secp521r1);
+ if(!*ecdsa) {
+ logger(DEBUG_ALWAYS, LOG_DEBUG, "EC_KEY_new_by_curve_name failed: %s", ERR_error_string(ERR_get_error(), NULL));
+ return false;
+ }
int len = strlen(p);
unsigned char pubkey[len / 4 * 3 + 3];
int len = strlen(p);
unsigned char pubkey[len / 4 * 3 + 3];
@@
-73,7
+77,7
@@
bool ecdsa_read_pem_private_key(ecdsa_t *ecdsa, FILE *fp) {
if(*ecdsa)
return true;
if(*ecdsa)
return true;
-
+
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read ECDSA private key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to read ECDSA private key: %s", ERR_error_string(ERR_get_error(), NULL));
return false;
}