summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/asn1/a_pkey.c3
-rw-r--r--lib/libcrypto/asn1/a_pubkey.c4
-rw-r--r--lib/libcrypto/asn1/a_sign.c3
-rw-r--r--lib/libcrypto/asn1/a_verify.c3
-rw-r--r--lib/libcrypto/asn1/ameth_lib.c3
-rw-r--r--lib/libcrypto/asn1/asn_mime.c3
-rw-r--r--lib/libcrypto/asn1/n_pkey.c3
-rw-r--r--lib/libcrypto/asn1/p5_pbev2.c4
-rw-r--r--lib/libcrypto/asn1/x_pubkey.c3
-rw-r--r--lib/libcrypto/cmac/cm_ameth.c3
-rw-r--r--lib/libcrypto/cmac/cmac.c4
-rw-r--r--lib/libcrypto/dh/dh_ameth.c3
-rw-r--r--lib/libcrypto/dsa/dsa_ameth.c3
-rw-r--r--lib/libcrypto/ec/ec_ameth.c3
-rw-r--r--lib/libcrypto/engine/eng_openssl.c4
-rw-r--r--lib/libcrypto/evp/bio_b64.c4
-rw-r--r--lib/libcrypto/evp/bio_enc.c4
-rw-r--r--lib/libcrypto/evp/bio_md.c4
-rw-r--r--lib/libcrypto/evp/digest.c4
-rw-r--r--lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c5
-rw-r--r--lib/libcrypto/evp/e_camellia.c3
-rw-r--r--lib/libcrypto/evp/e_gost2814789.c4
-rw-r--r--lib/libcrypto/evp/e_null.c4
-rw-r--r--lib/libcrypto/evp/e_rc4_hmac_md5.c4
-rw-r--r--lib/libcrypto/evp/encode.c4
-rw-r--r--lib/libcrypto/evp/evp_key.c4
-rw-r--r--lib/libcrypto/evp/evp_lib.c4
-rw-r--r--lib/libcrypto/evp/evp_pkey.c3
-rw-r--r--lib/libcrypto/evp/m_dss.c4
-rw-r--r--lib/libcrypto/evp/m_dss1.c4
-rw-r--r--lib/libcrypto/evp/m_ecdsa.c4
-rw-r--r--lib/libcrypto/evp/m_gost2814789.c5
-rw-r--r--lib/libcrypto/evp/m_gostr341194.c5
-rw-r--r--lib/libcrypto/evp/m_md4.c4
-rw-r--r--lib/libcrypto/evp/m_md5.c4
-rw-r--r--lib/libcrypto/evp/m_md5_sha1.c4
-rw-r--r--lib/libcrypto/evp/m_null.c4
-rw-r--r--lib/libcrypto/evp/m_ripemd.c4
-rw-r--r--lib/libcrypto/evp/m_sha1.c4
-rw-r--r--lib/libcrypto/evp/m_sm3.c4
-rw-r--r--lib/libcrypto/evp/m_streebog.c4
-rw-r--r--lib/libcrypto/evp/m_wp.c4
-rw-r--r--lib/libcrypto/evp/names.c4
-rw-r--r--lib/libcrypto/evp/p5_crpt.c4
-rw-r--r--lib/libcrypto/evp/p_dec.c4
-rw-r--r--lib/libcrypto/evp/p_enc.c4
-rw-r--r--lib/libcrypto/evp/p_lib.c3
-rw-r--r--lib/libcrypto/evp/p_open.c4
-rw-r--r--lib/libcrypto/evp/p_sign.c4
-rw-r--r--lib/libcrypto/evp/p_verify.c4
-rw-r--r--lib/libcrypto/gost/gost89imit_ameth.c3
-rw-r--r--lib/libcrypto/gost/gostr341001_ameth.c3
-rw-r--r--lib/libcrypto/hkdf/hkdf.c3
-rw-r--r--lib/libcrypto/hmac/hm_ameth.c3
-rw-r--r--lib/libcrypto/hmac/hmac.c3
-rw-r--r--lib/libcrypto/pem/pem_info.c4
-rw-r--r--lib/libcrypto/pem/pem_lib.c3
-rw-r--r--lib/libcrypto/pem/pem_pkey.c3
-rw-r--r--lib/libcrypto/pem/pvkfmt.c3
-rw-r--r--lib/libcrypto/pkcs12/p12_decr.c4
-rw-r--r--lib/libcrypto/pkcs12/p12_key.c4
-rw-r--r--lib/libcrypto/pkcs12/p12_mutl.c3
-rw-r--r--lib/libcrypto/pkcs7/pk7_doit.c3
-rw-r--r--lib/libcrypto/pkcs7/pk7_lib.c3
-rw-r--r--lib/libcrypto/rsa/rsa_oaep.c3
-rw-r--r--lib/libcrypto/rsa/rsa_pss.c4
-rw-r--r--lib/libcrypto/ts/ts_rsp_sign.c3
-rw-r--r--lib/libcrypto/ts/ts_rsp_verify.c3
-rw-r--r--lib/libcrypto/x509/x509_cmp.c3
-rw-r--r--lib/libcrypto/x509/x509_req.c3
-rw-r--r--lib/libcrypto/x509/x509type.c3
71 files changed, 184 insertions, 72 deletions
diff --git a/lib/libcrypto/asn1/a_pkey.c b/lib/libcrypto/asn1/a_pkey.c
index 5e6787d6418..2e97d32ab4f 100644
--- a/lib/libcrypto/asn1/a_pkey.c
+++ b/lib/libcrypto/asn1/a_pkey.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -72,6 +72,7 @@
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
EVP_PKEY *
d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, long length)
diff --git a/lib/libcrypto/asn1/a_pubkey.c b/lib/libcrypto/asn1/a_pubkey.c
index b89df8ae612..7ad13e9761d 100644
--- a/lib/libcrypto/asn1/a_pubkey.c
+++ b/lib/libcrypto/asn1/a_pubkey.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -76,6 +76,8 @@
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
EVP_PKEY *
d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp, long length)
{
diff --git a/lib/libcrypto/asn1/a_sign.c b/lib/libcrypto/asn1/a_sign.c
index df955be7456..b6b4c209701 100644
--- a/lib/libcrypto/asn1/a_sign.c
+++ b/lib/libcrypto/asn1/a_sign.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -123,6 +123,7 @@
#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,
diff --git a/lib/libcrypto/asn1/a_verify.c b/lib/libcrypto/asn1/a_verify.c
index 6f0cd1080bc..a8a37908826 100644
--- a/lib/libcrypto/asn1/a_verify.c
+++ b/lib/libcrypto/asn1/a_verify.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -70,6 +70,7 @@
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
int
ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
diff --git a/lib/libcrypto/asn1/ameth_lib.c b/lib/libcrypto/asn1/ameth_lib.c
index 545ba8f1a17..ed7f5bd3e40 100644
--- a/lib/libcrypto/asn1/ameth_lib.c
+++ b/lib/libcrypto/asn1/ameth_lib.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -69,6 +69,7 @@
#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;
diff --git a/lib/libcrypto/asn1/asn_mime.c b/lib/libcrypto/asn1/asn_mime.c
index 6bad111775b..7a51808631e 100644
--- a/lib/libcrypto/asn1/asn_mime.c
+++ b/lib/libcrypto/asn1/asn_mime.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -63,6 +63,7 @@
#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.
diff --git a/lib/libcrypto/asn1/n_pkey.c b/lib/libcrypto/asn1/n_pkey.c
index 89adcd5b116..cfc00887e56 100644
--- a/lib/libcrypto/asn1/n_pkey.c
+++ b/lib/libcrypto/asn1/n_pkey.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -69,6 +69,7 @@
#include <openssl/rsa.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
#ifndef OPENSSL_NO_RC4
diff --git a/lib/libcrypto/asn1/p5_pbev2.c b/lib/libcrypto/asn1/p5_pbev2.c
index 0105c59549d..54dd1eb614e 100644
--- a/lib/libcrypto/asn1/p5_pbev2.c
+++ b/lib/libcrypto/asn1/p5_pbev2.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -64,6 +64,8 @@
#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[] = {
diff --git a/lib/libcrypto/asn1/x_pubkey.c b/lib/libcrypto/asn1/x_pubkey.c
index 3efe61db48f..fecd6c97e30 100644
--- a/lib/libcrypto/asn1/x_pubkey.c
+++ b/lib/libcrypto/asn1/x_pubkey.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -72,6 +72,7 @@
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
#include "x509_lcl.h"
/* Minor tweak to operation: free up EVP_PKEY */
diff --git a/lib/libcrypto/cmac/cm_ameth.c b/lib/libcrypto/cmac/cm_ameth.c
index e7e7fe0f804..26956465ee5 100644
--- a/lib/libcrypto/cmac/cm_ameth.c
+++ b/lib/libcrypto/cmac/cm_ameth.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -57,6 +57,7 @@
#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
diff --git a/lib/libcrypto/cmac/cmac.c b/lib/libcrypto/cmac/cmac.c
index d01ae0f3aee..cd286f88e32 100644
--- a/lib/libcrypto/cmac/cmac.c
+++ b/lib/libcrypto/cmac/cmac.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -57,6 +57,8 @@
#include <openssl/cmac.h>
+#include "evp_locl.h"
+
struct CMAC_CTX_st {
/* Cipher context to use */
EVP_CIPHER_CTX cctx;
diff --git a/lib/libcrypto/dh/dh_ameth.c b/lib/libcrypto/dh/dh_ameth.c
index af15fb2c68e..aee8b05850a 100644
--- a/lib/libcrypto/dh/dh_ameth.c
+++ b/lib/libcrypto/dh/dh_ameth.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -65,6 +65,7 @@
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
static void
int_dh_free(EVP_PKEY *pkey)
diff --git a/lib/libcrypto/dsa/dsa_ameth.c b/lib/libcrypto/dsa/dsa_ameth.c
index cfb33237ec4..af9ebaddde2 100644
--- a/lib/libcrypto/dsa/dsa_ameth.c
+++ b/lib/libcrypto/dsa/dsa_ameth.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -69,6 +69,7 @@
#include "asn1_locl.h"
#include "bn_lcl.h"
+#include "evp_locl.h"
static int
dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
diff --git a/lib/libcrypto/ec/ec_ameth.c b/lib/libcrypto/ec/ec_ameth.c
index 2e73bdd2f6b..c96c46dd53c 100644
--- a/lib/libcrypto/ec/ec_ameth.c
+++ b/lib/libcrypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -67,6 +67,7 @@
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
#ifndef OPENSSL_NO_CMS
static int ecdh_cms_decrypt(CMS_RecipientInfo *ri);
diff --git a/lib/libcrypto/engine/eng_openssl.c b/lib/libcrypto/engine/eng_openssl.c
index f8f6c8f58cd..8bc508f7a48 100644
--- a/lib/libcrypto/engine/eng_openssl.c
+++ b/lib/libcrypto/engine/eng_openssl.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -84,6 +84,8 @@
#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(). */
diff --git a/lib/libcrypto/evp/bio_b64.c b/lib/libcrypto/evp/bio_b64.c
index 82aaa8bf7a2..abe266b604c 100644
--- a/lib/libcrypto/evp/bio_b64.c
+++ b/lib/libcrypto/evp/bio_b64.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -63,6 +63,8 @@
#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);
diff --git a/lib/libcrypto/evp/bio_enc.c b/lib/libcrypto/evp/bio_enc.c
index 33f611d178a..de9267a0d52 100644
--- a/lib/libcrypto/evp/bio_enc.c
+++ b/lib/libcrypto/evp/bio_enc.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -63,6 +63,8 @@
#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); */
diff --git a/lib/libcrypto/evp/bio_md.c b/lib/libcrypto/evp/bio_md.c
index 44f72185dc9..e35510c17c0 100644
--- a/lib/libcrypto/evp/bio_md.c
+++ b/lib/libcrypto/evp/bio_md.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -62,6 +62,8 @@
#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 */
diff --git a/lib/libcrypto/evp/digest.c b/lib/libcrypto/evp/digest.c
index 4cd3565c65a..59c98b57b8a 100644
--- a/lib/libcrypto/evp/digest.c
+++ b/lib/libcrypto/evp/digest.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -122,6 +122,8 @@
#include <openssl/engine.h>
#endif
+#include "evp_locl.h"
+
int
EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type)
{
diff --git a/lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c b/lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c
index 9be17e36f2a..eef9c280969 100644
--- a/lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c
+++ b/lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -59,8 +59,9 @@
#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
diff --git a/lib/libcrypto/evp/e_camellia.c b/lib/libcrypto/evp/e_camellia.c
index fd12cf9c500..70dad7ead6f 100644
--- a/lib/libcrypto/evp/e_camellia.c
+++ b/lib/libcrypto/evp/e_camellia.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -61,6 +61,7 @@
#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,
diff --git a/lib/libcrypto/evp/e_gost2814789.c b/lib/libcrypto/evp/e_gost2814789.c
index 730de4fed1d..7803d9507bf 100644
--- a/lib/libcrypto/evp/e_gost2814789.c
+++ b/lib/libcrypto/evp/e_gost2814789.c
@@ -1,4 +1,4 @@
-/* $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
@@ -48,6 +48,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*/
+
#include <string.h>
#include <openssl/opensslconf.h>
@@ -56,6 +57,7 @@
#include <openssl/evp.h>
#include <openssl/err.h>
#include <openssl/gost.h>
+
#include "evp_locl.h"
typedef struct {
diff --git a/lib/libcrypto/evp/e_null.c b/lib/libcrypto/evp/e_null.c
index 65374cc3f53..db79e1ec5f9 100644
--- a/lib/libcrypto/evp/e_null.c
+++ b/lib/libcrypto/evp/e_null.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -62,6 +62,8 @@
#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,
diff --git a/lib/libcrypto/evp/e_rc4_hmac_md5.c b/lib/libcrypto/evp/e_rc4_hmac_md5.c
index ac73361fa37..b8a6b4492ef 100644
--- a/lib/libcrypto/evp/e_rc4_hmac_md5.c
+++ b/lib/libcrypto/evp/e_rc4_hmac_md5.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -60,6 +60,8 @@
#include <openssl/rc4.h>
#include <openssl/md5.h>
+#include "evp_locl.h"
+
/* FIXME: surely this is available elsewhere? */
#define EVP_RC4_KEY_SIZE 16
diff --git a/lib/libcrypto/evp/encode.c b/lib/libcrypto/evp/encode.c
index 2f942a032f0..30fcd858cf0 100644
--- a/lib/libcrypto/evp/encode.c
+++ b/lib/libcrypto/evp/encode.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -62,6 +62,8 @@
#include <openssl/evp.h>
+#include "evp_locl.h"
+
static unsigned char conv_ascii2bin(unsigned char a);
#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
diff --git a/lib/libcrypto/evp/evp_key.c b/lib/libcrypto/evp/evp_key.c
index 91d0fc0de97..dcfb94e301f 100644
--- a/lib/libcrypto/evp/evp_key.c
+++ b/lib/libcrypto/evp/evp_key.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -65,6 +65,8 @@
#include <openssl/ui.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
/* should be init to zeros. */
static char prompt_string[80];
diff --git a/lib/libcrypto/evp/evp_lib.c b/lib/libcrypto/evp/evp_lib.c
index 83b81bd4292..f2ff7bdec5b 100644
--- a/lib/libcrypto/evp/evp_lib.c
+++ b/lib/libcrypto/evp/evp_lib.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -63,6 +63,8 @@
#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)
{
diff --git a/lib/libcrypto/evp/evp_pkey.c b/lib/libcrypto/evp/evp_pkey.c
index 9ff544b84af..3ba0e1dd510 100644
--- a/lib/libcrypto/evp/evp_pkey.c
+++ b/lib/libcrypto/evp/evp_pkey.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -63,6 +63,7 @@
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
/* Extract a private key from a PKCS8 structure */
diff --git a/lib/libcrypto/evp/m_dss.c b/lib/libcrypto/evp/m_dss.c
index d23c9b4e71a..45f09dde5da 100644
--- a/lib/libcrypto/evp/m_dss.c
+++ b/lib/libcrypto/evp/m_dss.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -68,6 +68,8 @@
#include <openssl/dsa.h>
#endif
+#include "evp_locl.h"
+
#ifndef OPENSSL_NO_SHA
static int
diff --git a/lib/libcrypto/evp/m_dss1.c b/lib/libcrypto/evp/m_dss1.c
index a906c11b69e..283672cc1ee 100644
--- a/lib/libcrypto/evp/m_dss1.c
+++ b/lib/libcrypto/evp/m_dss1.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -70,6 +70,8 @@
#include <openssl/dsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_ecdsa.c b/lib/libcrypto/evp/m_ecdsa.c
index b9af6423b56..b4bd21f7b0e 100644
--- a/lib/libcrypto/evp/m_ecdsa.c
+++ b/lib/libcrypto/evp/m_ecdsa.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -117,6 +117,8 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
#ifndef OPENSSL_NO_SHA
static int
diff --git a/lib/libcrypto/evp/m_gost2814789.c b/lib/libcrypto/evp/m_gost2814789.c
index 279af872e02..7d11ec8c899 100644
--- a/lib/libcrypto/evp/m_gost2814789.c
+++ b/lib/libcrypto/evp/m_gost2814789.c
@@ -1,4 +1,4 @@
-/* $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
@@ -48,6 +48,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*/
+
#include <openssl/opensslconf.h>
#ifndef OPENSSL_NO_GOST
@@ -56,6 +57,8 @@
#include <openssl/gost.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
+
static int
gost2814789_init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_gostr341194.c b/lib/libcrypto/evp/m_gostr341194.c
index 66d9b4f303e..40de2323444 100644
--- a/lib/libcrypto/evp/m_gostr341194.c
+++ b/lib/libcrypto/evp/m_gostr341194.c
@@ -1,4 +1,4 @@
-/* $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
@@ -48,6 +48,7 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*/
+
#include <stdio.h>
#include <openssl/opensslconf.h>
@@ -58,6 +59,8 @@
#include <openssl/gost.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
+
static int
gostr341194_init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_md4.c b/lib/libcrypto/evp/m_md4.c
index ab3cc852bec..57298079860 100644
--- a/lib/libcrypto/evp/m_md4.c
+++ b/lib/libcrypto/evp/m_md4.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -71,6 +71,8 @@
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_md5.c b/lib/libcrypto/evp/m_md5.c
index 36cff7ab519..dbdc5676168 100644
--- a/lib/libcrypto/evp/m_md5.c
+++ b/lib/libcrypto/evp/m_md5.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -71,6 +71,8 @@
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_md5_sha1.c b/lib/libcrypto/evp/m_md5_sha1.c
index 4e8a0c32f62..aaddbe9c813 100644
--- a/lib/libcrypto/evp/m_md5_sha1.c
+++ b/lib/libcrypto/evp/m_md5_sha1.c
@@ -1,4 +1,4 @@
-/* $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>
*
@@ -24,6 +24,8 @@
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
struct md5_sha1_ctx {
MD5_CTX md5;
SHA_CTX sha1;
diff --git a/lib/libcrypto/evp/m_null.c b/lib/libcrypto/evp/m_null.c
index 897be3cee99..86f5a086888 100644
--- a/lib/libcrypto/evp/m_null.c
+++ b/lib/libcrypto/evp/m_null.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -62,6 +62,8 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_ripemd.c b/lib/libcrypto/evp/m_ripemd.c
index be7f1393b02..b3369ab53f3 100644
--- a/lib/libcrypto/evp/m_ripemd.c
+++ b/lib/libcrypto/evp/m_ripemd.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -71,6 +71,8 @@
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_sha1.c b/lib/libcrypto/evp/m_sha1.c
index 13d5b030d27..396f00aa135 100644
--- a/lib/libcrypto/evp/m_sha1.c
+++ b/lib/libcrypto/evp/m_sha1.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -70,6 +70,8 @@
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_sm3.c b/lib/libcrypto/evp/m_sm3.c
index 66582b8e4a4..614be5d7809 100644
--- a/lib/libcrypto/evp/m_sm3.c
+++ b/lib/libcrypto/evp/m_sm3.c
@@ -1,4 +1,4 @@
-/* $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
*
@@ -25,6 +25,8 @@
#include <openssl/rsa.h>
#endif
+#include "evp_locl.h"
+
static int
sm3_init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_streebog.c b/lib/libcrypto/evp/m_streebog.c
index 882c7852bb7..cd6c312b028 100644
--- a/lib/libcrypto/evp/m_streebog.c
+++ b/lib/libcrypto/evp/m_streebog.c
@@ -1,4 +1,4 @@
-/* $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
@@ -57,6 +57,8 @@
#include <openssl/gost.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
+
static int
streebog_init256(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/m_wp.c b/lib/libcrypto/evp/m_wp.c
index 3f543ac0af8..dd777565cf8 100644
--- a/lib/libcrypto/evp/m_wp.c
+++ b/lib/libcrypto/evp/m_wp.c
@@ -1,4 +1,4 @@
-/* $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>
@@ -11,6 +11,8 @@
#include <openssl/x509.h>
#include <openssl/whrlpool.h>
+#include "evp_locl.h"
+
static int
init(EVP_MD_CTX *ctx)
{
diff --git a/lib/libcrypto/evp/names.c b/lib/libcrypto/evp/names.c
index dfcf9ee2251..02529eef6ca 100644
--- a/lib/libcrypto/evp/names.c
+++ b/lib/libcrypto/evp/names.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -62,6 +62,8 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
int
EVP_add_cipher(const EVP_CIPHER *c)
{
diff --git a/lib/libcrypto/evp/p5_crpt.c b/lib/libcrypto/evp/p5_crpt.c
index 98e4549db10..b9482e08649 100644
--- a/lib/libcrypto/evp/p5_crpt.c
+++ b/lib/libcrypto/evp/p5_crpt.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -64,6 +64,8 @@
#include <openssl/evp.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
+
/* Doesn't do anything now: Builtin PBE algorithms in static table.
*/
diff --git a/lib/libcrypto/evp/p_dec.c b/lib/libcrypto/evp/p_dec.c
index c827c5e4c21..c19cc651b3d 100644
--- a/lib/libcrypto/evp/p_dec.c
+++ b/lib/libcrypto/evp/p_dec.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -69,6 +69,8 @@
#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)
diff --git a/lib/libcrypto/evp/p_enc.c b/lib/libcrypto/evp/p_enc.c
index 49c46f1a709..5553429c507 100644
--- a/lib/libcrypto/evp/p_enc.c
+++ b/lib/libcrypto/evp/p_enc.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -69,6 +69,8 @@
#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)
diff --git a/lib/libcrypto/evp/p_lib.c b/lib/libcrypto/evp/p_lib.c
index 9577b10ea1b..89ce4c451a2 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.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.
*
@@ -82,6 +82,7 @@
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
static void EVP_PKEY_free_it(EVP_PKEY *x);
diff --git a/lib/libcrypto/evp/p_open.c b/lib/libcrypto/evp/p_open.c
index 57a46706b93..e4c59e68dbe 100644
--- a/lib/libcrypto/evp/p_open.c
+++ b/lib/libcrypto/evp/p_open.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -69,6 +69,8 @@
#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)
diff --git a/lib/libcrypto/evp/p_sign.c b/lib/libcrypto/evp/p_sign.c
index 63129245186..34dafd87fe7 100644
--- a/lib/libcrypto/evp/p_sign.c
+++ b/lib/libcrypto/evp/p_sign.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -63,6 +63,8 @@
#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)
diff --git a/lib/libcrypto/evp/p_verify.c b/lib/libcrypto/evp/p_verify.c
index 7dd752c4fbe..6ecdef07878 100644
--- a/lib/libcrypto/evp/p_verify.c
+++ b/lib/libcrypto/evp/p_verify.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -63,6 +63,8 @@
#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)
diff --git a/lib/libcrypto/gost/gost89imit_ameth.c b/lib/libcrypto/gost/gost89imit_ameth.c
index a2631d97f8a..3fdfa3eef2e 100644
--- a/lib/libcrypto/gost/gost89imit_ameth.c
+++ b/lib/libcrypto/gost/gost89imit_ameth.c
@@ -1,4 +1,4 @@
-/* $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
@@ -55,6 +55,7 @@
#include <openssl/evp.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
static void
mackey_free_gost(EVP_PKEY *pk)
diff --git a/lib/libcrypto/gost/gostr341001_ameth.c b/lib/libcrypto/gost/gostr341001_ameth.c
index 294b654d4ff..d4c3d8a9c74 100644
--- a/lib/libcrypto/gost/gostr341001_ameth.c
+++ b/lib/libcrypto/gost/gostr341001_ameth.c
@@ -1,4 +1,4 @@
-/* $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
@@ -63,6 +63,7 @@
#include "asn1_locl.h"
+#include "evp_locl.h"
#include "gost_locl.h"
#include "gost_asn1.h"
diff --git a/lib/libcrypto/hkdf/hkdf.c b/lib/libcrypto/hkdf/hkdf.c
index f33ba798910..9adf12608c8 100644
--- a/lib/libcrypto/hkdf/hkdf.c
+++ b/lib/libcrypto/hkdf/hkdf.c
@@ -1,4 +1,4 @@
-/* $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
@@ -21,6 +21,7 @@
#include <openssl/err.h>
#include <openssl/hmac.h>
+#include "evp_locl.h"
#include "hmac_local.h"
/* https://tools.ietf.org/html/rfc5869#section-2 */
diff --git a/lib/libcrypto/hmac/hm_ameth.c b/lib/libcrypto/hmac/hm_ameth.c
index ebbcab5ac26..84bb5f0c073 100644
--- a/lib/libcrypto/hmac/hm_ameth.c
+++ b/lib/libcrypto/hmac/hm_ameth.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -63,6 +63,7 @@
#include <openssl/hmac.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
#include "hmac_local.h"
#define HMAC_TEST_PRIVATE_KEY_FORMAT
diff --git a/lib/libcrypto/hmac/hmac.c b/lib/libcrypto/hmac/hmac.c
index a3eb7666e94..55989988add 100644
--- a/lib/libcrypto/hmac/hmac.c
+++ b/lib/libcrypto/hmac/hmac.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -63,6 +63,7 @@
#include <openssl/err.h>
#include <openssl/hmac.h>
+#include "evp_locl.h"
#include "hmac_local.h"
int
diff --git a/lib/libcrypto/pem/pem_info.c b/lib/libcrypto/pem/pem_info.c
index 33c1de43fd3..aecdbb2e05e 100644
--- a/lib/libcrypto/pem/pem_info.c
+++ b/lib/libcrypto/pem/pem_info.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -75,6 +75,8 @@
#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)
diff --git a/lib/libcrypto/pem/pem_lib.c b/lib/libcrypto/pem/pem_lib.c
index f0126790e96..7b7f81092e2 100644
--- a/lib/libcrypto/pem/pem_lib.c
+++ b/lib/libcrypto/pem/pem_lib.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -79,6 +79,7 @@
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
#define MIN_LENGTH 4
diff --git a/lib/libcrypto/pem/pem_pkey.c b/lib/libcrypto/pem/pem_pkey.c
index 89181a25f70..8f4fba2f8ea 100644
--- a/lib/libcrypto/pem/pem_pkey.c
+++ b/lib/libcrypto/pem/pem_pkey.c
@@ -1,4 +1,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.
*
@@ -74,6 +74,7 @@
#endif
#include "asn1_locl.h"
+#include "evp_locl.h"
int pem_check_suffix(const char *pem_str, const char *suffix);
diff --git a/lib/libcrypto/pem/pvkfmt.c b/lib/libcrypto/pem/pvkfmt.c
index abb7f7eec91..9d758ab2895 100644
--- a/lib/libcrypto/pem/pvkfmt.c
+++ b/lib/libcrypto/pem/pvkfmt.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -74,6 +74,7 @@
#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
diff --git a/lib/libcrypto/pkcs12/p12_decr.c b/lib/libcrypto/pkcs12/p12_decr.c
index 8ac7f17cfc6..c352ba565c1 100644
--- a/lib/libcrypto/pkcs12/p12_decr.c
+++ b/lib/libcrypto/pkcs12/p12_decr.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -62,6 +62,8 @@
#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
*/
diff --git a/lib/libcrypto/pkcs12/p12_key.c b/lib/libcrypto/pkcs12/p12_key.c
index 2887948144f..38d25d2f6b4 100644
--- a/lib/libcrypto/pkcs12/p12_key.c
+++ b/lib/libcrypto/pkcs12/p12_key.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -63,6 +63,8 @@
#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))
diff --git a/lib/libcrypto/pkcs12/p12_mutl.c b/lib/libcrypto/pkcs12/p12_mutl.c
index aa363747b37..f3a6ea3ba3a 100644
--- a/lib/libcrypto/pkcs12/p12_mutl.c
+++ b/lib/libcrypto/pkcs12/p12_mutl.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -68,6 +68,7 @@
#include <openssl/hmac.h>
#include <openssl/pkcs12.h>
+#include "evp_locl.h"
#include "hmac_local.h"
#include "x509_lcl.h"
diff --git a/lib/libcrypto/pkcs7/pk7_doit.c b/lib/libcrypto/pkcs7/pk7_doit.c
index 6d921e5cff2..c9d64bcf342 100644
--- a/lib/libcrypto/pkcs7/pk7_doit.c
+++ b/lib/libcrypto/pkcs7/pk7_doit.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -65,6 +65,7 @@
#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,
diff --git a/lib/libcrypto/pkcs7/pk7_lib.c b/lib/libcrypto/pkcs7/pk7_lib.c
index 24cb0fe4c64..7e92df1e9f6 100644
--- a/lib/libcrypto/pkcs7/pk7_lib.c
+++ b/lib/libcrypto/pkcs7/pk7_lib.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -63,6 +63,7 @@
#include <openssl/x509.h>
#include "asn1_locl.h"
+#include "evp_locl.h"
#include "x509_lcl.h"
long
diff --git a/lib/libcrypto/rsa/rsa_oaep.c b/lib/libcrypto/rsa/rsa_oaep.c
index e54600b0943..aa378689500 100644
--- a/lib/libcrypto/rsa/rsa_oaep.c
+++ b/lib/libcrypto/rsa/rsa_oaep.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -80,6 +80,7 @@
#include <openssl/sha.h>
#include "constant_time_locl.h"
+#include "evp_locl.h"
#include "rsa_locl.h"
int
diff --git a/lib/libcrypto/rsa/rsa_pss.c b/lib/libcrypto/rsa/rsa_pss.c
index 562f7b252c9..85ce7626431 100644
--- a/lib/libcrypto/rsa/rsa_pss.c
+++ b/lib/libcrypto/rsa/rsa_pss.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -66,6 +66,8 @@
#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
diff --git a/lib/libcrypto/ts/ts_rsp_sign.c b/lib/libcrypto/ts/ts_rsp_sign.c
index cbd7039abe2..470cbfb7ea4 100644
--- a/lib/libcrypto/ts/ts_rsp_sign.c
+++ b/lib/libcrypto/ts/ts_rsp_sign.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -65,6 +65,7 @@
#include <openssl/pkcs7.h>
#include <openssl/ts.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
/* Private function declarations. */
diff --git a/lib/libcrypto/ts/ts_rsp_verify.c b/lib/libcrypto/ts/ts_rsp_verify.c
index 07578945cb3..8b15760be97 100644
--- a/lib/libcrypto/ts/ts_rsp_verify.c
+++ b/lib/libcrypto/ts/ts_rsp_verify.c
@@ -1,4 +1,4 @@
-/* $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.
*/
@@ -64,6 +64,7 @@
#include <openssl/pkcs7.h>
#include <openssl/ts.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
/* Private function declarations. */
diff --git a/lib/libcrypto/x509/x509_cmp.c b/lib/libcrypto/x509/x509_cmp.c
index bc944b71d78..e60ee25de1a 100644
--- a/lib/libcrypto/x509/x509_cmp.c
+++ b/lib/libcrypto/x509/x509_cmp.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -68,6 +68,7 @@
#include <openssl/x509.h>
#include <openssl/x509v3.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
int
diff --git a/lib/libcrypto/x509/x509_req.c b/lib/libcrypto/x509/x509_req.c
index e7f871449f8..ffe9b8607f9 100644
--- a/lib/libcrypto/x509/x509_req.c
+++ b/lib/libcrypto/x509/x509_req.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -70,6 +70,7 @@
#include <openssl/pem.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
X509_REQ *
diff --git a/lib/libcrypto/x509/x509type.c b/lib/libcrypto/x509/x509type.c
index 1748ee5110b..7495b9ef042 100644
--- a/lib/libcrypto/x509/x509type.c
+++ b/lib/libcrypto/x509/x509type.c
@@ -1,4 +1,4 @@
-/* $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.
*
@@ -62,6 +62,7 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include "evp_locl.h"
#include "x509_lcl.h"
int