evp.h will be moved to evp_locl.h in an upcoming bump.
ok inoguchi
-/* $OpenBSD: a_pkey.c,v 1.1 2021/12/04 15:38:10 jsing Exp $ */
+/* $OpenBSD: a_pkey.c,v 1.2 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
EVP_PKEY *
d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length)
-/* $OpenBSD: a_pubkey.c,v 1.1 2021/12/04 15:38:10 jsing Exp $ */
+/* $OpenBSD: a_pubkey.c,v 1.2 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
EVP_PKEY *
d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length)
{
-/* $OpenBSD: a_sign.c,v 1.23 2017/05/02 03:59:44 deraadt Exp $ */
+/* $OpenBSD: a_sign.c,v 1.24 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
int
ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
-/* $OpenBSD: a_verify.c,v 1.24 2017/05/02 03:59:44 deraadt Exp $ */
+/* $OpenBSD: a_verify.c,v 1.25 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
int
ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
-/* $OpenBSD: ameth_lib.c,v 1.22 2021/12/03 14:18:06 tb Exp $ */
+/* $OpenBSD: ameth_lib.c,v 1.23 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[];
extern const EVP_PKEY_ASN1_METHOD rsa_pss_asn1_meth;
-/* $OpenBSD: asn_mime.c,v 1.27 2017/01/29 17:49:22 beck Exp $ */
+/* $OpenBSD: asn_mime.c,v 1.28 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
/* Generalised MIME like utilities for streaming ASN1. Although many
* have a PKCS7/CMS like flavour others are more general purpose.
-/* $OpenBSD: n_pkey.c,v 1.33 2021/11/01 20:53:08 tb Exp $ */
+/* $OpenBSD: n_pkey.c,v 1.34 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
#ifndef OPENSSL_NO_RC4
-/* $OpenBSD: p5_pbev2.c,v 1.25 2017/01/29 17:49:22 beck Exp $ */
+/* $OpenBSD: p5_pbev2.c,v 1.26 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999-2004.
*/
#include <openssl/err.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
/* PKCS#5 v2.0 password based encryption structures */
static const ASN1_TEMPLATE PBE2PARAM_seq_tt[] = {
-/* $OpenBSD: x_pubkey.c,v 1.29 2021/12/03 16:46:50 jsing Exp $ */
+/* $OpenBSD: x_pubkey.c,v 1.30 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
#include "x509_lcl.h"
/* Minor tweak to operation: free up EVP_PKEY */
-/* $OpenBSD: cm_ameth.c,v 1.7 2014/07/12 16:03:37 miod Exp $ */
+/* $OpenBSD: cm_ameth.c,v 1.8 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2010.
*/
#include <openssl/evp.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
/* CMAC "ASN1" method. This is just here to indicate the
* maximum CMAC output length and to free up a CMAC
-/* $OpenBSD: cmac.c,v 1.10 2015/09/10 15:56:25 jsing Exp $ */
+/* $OpenBSD: cmac.c,v 1.11 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
#include <openssl/cmac.h>
+#include "evp_locl.h"
+
struct CMAC_CTX_st {
/* Cipher context to use */
EVP_CIPHER_CTX cctx;
-/* $OpenBSD: dh_ameth.c,v 1.18 2020/01/04 13:57:43 inoguchi Exp $ */
+/* $OpenBSD: dh_ameth.c,v 1.19 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
static void
int_dh_free(EVP_PKEY *pkey)
-/* $OpenBSD: dsa_ameth.c,v 1.28 2019/11/01 15:15:35 jsing Exp $ */
+/* $OpenBSD: dsa_ameth.c,v 1.29 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
#include "asn1_locl.h"
#include "bn_lcl.h"
+#include "evp_locl.h"
static int
dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
-/* $OpenBSD: ec_ameth.c,v 1.28 2019/09/09 20:26:16 tb Exp $ */
+/* $OpenBSD: ec_ameth.c,v 1.29 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
#ifndef OPENSSL_NO_CMS
static int ecdh_cms_decrypt(CMS_RecipientInfo *ri);
-/* $OpenBSD: eng_openssl.c,v 1.13 2018/04/14 07:18:37 tb Exp $ */
+/* $OpenBSD: eng_openssl.c,v 1.14 2021/12/12 21:30:13 tb Exp $ */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
/* This testing gunk is implemented (and explained) lower down. It also assumes
* the application explicitly calls "ENGINE_load_openssl()" because this is no
* longer automatic in ENGINE_load_builtin_engines(). */
-/* $OpenBSD: bio_b64.c,v 1.22 2018/08/24 19:47:25 tb Exp $ */
+/* $OpenBSD: bio_b64.c,v 1.23 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/buffer.h>
#include <openssl/evp.h>
+#include "evp_locl.h"
+
static int b64_write(BIO *h, const char *buf, int num);
static int b64_read(BIO *h, char *buf, int size);
static int b64_puts(BIO *h, const char *str);
-/* $OpenBSD: bio_enc.c,v 1.23 2021/12/01 09:06:30 jsing Exp $ */
+/* $OpenBSD: bio_enc.c,v 1.24 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/buffer.h>
#include <openssl/evp.h>
+#include "evp_locl.h"
+
static int enc_write(BIO *h, const char *buf, int num);
static int enc_read(BIO *h, char *buf, int size);
/*static int enc_puts(BIO *h, const char *str); */
-/* $OpenBSD: bio_md.c,v 1.15 2018/05/02 15:51:41 tb Exp $ */
+/* $OpenBSD: bio_md.c,v 1.16 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/buffer.h>
#include <openssl/evp.h>
+#include "evp_locl.h"
+
/* BIO_put and BIO_get both add to the digest,
* BIO_gets returns the digest */
-/* $OpenBSD: digest.c,v 1.31 2019/04/19 17:04:45 jsing Exp $ */
+/* $OpenBSD: digest.c,v 1.32 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/engine.h>
#endif
+#include "evp_locl.h"
+
int
EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
{
-/* $OpenBSD: e_aes_cbc_hmac_sha1.c,v 1.15 2019/04/03 15:33:37 tb Exp $ */
+/* $OpenBSD: e_aes_cbc_hmac_sha1.c,v 1.16 2021/12/12 21:30:13 tb Exp $ */
/* ====================================================================
* Copyright (c) 2011-2013 The OpenSSL Project. All rights reserved.
*
#include <openssl/objects.h>
#include <openssl/aes.h>
#include <openssl/sha.h>
-#include "evp_locl.h"
+
#include "constant_time_locl.h"
+#include "evp_locl.h"
#define TLS1_1_VERSION 0x0302
-/* $OpenBSD: e_camellia.c,v 1.8 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: e_camellia.c,v 1.9 2021/12/12 21:30:13 tb Exp $ */
/* ====================================================================
* Copyright (c) 2006 The OpenSSL Project. All rights reserved.
*
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/camellia.h>
+
#include "evp_locl.h"
static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-/* $OpenBSD: e_gost2814789.c,v 1.4 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: e_gost2814789.c,v 1.5 2021/12/12 21:30:13 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*/
+
#include <string.h>
#include <openssl/opensslconf.h>
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/gost.h>
+
#include "evp_locl.h"
typedef struct {
-/* $OpenBSD: e_null.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
+/* $OpenBSD: e_null.c,v 1.15 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/evp.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
+
static int null_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc);
static int null_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-/* $OpenBSD: e_rc4_hmac_md5.c,v 1.8 2017/01/31 13:17:21 inoguchi Exp $ */
+/* $OpenBSD: e_rc4_hmac_md5.c,v 1.9 2021/12/12 21:30:13 tb Exp $ */
/* ====================================================================
* Copyright (c) 2011 The OpenSSL Project. All rights reserved.
*
#include <openssl/rc4.h>
#include <openssl/md5.h>
+#include "evp_locl.h"
+
/* FIXME: surely this is available elsewhere? */
#define EVP_RC4_KEY_SIZE 16
-/* $OpenBSD: encode.c,v 1.28 2020/03/04 11:53:21 inoguchi Exp $ */
+/* $OpenBSD: encode.c,v 1.29 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/evp.h>
+#include "evp_locl.h"
+
static unsigned char conv_ascii2bin(unsigned char a);
#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
-/* $OpenBSD: evp_key.c,v 1.26 2018/08/14 17:59:26 tb Exp $ */
+/* $OpenBSD: evp_key.c,v 1.27 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/ui.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
/* should be init to zeros. */
static char prompt_string[80];
-/* $OpenBSD: evp_lib.c,v 1.18 2021/10/24 13:51:07 tb Exp $ */
+/* $OpenBSD: evp_lib.c,v 1.19 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/evp.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
+
int
EVP_CIPHER_param_to_asn1(EVP_CIPHER_CTX *c, ASN1_TYPE *type)
{
-/* $OpenBSD: evp_pkey.c,v 1.23 2018/08/24 20:26:03 tb Exp $ */
+/* $OpenBSD: evp_pkey.c,v 1.24 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
/* Extract a private key from a PKCS8 structure */
-/* $OpenBSD: m_dss.c,v 1.16 2014/07/11 08:44:48 jsing Exp $ */
+/* $OpenBSD: m_dss.c,v 1.17 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/dsa.h>
#endif
+#include "evp_locl.h"
+
#ifndef OPENSSL_NO_SHA
static int
-/* $OpenBSD: m_dss1.c,v 1.16 2014/07/11 08:44:48 jsing Exp $ */
+/* $OpenBSD: m_dss1.c,v 1.17 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/dsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_ecdsa.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
+/* $OpenBSD: m_ecdsa.c,v 1.9 2021/12/12 21:30:13 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
*
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
#ifndef OPENSSL_NO_SHA
static int
-/* $OpenBSD: m_gost2814789.c,v 1.2 2014/11/09 23:06:50 miod Exp $ */
+/* $OpenBSD: m_gost2814789.c,v 1.3 2021/12/12 21:30:13 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*/
+
#include <openssl/opensslconf.h>
#ifndef OPENSSL_NO_GOST
#include <openssl/gost.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
+
static int
gost2814789_init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_gostr341194.c,v 1.2 2014/11/09 23:06:50 miod Exp $ */
+/* $OpenBSD: m_gostr341194.c,v 1.3 2021/12/12 21:30:13 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*/
+
#include <stdio.h>
#include <openssl/opensslconf.h>
#include <openssl/gost.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
+
static int
gostr341194_init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_md4.c,v 1.16 2015/09/14 01:45:03 doug Exp $ */
+/* $OpenBSD: m_md4.c,v 1.17 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_md5.c,v 1.15 2014/07/13 09:30:02 miod Exp $ */
+/* $OpenBSD: m_md5.c,v 1.16 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_md5_sha1.c,v 1.2 2018/08/10 17:30:29 jsing Exp $ */
+/* $OpenBSD: m_md5_sha1.c,v 1.3 2021/12/12 21:30:13 tb Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
struct md5_sha1_ctx {
MD5_CTX md5;
SHA_CTX sha1;
-/* $OpenBSD: m_null.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
+/* $OpenBSD: m_null.c,v 1.10 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_ripemd.c,v 1.12 2014/07/13 09:30:02 miod Exp $ */
+/* $OpenBSD: m_ripemd.c,v 1.13 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_sha1.c,v 1.17 2014/07/11 08:44:48 jsing Exp $ */
+/* $OpenBSD: m_sha1.c,v 1.18 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_sm3.c,v 1.1 2018/11/11 06:53:31 tb Exp $ */
+/* $OpenBSD: m_sm3.c,v 1.2 2021/12/12 21:30:13 tb Exp $ */
/*
* Copyright (c) 2018, Ribose Inc
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
sm3_init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_streebog.c,v 1.2 2014/11/09 23:06:50 miod Exp $ */
+/* $OpenBSD: m_streebog.c,v 1.3 2021/12/12 21:30:13 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
#include <openssl/gost.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
+
static int
streebog_init256(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: m_wp.c,v 1.8 2014/07/13 09:30:02 miod Exp $ */
+/* $OpenBSD: m_wp.c,v 1.9 2021/12/12 21:30:13 tb Exp $ */
#include <stdio.h>
#include <openssl/x509.h>
#include <openssl/whrlpool.h>
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
-/* $OpenBSD: names.c,v 1.14 2018/03/17 16:20:01 beck Exp $ */
+/* $OpenBSD: names.c,v 1.15 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
int
EVP_add_cipher(const EVP_CIPHER *c)
{
-/* $OpenBSD: p5_crpt.c,v 1.19 2020/01/12 07:11:13 inoguchi Exp $ */
+/* $OpenBSD: p5_crpt.c,v 1.20 2021/12/12 21:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
#include <openssl/evp.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
/* Doesn't do anything now: Builtin PBE algorithms in static table.
*/
-/* $OpenBSD: p_dec.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: p_dec.c,v 1.12 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
int
EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
EVP_PKEY *priv)
-/* $OpenBSD: p_enc.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: p_enc.c,v 1.12 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
int
EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len,
EVP_PKEY *pubk)
-/* $OpenBSD: p_lib.c,v 1.26 2021/03/29 15:57:23 tb Exp $ */
+/* $OpenBSD: p_lib.c,v 1.27 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
static void EVP_PKEY_free_it(EVP_PKEY *x);
-/* $OpenBSD: p_open.c,v 1.19 2017/05/02 03:59:44 deraadt Exp $ */
+/* $OpenBSD: p_open.c,v 1.20 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
int
EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
const unsigned char *ek, int ekl, const unsigned char *iv, EVP_PKEY *priv)
-/* $OpenBSD: p_sign.c,v 1.14 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: p_sign.c,v 1.15 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
int
EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen,
EVP_PKEY *pkey)
-/* $OpenBSD: p_verify.c,v 1.13 2017/01/29 17:49:23 beck Exp $ */
+/* $OpenBSD: p_verify.c,v 1.14 2021/12/12 21:30:13 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
int
EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf,
unsigned int siglen, EVP_PKEY *pkey)
-/* $OpenBSD: gost89imit_ameth.c,v 1.2 2014/11/09 23:06:52 miod Exp $ */
+/* $OpenBSD: gost89imit_ameth.c,v 1.3 2021/12/12 21:30:14 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
#include <openssl/evp.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
static void
mackey_free_gost(EVP_PKEY *pk)
-/* $OpenBSD: gostr341001_ameth.c,v 1.17 2021/04/20 17:16:38 tb Exp $ */
+/* $OpenBSD: gostr341001_ameth.c,v 1.18 2021/12/12 21:30:14 tb Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Copyright (c) 2005-2006 Cryptocom LTD
#include "asn1_locl.h"
+#include "evp_locl.h"
#include "gost_locl.h"
#include "gost_asn1.h"
-/* $OpenBSD: hkdf.c,v 1.6 2021/12/12 21:27:37 tb Exp $ */
+/* $OpenBSD: hkdf.c,v 1.7 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (c) 2014, Google Inc.
*
* Permission to use, copy, modify, and/or distribute this software for any
#include <openssl/err.h>
#include <openssl/hmac.h>
+#include "evp_locl.h"
#include "hmac_local.h"
/* https://tools.ietf.org/html/rfc5869#section-2 */
-/* $OpenBSD: hm_ameth.c,v 1.11 2021/12/12 21:27:38 tb Exp $ */
+/* $OpenBSD: hm_ameth.c,v 1.12 2021/12/12 21:30:14 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2007.
*/
#include <openssl/hmac.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
#include "hmac_local.h"
#define HMAC_TEST_PRIVATE_KEY_FORMAT
-/* $OpenBSD: hmac.c,v 1.26 2021/12/12 21:27:38 tb Exp $ */
+/* $OpenBSD: hmac.c,v 1.27 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/err.h>
#include <openssl/hmac.h>
+#include "evp_locl.h"
#include "hmac_local.h"
int
-/* $OpenBSD: pem_info.c,v 1.24 2020/07/25 11:53:37 schwarze Exp $ */
+/* $OpenBSD: pem_info.c,v 1.25 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
STACK_OF(X509_INFO) *
PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb,
void *u)
-/* $OpenBSD: pem_lib.c,v 1.49 2019/09/06 17:41:05 jsing Exp $ */
+/* $OpenBSD: pem_lib.c,v 1.50 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
#define MIN_LENGTH 4
-/* $OpenBSD: pem_pkey.c,v 1.23 2017/05/02 03:59:44 deraadt Exp $ */
+/* $OpenBSD: pem_pkey.c,v 1.24 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
int pem_check_suffix(const char *pem_str, const char *suffix);
-/* $OpenBSD: pvkfmt.c,v 1.22 2019/07/08 11:56:18 inoguchi Exp $ */
+/* $OpenBSD: pvkfmt.c,v 1.23 2021/12/12 21:30:14 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2005.
*/
#include <openssl/rsa.h>
#include "bn_lcl.h"
+#include "evp_locl.h"
/* Utility function: read a DWORD (4 byte unsigned integer) in little endian
* format
-/* $OpenBSD: p12_decr.c,v 1.20 2021/07/09 14:08:00 tb Exp $ */
+/* $OpenBSD: p12_decr.c,v 1.21 2021/12/12 21:30:14 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
#include <openssl/err.h>
#include <openssl/pkcs12.h>
+#include "evp_locl.h"
+
/* Encrypt/Decrypt a buffer based on password and algor, result in a
* malloc'ed buffer
*/
-/* $OpenBSD: p12_key.c,v 1.27 2021/07/09 14:08:00 tb Exp $ */
+/* $OpenBSD: p12_key.c,v 1.28 2021/12/12 21:30:14 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
#include <openssl/err.h>
#include <openssl/pkcs12.h>
+#include "evp_locl.h"
+
/* PKCS12 compatible key/IV generation */
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
-/* $OpenBSD: p12_mutl.c,v 1.26 2021/12/12 21:27:38 tb Exp $ */
+/* $OpenBSD: p12_mutl.c,v 1.27 2021/12/12 21:30:14 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
#include <openssl/hmac.h>
#include <openssl/pkcs12.h>
+#include "evp_locl.h"
#include "hmac_local.h"
#include "x509_lcl.h"
-/* $OpenBSD: pk7_doit.c,v 1.45 2021/11/01 20:53:08 tb Exp $ */
+/* $OpenBSD: pk7_doit.c,v 1.46 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/x509.h>
#include <openssl/x509v3.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
static int add_attribute(STACK_OF(X509_ATTRIBUTE) **sk, int nid, int atrtype,
-/* $OpenBSD: pk7_lib.c,v 1.22 2021/11/01 20:53:08 tb Exp $ */
+/* $OpenBSD: pk7_lib.c,v 1.23 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
#include "x509_lcl.h"
long
-/* $OpenBSD: rsa_oaep.c,v 1.33 2019/10/17 14:31:56 jsing Exp $ */
+/* $OpenBSD: rsa_oaep.c,v 1.34 2021/12/12 21:30:14 tb Exp $ */
/*
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
*
#include <openssl/sha.h>
#include "constant_time_locl.h"
+#include "evp_locl.h"
#include "rsa_locl.h"
int
-/* $OpenBSD: rsa_pss.c,v 1.13 2018/09/05 00:55:33 djm Exp $ */
+/* $OpenBSD: rsa_pss.c,v 1.14 2021/12/12 21:30:14 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2005.
*/
#include <openssl/rsa.h>
#include <openssl/sha.h>
+#include "evp_locl.h"
+
static const unsigned char zeroes[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
int
-/* $OpenBSD: ts_rsp_sign.c,v 1.25 2021/11/04 23:52:34 beck Exp $ */
+/* $OpenBSD: ts_rsp_sign.c,v 1.26 2021/12/12 21:30:14 tb Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
* project 2002.
*/
#include <openssl/pkcs7.h>
#include <openssl/ts.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
/* Private function declarations. */
-/* $OpenBSD: ts_rsp_verify.c,v 1.23 2021/11/04 23:52:34 beck Exp $ */
+/* $OpenBSD: ts_rsp_verify.c,v 1.24 2021/12/12 21:30:14 tb Exp $ */
/* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL
* project 2002.
*/
#include <openssl/pkcs7.h>
#include <openssl/ts.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
/* Private function declarations. */
-/* $OpenBSD: x509_cmp.c,v 1.37 2021/11/04 23:52:34 beck Exp $ */
+/* $OpenBSD: x509_cmp.c,v 1.38 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/x509.h>
#include <openssl/x509v3.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
int
-/* $OpenBSD: x509_req.c,v 1.26 2021/11/03 13:27:28 schwarze Exp $ */
+/* $OpenBSD: x509_req.c,v 1.27 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/pem.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
X509_REQ *
-/* $OpenBSD: x509type.c,v 1.14 2021/11/01 20:53:08 tb Exp $ */
+/* $OpenBSD: x509type.c,v 1.15 2021/12/12 21:30:14 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
int