X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;ds=sidebyside;f=src%2Fopenssl%2Fecdsa.c;h=02adeb62fad6e2f9741413c64d2226f5a7dd263e;hb=a7458f6dfd86dd345b43690ef977dc034f550e68;hp=bca89fc5623719e77d69b93a77206124be84dfcb;hpb=22d804d4467cfe9f3926ab6d37b69c3760395b6c;p=tinc diff --git a/src/openssl/ecdsa.c b/src/openssl/ecdsa.c index bca89fc5..02adeb62 100644 --- 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 "brainpool.h" + // 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) { - 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; } + EC_KEY_set_group(ecdsa, brainpoolp512r1); + int len = strlen(p); unsigned char pubkey[len / 4 * 3 + 3]; const unsigned char *ppubkey = pubkey;