projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the brainpoolp512r1 curve and use it.
[tinc]
/
src
/
openssl
/
ecdsa.c
diff --git
a/src/openssl/ecdsa.c
b/src/openssl/ecdsa.c
index
bca89fc
..
02adeb6
100644
(file)
--- a/
src/openssl/ecdsa.c
+++ b/
src/openssl/ecdsa.c
@@
-30,15
+30,19
@@
typedef EC_KEY ecdsa_t;
#include "../utils.h"
#include "../xalloc.h"
#include "../utils.h"
#include "../xalloc.h"
+#include "brainpool.h"
+
// Get and set ECDSA keys
//
ecdsa_t *ecdsa_set_base64_public_key(const char *p) {
// Get and set ECDSA keys
//
ecdsa_t *ecdsa_set_base64_public_key(const char *p) {
- ecdsa_t *ecdsa = EC_KEY_new
_by_curve_name(NID_secp521r1
);
+ ecdsa_t *ecdsa = EC_KEY_new
(
);
if(!ecdsa) {
if(!ecdsa) {
- logger(DEBUG_ALWAYS, LOG_DEBUG, "
EC_KEY_new_by_curve_name
failed: %s", ERR_error_string(ERR_get_error(), NULL));
+ logger(DEBUG_ALWAYS, LOG_DEBUG, "
Allocating EC key
failed: %s", ERR_error_string(ERR_get_error(), NULL));
return NULL;
}
return NULL;
}
+ EC_KEY_set_group(ecdsa, brainpoolp512r1);
+
int len = strlen(p);
unsigned char pubkey[len / 4 * 3 + 3];
const unsigned char *ppubkey = pubkey;
int len = strlen(p);
unsigned char pubkey[len / 4 * 3 + 3];
const unsigned char *ppubkey = pubkey;