summary refs log tree commit diff
path: root/tls_signer.c
diff options
context:
space:
mode:
Diffstat (limited to 'tls_signer.c')
-rw-r--r--tls_signer.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/tls_signer.c b/tls_signer.c
index 1f11096..9311cfe 100644
--- a/tls_signer.c
+++ b/tls_signer.c
@@ -16,6 +16,7 @@
  */
 
 #include <limits.h>
+#include <string.h>
 
 #include <openssl/ecdsa.h>
 #include <openssl/err.h>
@@ -396,8 +397,8 @@ tls_ecdsa_do_sign(const unsigned char *dgst, int dgst_len, const BIGNUM *inv,
 	 * to its calling convention/signature.
 	 */
 
-	pubkey_hash = ECDSA_get_ex_data(eckey, 0);
-	config = ECDSA_get_ex_data(eckey, 1);
+	pubkey_hash = EC_KEY_get_ex_data(eckey, 0);
+	config = EC_KEY_get_ex_data(eckey, 1);
 
 	if (pubkey_hash == NULL || config == NULL)
 		goto err;
@@ -423,26 +424,21 @@ tls_ecdsa_do_sign(const unsigned char *dgst, int dgst_len, const BIGNUM *inv,
 	return (NULL);
 }
 
-ECDSA_METHOD *
+EC_KEY_METHOD *
 tls_signer_ecdsa_method(void)
 {
-	static ECDSA_METHOD *ecdsa_method = NULL;
+	static EC_KEY_METHOD *ecdsa_method = NULL;
 
 	pthread_mutex_lock(&signer_method_lock);
 
 	if (ecdsa_method != NULL)
 		goto out;
 
-	ecdsa_method = calloc(1, sizeof(*ecdsa_method));
+	ecdsa_method = EC_KEY_METHOD_new(NULL);
 	if (ecdsa_method == NULL)
 		goto out;
 
-	ecdsa_method->ecdsa_do_sign = tls_ecdsa_do_sign;
-	ecdsa_method->name = strdup("libtls ECDSA method");
-	if (ecdsa_method->name == NULL) {
-		free(ecdsa_method);
-		ecdsa_method = NULL;
-	}
+	EC_KEY_METHOD_set_sign(ecdsa_method, NULL, NULL, tls_ecdsa_do_sign);
 
  out:
 	pthread_mutex_unlock(&signer_method_lock);
roe 2021-06-10Stop accumulating ISUPPORT tokens once MOTD startsJune McEnroe This avoids duplicating tokens when a client sends VERSION and the server responds with its 005s again. 2021-06-09Use seprintf for snip, removing strlcpynJune McEnroe 2021-06-09Use seprintf for reserializeJune McEnroe 2021-06-09Use seprintf for capListJune McEnroe 2021-06-09Add seprintfJune McEnroe Based on seprint(2) from Plan 9. I'm not sure if my return value exactly matches Plan 9's in the case of truncation. seprint(2) is described only as returning a pointer to the terminating '\0', but if it does so even in the case of truncation, it is awkward for the caller to detect. This implementation returns end in the truncation case, so that (ptr == end) indicates truncation. 2021-05-27Add pounce-notify to README 2.4June McEnroe 2021-05-27Fix ENVIRONMENT formatting in pounce-notify(1)June McEnroe 2021-05-27Add note about Libera.Chat SASL-only rangesJune McEnroe 2021-05-25Add QUIRKS fileJune McEnroe 2021-05-19Replace freenode with tilde.chatJune McEnroe 2021-05-04notify: Reword pounce-notify manualJune McEnroe 2021-05-02Clean up Makefiles, configure scriptsJune McEnroe Default MANDIR to ${PREFIX}/man since it turns out man-db includes /usr/local/man by default. Add support for BINDIR. Separate libs out into LDADD variables. 2021-04-30palaver: Exit on getopt failureJune McEnroe Oops. 2021-04-30notify: Implement pounce-notifyJune McEnroe