From f0ca6b40da78dfadbe7cf3ff4085924f29f35db8 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 30 Nov 2022 12:42:24 +0000 Subject: [PATCH] Switch idiom of d2i_ECDSA_SIG() invocation Instead of the discouraged obj = NULL; d2i_ECDSA_SIG(&obj, ...); use the recommended obj = d2i_ECDSA_SIG(NULL, ...);. While it makes no difference here, it's better practice. suggested by & ok markus --- sbin/iked/crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/iked/crypto.c b/sbin/iked/crypto.c index b8327f33e9e..50ee2757197 100644 --- a/sbin/iked/crypto.c +++ b/sbin/iked/crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.c,v 1.40 2022/11/07 22:39:52 tobhe Exp $ */ +/* $OpenBSD: crypto.c,v 1.41 2022/11/30 12:42:24 tb Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter @@ -1057,7 +1057,7 @@ _dsa_sign_ecdsa(struct iked_dsa *dsa, uint8_t *ptr, size_t len) if (EVP_DigestSignFinal(dsa->dsa_ctx, tmp, &tmplen) != 1) goto done; p = tmp; - if (d2i_ECDSA_SIG(&obj, &p, tmplen) == NULL) + if ((obj = d2i_ECDSA_SIG(NULL, &p, tmplen)) == NULL) goto done; ECDSA_SIG_get0(obj, &r, &s); if (BN_num_bytes(r) > bnlen || BN_num_bytes(s) > bnlen) -- 2.20.1