From 936a262e7549d44f8f559e1367e75d94866ce958 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 25 Dec 2023 22:41:50 +0000 Subject: [PATCH] Move EVP_PKEY_assign() a bit up and tweak it slightly ok jsing --- lib/libcrypto/evp/p_lib.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c index 2e78d7e5cda..f92684fdd75 100644 --- a/lib/libcrypto/evp/p_lib.c +++ b/lib/libcrypto/evp/p_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p_lib.c,v 1.49 2023/12/25 21:55:31 tb Exp $ */ +/* $OpenBSD: p_lib.c,v 1.50 2023/12/25 22:41:50 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -278,6 +278,15 @@ EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len) return 1; } +int +EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) +{ + if (!EVP_PKEY_set_type(pkey, type)) + return 0; + + return (pkey->pkey.ptr = key) != NULL; +} + EVP_PKEY * EVP_PKEY_new_raw_private_key(int type, ENGINE *engine, const unsigned char *private_key, size_t len) @@ -399,15 +408,6 @@ EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv, size_t len, return NULL; } -int -EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) -{ - if (!EVP_PKEY_set_type(pkey, type)) - return 0; - pkey->pkey.ptr = key; - return (key != NULL); -} - void * EVP_PKEY_get0(const EVP_PKEY *pkey) { -- 2.20.1