summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2021-12-12 21:27:38 +0000
committertb <>2021-12-12 21:27:38 +0000
commita0b1347b1dec62a1a5e864ed59314d2e9b42e15b (patch)
tree110aa6f619f19831c621f32e98d757ca15d75e3e
parentef37d8e11b67b24d718fb50ca36b24bf266259ad (diff)
downloadopenbsd-a0b1347b1dec62a1a5e864ed59314d2e9b42e15b.tar.gz
openbsd-a0b1347b1dec62a1a5e864ed59314d2e9b42e15b.tar.bz2
openbsd-a0b1347b1dec62a1a5e864ed59314d2e9b42e15b.zip
Add a mostly empty hmac_local.h. HMAC_CTX and a few other things
from hmac.h will be moved there in an umpcoming bump. Include this file where it will be needed. ok inoguchi
-rw-r--r--src/lib/libcrypto/evp/p5_crpt2.c3
-rw-r--r--src/lib/libcrypto/hkdf/hkdf.c4
-rw-r--r--src/lib/libcrypto/hmac/hm_ameth.c4
-rw-r--r--src/lib/libcrypto/hmac/hm_pmeth.c3
-rw-r--r--src/lib/libcrypto/hmac/hmac.c4
-rw-r--r--src/lib/libcrypto/hmac/hmac_local.h71
-rw-r--r--src/lib/libcrypto/pkcs12/p12_mutl.c3
7 files changed, 86 insertions, 6 deletions
diff --git a/src/lib/libcrypto/evp/p5_crpt2.c b/src/lib/libcrypto/evp/p5_crpt2.c
index 4bef287706..f3585ff34b 100644
--- a/src/lib/libcrypto/evp/p5_crpt2.c
+++ b/src/lib/libcrypto/evp/p5_crpt2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_crpt2.c,v 1.23 2017/01/29 17:49:23 beck Exp $ */ 1/* $OpenBSD: p5_crpt2.c,v 1.24 2021/12/12 21:27:37 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -70,6 +70,7 @@
70#include <openssl/x509.h> 70#include <openssl/x509.h>
71 71
72#include "evp_locl.h" 72#include "evp_locl.h"
73#include "hmac_local.h"
73 74
74/* This is an implementation of PKCS#5 v2.0 password based encryption key 75/* This is an implementation of PKCS#5 v2.0 password based encryption key
75 * derivation function PBKDF2. 76 * derivation function PBKDF2.
diff --git a/src/lib/libcrypto/hkdf/hkdf.c b/src/lib/libcrypto/hkdf/hkdf.c
index e912481d48..f33ba79891 100644
--- a/src/lib/libcrypto/hkdf/hkdf.c
+++ b/src/lib/libcrypto/hkdf/hkdf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hkdf.c,v 1.5 2021/08/27 16:12:33 tb Exp $ */ 1/* $OpenBSD: hkdf.c,v 1.6 2021/12/12 21:27:37 tb Exp $ */
2/* Copyright (c) 2014, Google Inc. 2/* Copyright (c) 2014, Google Inc.
3 * 3 *
4 * Permission to use, copy, modify, and/or distribute this software for any 4 * Permission to use, copy, modify, and/or distribute this software for any
@@ -21,6 +21,8 @@
21#include <openssl/err.h> 21#include <openssl/err.h>
22#include <openssl/hmac.h> 22#include <openssl/hmac.h>
23 23
24#include "hmac_local.h"
25
24/* https://tools.ietf.org/html/rfc5869#section-2 */ 26/* https://tools.ietf.org/html/rfc5869#section-2 */
25int 27int
26HKDF(uint8_t *out_key, size_t out_len, const EVP_MD *digest, 28HKDF(uint8_t *out_key, size_t out_len, const EVP_MD *digest,
diff --git a/src/lib/libcrypto/hmac/hm_ameth.c b/src/lib/libcrypto/hmac/hm_ameth.c
index cfa0239705..ebbcab5ac2 100644
--- a/src/lib/libcrypto/hmac/hm_ameth.c
+++ b/src/lib/libcrypto/hmac/hm_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hm_ameth.c,v 1.10 2015/09/10 15:56:25 jsing Exp $ */ 1/* $OpenBSD: hm_ameth.c,v 1.11 2021/12/12 21:27:38 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2007. 3 * project 2007.
4 */ 4 */
@@ -60,8 +60,10 @@
60#include <string.h> 60#include <string.h>
61 61
62#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/hmac.h>
63 64
64#include "asn1_locl.h" 65#include "asn1_locl.h"
66#include "hmac_local.h"
65 67
66#define HMAC_TEST_PRIVATE_KEY_FORMAT 68#define HMAC_TEST_PRIVATE_KEY_FORMAT
67 69
diff --git a/src/lib/libcrypto/hmac/hm_pmeth.c b/src/lib/libcrypto/hmac/hm_pmeth.c
index 390725fa25..8964c64871 100644
--- a/src/lib/libcrypto/hmac/hm_pmeth.c
+++ b/src/lib/libcrypto/hmac/hm_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hm_pmeth.c,v 1.10 2017/05/02 03:59:44 deraadt Exp $ */ 1/* $OpenBSD: hm_pmeth.c,v 1.11 2021/12/12 21:27:38 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2007. 3 * project 2007.
4 */ 4 */
@@ -65,6 +65,7 @@
65#include <openssl/x509v3.h> 65#include <openssl/x509v3.h>
66 66
67#include "evp_locl.h" 67#include "evp_locl.h"
68#include "hmac_local.h"
68 69
69/* HMAC pkey context structure */ 70/* HMAC pkey context structure */
70 71
diff --git a/src/lib/libcrypto/hmac/hmac.c b/src/lib/libcrypto/hmac/hmac.c
index 7bf17eed96..a3eb7666e9 100644
--- a/src/lib/libcrypto/hmac/hmac.c
+++ b/src/lib/libcrypto/hmac/hmac.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: hmac.c,v 1.25 2018/02/17 14:53:58 jsing Exp $ */ 1/* $OpenBSD: hmac.c,v 1.26 2021/12/12 21:27:38 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -63,6 +63,8 @@
63#include <openssl/err.h> 63#include <openssl/err.h>
64#include <openssl/hmac.h> 64#include <openssl/hmac.h>
65 65
66#include "hmac_local.h"
67
66int 68int
67HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md, 69HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md,
68 ENGINE *impl) 70 ENGINE *impl)
diff --git a/src/lib/libcrypto/hmac/hmac_local.h b/src/lib/libcrypto/hmac/hmac_local.h
new file mode 100644
index 0000000000..46f1a013cb
--- /dev/null
+++ b/src/lib/libcrypto/hmac/hmac_local.h
@@ -0,0 +1,71 @@
1/* $OpenBSD: hmac_local.h,v 1.1 2021/12/12 21:27:38 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved.
4 *
5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL.
8 *
9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions
11 * apply to all code found in this distribution, be it the RC4, RSA,
12 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
13 * included with this distribution is covered by the same copyright terms
14 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15 *
16 * Copyright remains Eric Young's, and as such any Copyright notices in
17 * the code are not to be removed.
18 * If this package is used in a product, Eric Young should be given attribution
19 * as the author of the parts of the library used.
20 * This can be in the form of a textual message at program startup or
21 * in documentation (online or textual) provided with the package.
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions
25 * are met:
26 * 1. Redistributions of source code must retain the copyright
27 * notice, this list of conditions and the following disclaimer.
28 * 2. Redistributions in binary form must reproduce the above copyright
29 * notice, this list of conditions and the following disclaimer in the
30 * documentation and/or other materials provided with the distribution.
31 * 3. All advertising materials mentioning features or use of this software
32 * must display the following acknowledgement:
33 * "This product includes cryptographic software written by
34 * Eric Young (eay@cryptsoft.com)"
35 * The word 'cryptographic' can be left out if the rouines from the library
36 * being used are not cryptographic related :-).
37 * 4. If you include any Windows specific code (or a derivative thereof) from
38 * the apps directory (application code) you must include an acknowledgement:
39 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40 *
41 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.]
57 */
58#ifndef HEADER_HMAC_LOCAL_H
59#define HEADER_HMAC_LOCAL_H
60
61#include <openssl/opensslconf.h>
62
63#include <openssl/evp.h>
64
65#include "evp_locl.h"
66
67__BEGIN_HIDDEN_DECLS
68
69__END_HIDDEN_DECLS
70
71#endif /* !HEADER_HMAC_LOCAL_H */
diff --git a/src/lib/libcrypto/pkcs12/p12_mutl.c b/src/lib/libcrypto/pkcs12/p12_mutl.c
index 14ded8532d..aa363747b3 100644
--- a/src/lib/libcrypto/pkcs12/p12_mutl.c
+++ b/src/lib/libcrypto/pkcs12/p12_mutl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p12_mutl.c,v 1.25 2021/11/01 20:53:08 tb Exp $ */ 1/* $OpenBSD: p12_mutl.c,v 1.26 2021/12/12 21:27:38 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -68,6 +68,7 @@
68#include <openssl/hmac.h> 68#include <openssl/hmac.h>
69#include <openssl/pkcs12.h> 69#include <openssl/pkcs12.h>
70 70
71#include "hmac_local.h"
71#include "x509_lcl.h" 72#include "x509_lcl.h"
72 73
73/* Generate a MAC */ 74/* Generate a MAC */