licentivo-launch 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +35 -0
- data/ext/launch_native/extconf.rb +28 -0
- data/lib/licentivo_launch/vendor/licentivo.rb +262 -0
- data/lib/licentivo_launch.rb +352 -0
- data/vendor/LICENSE +21 -0
- data/vendor/NOTICE +17 -0
- data/vendor/VERSION +1 -0
- data/vendor/c/app.c +33 -0
- data/vendor/c/demo.c +77 -0
- data/vendor/c/feature_tasks.h +72 -0
- data/vendor/c/licentivo.c +382 -0
- data/vendor/c/licentivo.h +67 -0
- data/vendor/c/quickstart.c +51 -0
- data/vendor/c/test_vectors.c +4 -0
- data/vendor/c/vendor/Monocypher-LICENCE.md +173 -0
- data/vendor/c/vendor/cJSON-LICENSE +20 -0
- data/vendor/c/vendor/cJSON.c +3191 -0
- data/vendor/c/vendor/cJSON.h +306 -0
- data/vendor/c/vendor/monocypher-ed25519.c +500 -0
- data/vendor/c/vendor/monocypher-ed25519.h +140 -0
- data/vendor/c/vendor/monocypher.c +2956 -0
- data/vendor/c/vendor/monocypher.h +321 -0
- data/vendor/curl/COPYING.txt +22 -0
- data/vendor/curl/bin/libcurl-x64.dll +0 -0
- data/vendor/curl/include/brotli/decode.h +409 -0
- data/vendor/curl/include/brotli/encode.h +505 -0
- data/vendor/curl/include/brotli/port.h +302 -0
- data/vendor/curl/include/brotli/shared_dictionary.h +100 -0
- data/vendor/curl/include/brotli/types.h +83 -0
- data/vendor/curl/include/curl/curl.h +3374 -0
- data/vendor/curl/include/curl/curlver.h +77 -0
- data/vendor/curl/include/curl/easy.h +123 -0
- data/vendor/curl/include/curl/header.h +74 -0
- data/vendor/curl/include/curl/mprintf.h +85 -0
- data/vendor/curl/include/curl/multi.h +561 -0
- data/vendor/curl/include/curl/options.h +70 -0
- data/vendor/curl/include/curl/stdcheaders.h +35 -0
- data/vendor/curl/include/curl/system.h +399 -0
- data/vendor/curl/include/curl/typecheck-gcc.h +964 -0
- data/vendor/curl/include/curl/urlapi.h +156 -0
- data/vendor/curl/include/curl/websockets.h +98 -0
- data/vendor/curl/include/libpsl.h +207 -0
- data/vendor/curl/include/libssh2.h +1516 -0
- data/vendor/curl/include/libssh2_publickey.h +128 -0
- data/vendor/curl/include/libssh2_sftp.h +382 -0
- data/vendor/curl/include/nghttp2/nghttp2.h +6878 -0
- data/vendor/curl/include/nghttp2/nghttp2ver.h +42 -0
- data/vendor/curl/include/nghttp3/nghttp3.h +3704 -0
- data/vendor/curl/include/nghttp3/version.h +46 -0
- data/vendor/curl/include/ngtcp2/ngtcp2.h +7485 -0
- data/vendor/curl/include/ngtcp2/ngtcp2_crypto.h +1071 -0
- data/vendor/curl/include/ngtcp2/ngtcp2_crypto_quictls.h +147 -0
- data/vendor/curl/include/ngtcp2/version.h +51 -0
- data/vendor/curl/include/openssl/aes.h +120 -0
- data/vendor/curl/include/openssl/asn1.h +1121 -0
- data/vendor/curl/include/openssl/asn1t.h +996 -0
- data/vendor/curl/include/openssl/bio.h +716 -0
- data/vendor/curl/include/openssl/blowfish.h +106 -0
- data/vendor/curl/include/openssl/bn.h +480 -0
- data/vendor/curl/include/openssl/buffer.h +102 -0
- data/vendor/curl/include/openssl/camellia.h +121 -0
- data/vendor/curl/include/openssl/cast.h +99 -0
- data/vendor/curl/include/openssl/chacha.h +54 -0
- data/vendor/curl/include/openssl/cmac.h +81 -0
- data/vendor/curl/include/openssl/cms.h +541 -0
- data/vendor/curl/include/openssl/comp.h +7 -0
- data/vendor/curl/include/openssl/conf.h +189 -0
- data/vendor/curl/include/openssl/crypto.h +458 -0
- data/vendor/curl/include/openssl/ct.h +567 -0
- data/vendor/curl/include/openssl/curve25519.h +104 -0
- data/vendor/curl/include/openssl/des.h +215 -0
- data/vendor/curl/include/openssl/dh.h +245 -0
- data/vendor/curl/include/openssl/dsa.h +263 -0
- data/vendor/curl/include/openssl/dtls1.h +107 -0
- data/vendor/curl/include/openssl/ec.h +675 -0
- data/vendor/curl/include/openssl/ecdh.h +6 -0
- data/vendor/curl/include/openssl/ecdsa.h +6 -0
- data/vendor/curl/include/openssl/engine.h +215 -0
- data/vendor/curl/include/openssl/err.h +325 -0
- data/vendor/curl/include/openssl/evp.h +1288 -0
- data/vendor/curl/include/openssl/hkdf.h +65 -0
- data/vendor/curl/include/openssl/hmac.h +101 -0
- data/vendor/curl/include/openssl/idea.h +99 -0
- data/vendor/curl/include/openssl/kdf.h +137 -0
- data/vendor/curl/include/openssl/lhash.h +179 -0
- data/vendor/curl/include/openssl/md4.h +105 -0
- data/vendor/curl/include/openssl/md5.h +99 -0
- data/vendor/curl/include/openssl/mlkem.h +236 -0
- data/vendor/curl/include/openssl/modes.h +118 -0
- data/vendor/curl/include/openssl/obj_mac.h +4646 -0
- data/vendor/curl/include/openssl/objects.h +137 -0
- data/vendor/curl/include/openssl/ocsp.h +484 -0
- data/vendor/curl/include/openssl/opensslconf.h +16 -0
- data/vendor/curl/include/openssl/opensslfeatures.h +153 -0
- data/vendor/curl/include/openssl/opensslv.h +18 -0
- data/vendor/curl/include/openssl/ossl_typ.h +196 -0
- data/vendor/curl/include/openssl/pem.h +542 -0
- data/vendor/curl/include/openssl/pkcs12.h +284 -0
- data/vendor/curl/include/openssl/pkcs7.h +523 -0
- data/vendor/curl/include/openssl/poly1305.h +45 -0
- data/vendor/curl/include/openssl/posix_time.h +54 -0
- data/vendor/curl/include/openssl/rand.h +118 -0
- data/vendor/curl/include/openssl/rc2.h +101 -0
- data/vendor/curl/include/openssl/rc4.h +88 -0
- data/vendor/curl/include/openssl/ripemd.h +107 -0
- data/vendor/curl/include/openssl/rsa.h +603 -0
- data/vendor/curl/include/openssl/safestack.h +1739 -0
- data/vendor/curl/include/openssl/sha.h +190 -0
- data/vendor/curl/include/openssl/sm3.h +49 -0
- data/vendor/curl/include/openssl/sm4.h +47 -0
- data/vendor/curl/include/openssl/srtp.h +148 -0
- data/vendor/curl/include/openssl/ssl.h +2336 -0
- data/vendor/curl/include/openssl/ssl3.h +441 -0
- data/vendor/curl/include/openssl/stack.h +99 -0
- data/vendor/curl/include/openssl/tls1.h +764 -0
- data/vendor/curl/include/openssl/ts.h +660 -0
- data/vendor/curl/include/openssl/txt_db.h +112 -0
- data/vendor/curl/include/openssl/ui.h +397 -0
- data/vendor/curl/include/openssl/x509.h +1037 -0
- data/vendor/curl/include/openssl/x509_vfy.h +464 -0
- data/vendor/curl/include/openssl/x509v3.h +1039 -0
- data/vendor/curl/include/zconf.h +206 -0
- data/vendor/curl/include/zdict.h +481 -0
- data/vendor/curl/include/zlib.h +1859 -0
- data/vendor/curl/include/zlib_name_mangling.h +8 -0
- data/vendor/curl/include/zstd.h +3198 -0
- data/vendor/curl/include/zstd_errors.h +107 -0
- data/vendor/curl/lib/libcurl.dll.a +0 -0
- data/vendor/curl/licenses/brotli/LICENSE.txt +19 -0
- data/vendor/curl/licenses/certdata/LICENSE.url +2 -0
- data/vendor/curl/licenses/libpsl/COPYING.txt +20 -0
- data/vendor/curl/licenses/libressl/COPYING.txt +133 -0
- data/vendor/curl/licenses/libssh2/COPYING.txt +43 -0
- data/vendor/curl/licenses/nghttp2/COPYING.txt +23 -0
- data/vendor/curl/licenses/nghttp3/COPYING.txt +22 -0
- data/vendor/curl/licenses/ngtcp2/COPYING.txt +22 -0
- data/vendor/curl/licenses/psl/LICENSE.txt +373 -0
- data/vendor/curl/licenses/trurl/COPYING.txt +22 -0
- data/vendor/curl/licenses/zlibng/LICENSE.md +19 -0
- data/vendor/curl/licenses/zstd/LICENSE.txt +30 -0
- metadata +205 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* $OpenBSD: hkdf.h,v 1.3 2023/08/11 04:52:08 tb Exp $ */
|
|
2
|
+
/* Copyright (c) 2014, Google Inc.
|
|
3
|
+
*
|
|
4
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
6
|
+
* copyright notice and this permission notice appear in all copies.
|
|
7
|
+
*
|
|
8
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
9
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
10
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
11
|
+
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
12
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
13
|
+
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
14
|
+
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
|
15
|
+
|
|
16
|
+
#ifndef OPENSSL_HEADER_HKDF_H
|
|
17
|
+
#define OPENSSL_HEADER_HKDF_H
|
|
18
|
+
|
|
19
|
+
#include <openssl/evp.h>
|
|
20
|
+
|
|
21
|
+
#if defined(__cplusplus)
|
|
22
|
+
extern "C" {
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
* HKDF computes HKDF (as specified by RFC 5869) of initial keying
|
|
27
|
+
* material |secret| with |salt| and |info| using |digest|, and
|
|
28
|
+
* outputs |out_len| bytes to |out_key|. It returns one on success and
|
|
29
|
+
* zero on error.
|
|
30
|
+
*
|
|
31
|
+
* HKDF is an Extract-and-Expand algorithm. It does not do any key
|
|
32
|
+
* stretching, and as such, is not suited to be used alone to generate
|
|
33
|
+
* a key from a password.
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
int HKDF(uint8_t *out_key, size_t out_len, const EVP_MD *digest,
|
|
37
|
+
const uint8_t *secret, size_t secret_len, const uint8_t *salt,
|
|
38
|
+
size_t salt_len, const uint8_t *info, size_t info_len);
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
* HKDF_extract computes a HKDF PRK (as specified by RFC 5869) from
|
|
42
|
+
* initial keying material |secret| and salt |salt| using |digest|,
|
|
43
|
+
* and outputs |out_len| bytes to |out_key|. The maximum output size
|
|
44
|
+
* is |EVP_MAX_MD_SIZE|. It returns one on success and zero on error.
|
|
45
|
+
*/
|
|
46
|
+
int HKDF_extract(uint8_t *out_key, size_t *out_len, const EVP_MD *digest,
|
|
47
|
+
const uint8_t *secret, size_t secret_len,
|
|
48
|
+
const uint8_t *salt, size_t salt_len);
|
|
49
|
+
|
|
50
|
+
/*
|
|
51
|
+
* HKDF_expand computes a HKDF OKM (as specified by RFC 5869) of
|
|
52
|
+
* length |out_len| from the PRK |prk| and info |info| using |digest|,
|
|
53
|
+
* and outputs the result to |out_key|. It returns one on success and
|
|
54
|
+
* zero on error.
|
|
55
|
+
*/
|
|
56
|
+
int HKDF_expand(uint8_t *out_key, size_t out_len,
|
|
57
|
+
const EVP_MD *digest, const uint8_t *prk, size_t prk_len,
|
|
58
|
+
const uint8_t *info, size_t info_len);
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
#if defined(__cplusplus)
|
|
62
|
+
} /* extern C */
|
|
63
|
+
#endif
|
|
64
|
+
|
|
65
|
+
#endif /* OPENSSL_HEADER_HKDF_H */
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/* $OpenBSD: hmac.h,v 1.21 2025/01/25 17:59:44 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_H
|
|
59
|
+
#define HEADER_HMAC_H
|
|
60
|
+
|
|
61
|
+
#include <openssl/opensslconf.h>
|
|
62
|
+
|
|
63
|
+
#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__)
|
|
64
|
+
#define __bounded__(x, y, z)
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
#include <openssl/evp.h>
|
|
68
|
+
|
|
69
|
+
#define HMAC_MAX_MD_CBLOCK 144 /* largest known is SHA3-224 */
|
|
70
|
+
|
|
71
|
+
#ifdef __cplusplus
|
|
72
|
+
extern "C" {
|
|
73
|
+
#endif
|
|
74
|
+
|
|
75
|
+
#define HMAC_size(e) (EVP_MD_size(HMAC_CTX_get_md((e))))
|
|
76
|
+
|
|
77
|
+
HMAC_CTX *HMAC_CTX_new(void);
|
|
78
|
+
void HMAC_CTX_free(HMAC_CTX *ctx);
|
|
79
|
+
int HMAC_CTX_reset(HMAC_CTX *ctx);
|
|
80
|
+
|
|
81
|
+
int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len, const EVP_MD *md,
|
|
82
|
+
ENGINE *impl)
|
|
83
|
+
__attribute__ ((__bounded__(__buffer__, 2, 3)));
|
|
84
|
+
int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, size_t len)
|
|
85
|
+
__attribute__ ((__bounded__(__buffer__, 2, 3)));
|
|
86
|
+
int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len);
|
|
87
|
+
unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,
|
|
88
|
+
const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len)
|
|
89
|
+
__attribute__ ((__bounded__(__buffer__, 2, 3)))
|
|
90
|
+
__attribute__ ((__bounded__(__buffer__, 4, 5)))
|
|
91
|
+
__attribute__((__nonnull__ (6)));
|
|
92
|
+
int HMAC_CTX_copy(HMAC_CTX *dctx, HMAC_CTX *sctx);
|
|
93
|
+
|
|
94
|
+
void HMAC_CTX_set_flags(HMAC_CTX *ctx, unsigned long flags);
|
|
95
|
+
const EVP_MD *HMAC_CTX_get_md(const HMAC_CTX *ctx);
|
|
96
|
+
|
|
97
|
+
#ifdef __cplusplus
|
|
98
|
+
}
|
|
99
|
+
#endif
|
|
100
|
+
|
|
101
|
+
#endif
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* $OpenBSD: idea.h,v 1.14 2025/06/09 14:37:49 tb Exp $ */
|
|
2
|
+
/* Copyright (C) 1995-1997 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
|
+
|
|
59
|
+
#ifndef HEADER_IDEA_H
|
|
60
|
+
#define HEADER_IDEA_H
|
|
61
|
+
|
|
62
|
+
#include <openssl/opensslconf.h> /* OPENSSL_NO_IDEA */
|
|
63
|
+
|
|
64
|
+
#ifndef IDEA_INT
|
|
65
|
+
/* XXX - typedef */
|
|
66
|
+
#define IDEA_INT unsigned int
|
|
67
|
+
#endif
|
|
68
|
+
|
|
69
|
+
#define IDEA_ENCRYPT 1
|
|
70
|
+
#define IDEA_DECRYPT 0
|
|
71
|
+
|
|
72
|
+
#define IDEA_BLOCK 8
|
|
73
|
+
#define IDEA_KEY_LENGTH 16
|
|
74
|
+
|
|
75
|
+
#ifdef __cplusplus
|
|
76
|
+
extern "C" {
|
|
77
|
+
#endif
|
|
78
|
+
|
|
79
|
+
typedef struct idea_key_st {
|
|
80
|
+
IDEA_INT data[9][6];
|
|
81
|
+
} IDEA_KEY_SCHEDULE;
|
|
82
|
+
|
|
83
|
+
void idea_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
|
84
|
+
IDEA_KEY_SCHEDULE *ks);
|
|
85
|
+
void idea_set_encrypt_key(const unsigned char *key, IDEA_KEY_SCHEDULE *ks);
|
|
86
|
+
void idea_set_decrypt_key(IDEA_KEY_SCHEDULE *ek, IDEA_KEY_SCHEDULE *dk);
|
|
87
|
+
void idea_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
|
88
|
+
long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int enc);
|
|
89
|
+
void idea_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
|
90
|
+
long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv,
|
|
91
|
+
int *num, int enc);
|
|
92
|
+
void idea_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
|
93
|
+
long length, IDEA_KEY_SCHEDULE *ks, unsigned char *iv, int *num);
|
|
94
|
+
void idea_encrypt(unsigned long *in, IDEA_KEY_SCHEDULE *ks);
|
|
95
|
+
#ifdef __cplusplus
|
|
96
|
+
}
|
|
97
|
+
#endif
|
|
98
|
+
|
|
99
|
+
#endif
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/* $OpenBSD: kdf.h,v 1.9 2024/07/09 16:20:17 tb Exp $ */
|
|
2
|
+
/*
|
|
3
|
+
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
|
|
4
|
+
* project.
|
|
5
|
+
*/
|
|
6
|
+
/* ====================================================================
|
|
7
|
+
* Copyright (c) 2016-2018 The OpenSSL Project. All rights reserved.
|
|
8
|
+
*
|
|
9
|
+
* Redistribution and use in source and binary forms, with or without
|
|
10
|
+
* modification, are permitted provided that the following conditions
|
|
11
|
+
* are met:
|
|
12
|
+
*
|
|
13
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
14
|
+
* notice, this list of conditions and the following disclaimer.
|
|
15
|
+
*
|
|
16
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
17
|
+
* notice, this list of conditions and the following disclaimer in
|
|
18
|
+
* the documentation and/or other materials provided with the
|
|
19
|
+
* distribution.
|
|
20
|
+
*
|
|
21
|
+
* 3. All advertising materials mentioning features or use of this
|
|
22
|
+
* software must display the following acknowledgment:
|
|
23
|
+
* "This product includes software developed by the OpenSSL Project
|
|
24
|
+
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
|
25
|
+
*
|
|
26
|
+
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
|
27
|
+
* endorse or promote products derived from this software without
|
|
28
|
+
* prior written permission. For written permission, please contact
|
|
29
|
+
* licensing@OpenSSL.org.
|
|
30
|
+
*
|
|
31
|
+
* 5. Products derived from this software may not be called "OpenSSL"
|
|
32
|
+
* nor may "OpenSSL" appear in their names without prior written
|
|
33
|
+
* permission of the OpenSSL Project.
|
|
34
|
+
*
|
|
35
|
+
* 6. Redistributions of any form whatsoever must retain the following
|
|
36
|
+
* acknowledgment:
|
|
37
|
+
* "This product includes software developed by the OpenSSL Project
|
|
38
|
+
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
|
39
|
+
*
|
|
40
|
+
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
|
41
|
+
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
42
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
43
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
|
44
|
+
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
45
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
46
|
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
47
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
48
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
49
|
+
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
50
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
51
|
+
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
52
|
+
* ====================================================================
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
#ifndef HEADER_KDF_H
|
|
56
|
+
# define HEADER_KDF_H
|
|
57
|
+
|
|
58
|
+
#ifdef __cplusplus
|
|
59
|
+
extern "C" {
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
# define EVP_PKEY_CTRL_TLS_MD (EVP_PKEY_ALG_CTRL + 0)
|
|
63
|
+
# define EVP_PKEY_CTRL_TLS_SECRET (EVP_PKEY_ALG_CTRL + 1)
|
|
64
|
+
# define EVP_PKEY_CTRL_TLS_SEED (EVP_PKEY_ALG_CTRL + 2)
|
|
65
|
+
|
|
66
|
+
# define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3)
|
|
67
|
+
# define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4)
|
|
68
|
+
# define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5)
|
|
69
|
+
# define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6)
|
|
70
|
+
# define EVP_PKEY_CTRL_HKDF_MODE (EVP_PKEY_ALG_CTRL + 7)
|
|
71
|
+
|
|
72
|
+
# define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND 0
|
|
73
|
+
# define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY 1
|
|
74
|
+
# define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY 2
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# define EVP_PKEY_CTX_set_tls1_prf_md(pctx, md) \
|
|
78
|
+
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
|
79
|
+
EVP_PKEY_CTRL_TLS_MD, 0, (void *)(md))
|
|
80
|
+
|
|
81
|
+
# define EVP_PKEY_CTX_set1_tls1_prf_secret(pctx, sec, seclen) \
|
|
82
|
+
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
|
83
|
+
EVP_PKEY_CTRL_TLS_SECRET, seclen, (void *)(sec))
|
|
84
|
+
|
|
85
|
+
# define EVP_PKEY_CTX_add1_tls1_prf_seed(pctx, seed, seedlen) \
|
|
86
|
+
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
|
87
|
+
EVP_PKEY_CTRL_TLS_SEED, seedlen, (void *)(seed))
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# define EVP_PKEY_CTX_set_hkdf_md(pctx, md) \
|
|
91
|
+
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
|
92
|
+
EVP_PKEY_CTRL_HKDF_MD, 0, (void *)(md))
|
|
93
|
+
|
|
94
|
+
# define EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, saltlen) \
|
|
95
|
+
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
|
96
|
+
EVP_PKEY_CTRL_HKDF_SALT, saltlen, (void *)(salt))
|
|
97
|
+
|
|
98
|
+
# define EVP_PKEY_CTX_set1_hkdf_key(pctx, key, keylen) \
|
|
99
|
+
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
|
100
|
+
EVP_PKEY_CTRL_HKDF_KEY, keylen, (void *)(key))
|
|
101
|
+
|
|
102
|
+
# define EVP_PKEY_CTX_add1_hkdf_info(pctx, info, infolen) \
|
|
103
|
+
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
|
104
|
+
EVP_PKEY_CTRL_HKDF_INFO, infolen, (void *)(info))
|
|
105
|
+
|
|
106
|
+
# define EVP_PKEY_CTX_hkdf_mode(pctx, mode) \
|
|
107
|
+
EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
|
|
108
|
+
EVP_PKEY_CTRL_HKDF_MODE, mode, NULL)
|
|
109
|
+
|
|
110
|
+
int ERR_load_KDF_strings(void);
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
* KDF function codes.
|
|
114
|
+
*/
|
|
115
|
+
# define KDF_F_PKEY_HKDF_CTRL_STR 103
|
|
116
|
+
# define KDF_F_PKEY_HKDF_DERIVE 102
|
|
117
|
+
# define KDF_F_PKEY_HKDF_INIT 108
|
|
118
|
+
# define KDF_F_PKEY_TLS1_PRF_CTRL_STR 100
|
|
119
|
+
# define KDF_F_PKEY_TLS1_PRF_DERIVE 101
|
|
120
|
+
# define KDF_F_PKEY_TLS1_PRF_INIT 110
|
|
121
|
+
# define KDF_F_TLS1_PRF_ALG 111
|
|
122
|
+
|
|
123
|
+
/*
|
|
124
|
+
* KDF reason codes.
|
|
125
|
+
*/
|
|
126
|
+
# define KDF_R_INVALID_DIGEST 100
|
|
127
|
+
# define KDF_R_MISSING_KEY 104
|
|
128
|
+
# define KDF_R_MISSING_MESSAGE_DIGEST 105
|
|
129
|
+
# define KDF_R_MISSING_SECRET 107
|
|
130
|
+
# define KDF_R_MISSING_SEED 106
|
|
131
|
+
# define KDF_R_UNKNOWN_PARAMETER_TYPE 103
|
|
132
|
+
# define KDF_R_VALUE_MISSING 102
|
|
133
|
+
|
|
134
|
+
# ifdef __cplusplus
|
|
135
|
+
}
|
|
136
|
+
# endif
|
|
137
|
+
#endif
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/* $OpenBSD: lhash.h,v 1.14 2024/03/02 11:11:11 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
|
+
|
|
59
|
+
/* Header for dynamic hash table routines
|
|
60
|
+
* Author - Eric Young
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
#ifndef HEADER_LHASH_H
|
|
64
|
+
#define HEADER_LHASH_H
|
|
65
|
+
|
|
66
|
+
#include <openssl/opensslconf.h>
|
|
67
|
+
|
|
68
|
+
#include <stdio.h>
|
|
69
|
+
|
|
70
|
+
#ifndef OPENSSL_NO_BIO
|
|
71
|
+
#include <openssl/bio.h>
|
|
72
|
+
#endif
|
|
73
|
+
|
|
74
|
+
#ifdef __cplusplus
|
|
75
|
+
extern "C" {
|
|
76
|
+
#endif
|
|
77
|
+
|
|
78
|
+
typedef int (*LHASH_COMP_FN_TYPE)(const void *, const void *);
|
|
79
|
+
typedef unsigned long (*LHASH_HASH_FN_TYPE)(const void *);
|
|
80
|
+
typedef void (*LHASH_DOALL_FN_TYPE)(void *);
|
|
81
|
+
typedef void (*LHASH_DOALL_ARG_FN_TYPE)(void *, void *);
|
|
82
|
+
|
|
83
|
+
/* Macros for declaring and implementing type-safe wrappers for LHASH callbacks.
|
|
84
|
+
* This way, callbacks can be provided to LHASH structures without function
|
|
85
|
+
* pointer casting and the macro-defined callbacks provide per-variable casting
|
|
86
|
+
* before deferring to the underlying type-specific callbacks. NB: It is
|
|
87
|
+
* possible to place a "static" in front of both the DECLARE and IMPLEMENT
|
|
88
|
+
* macros if the functions are strictly internal. */
|
|
89
|
+
|
|
90
|
+
/* First: "hash" functions */
|
|
91
|
+
#define DECLARE_LHASH_HASH_FN(name, o_type) \
|
|
92
|
+
unsigned long name##_LHASH_HASH(const void *);
|
|
93
|
+
#define IMPLEMENT_LHASH_HASH_FN(name, o_type) \
|
|
94
|
+
unsigned long name##_LHASH_HASH(const void *arg) { \
|
|
95
|
+
const o_type *a = arg; \
|
|
96
|
+
return name##_hash(a); }
|
|
97
|
+
#define LHASH_HASH_FN(name) name##_LHASH_HASH
|
|
98
|
+
|
|
99
|
+
/* Second: "compare" functions */
|
|
100
|
+
#define DECLARE_LHASH_COMP_FN(name, o_type) \
|
|
101
|
+
int name##_LHASH_COMP(const void *, const void *);
|
|
102
|
+
#define IMPLEMENT_LHASH_COMP_FN(name, o_type) \
|
|
103
|
+
int name##_LHASH_COMP(const void *arg1, const void *arg2) { \
|
|
104
|
+
const o_type *a = arg1; \
|
|
105
|
+
const o_type *b = arg2; \
|
|
106
|
+
return name##_cmp(a,b); }
|
|
107
|
+
#define LHASH_COMP_FN(name) name##_LHASH_COMP
|
|
108
|
+
|
|
109
|
+
/* Third: "doall" functions */
|
|
110
|
+
#define DECLARE_LHASH_DOALL_FN(name, o_type) \
|
|
111
|
+
void name##_LHASH_DOALL(void *);
|
|
112
|
+
#define IMPLEMENT_LHASH_DOALL_FN(name, o_type) \
|
|
113
|
+
void name##_LHASH_DOALL(void *arg) { \
|
|
114
|
+
o_type *a = arg; \
|
|
115
|
+
name##_doall(a); }
|
|
116
|
+
#define LHASH_DOALL_FN(name) name##_LHASH_DOALL
|
|
117
|
+
|
|
118
|
+
/* Fourth: "doall_arg" functions */
|
|
119
|
+
#define DECLARE_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
|
120
|
+
void name##_LHASH_DOALL_ARG(void *, void *);
|
|
121
|
+
#define IMPLEMENT_LHASH_DOALL_ARG_FN(name, o_type, a_type) \
|
|
122
|
+
void name##_LHASH_DOALL_ARG(void *arg1, void *arg2) { \
|
|
123
|
+
o_type *a = arg1; \
|
|
124
|
+
a_type *b = arg2; \
|
|
125
|
+
name##_doall_arg(a, b); }
|
|
126
|
+
#define LHASH_DOALL_ARG_FN(name) name##_LHASH_DOALL_ARG
|
|
127
|
+
|
|
128
|
+
typedef struct lhash_st _LHASH;
|
|
129
|
+
|
|
130
|
+
#define LH_LOAD_MULT 256
|
|
131
|
+
|
|
132
|
+
_LHASH *lh_new(LHASH_HASH_FN_TYPE h, LHASH_COMP_FN_TYPE c);
|
|
133
|
+
void lh_free(_LHASH *lh);
|
|
134
|
+
int lh_error(_LHASH *lh);
|
|
135
|
+
void *lh_insert(_LHASH *lh, void *data);
|
|
136
|
+
void *lh_delete(_LHASH *lh, const void *data);
|
|
137
|
+
void *lh_retrieve(_LHASH *lh, const void *data);
|
|
138
|
+
void lh_doall(_LHASH *lh, LHASH_DOALL_FN_TYPE func);
|
|
139
|
+
void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg);
|
|
140
|
+
unsigned long lh_strhash(const char *c);
|
|
141
|
+
unsigned long lh_num_items(const _LHASH *lh);
|
|
142
|
+
|
|
143
|
+
/* Type checking... */
|
|
144
|
+
|
|
145
|
+
#define LHASH_OF(type) struct lhash_st_##type
|
|
146
|
+
|
|
147
|
+
#define DECLARE_LHASH_OF(type) LHASH_OF(type)
|
|
148
|
+
|
|
149
|
+
#define CHECKED_LHASH_OF(type,lh) \
|
|
150
|
+
((_LHASH *)CHECKED_PTR_OF(LHASH_OF(type),lh))
|
|
151
|
+
|
|
152
|
+
/* Define wrapper functions. */
|
|
153
|
+
#define LHM_lh_new(type, name) \
|
|
154
|
+
((LHASH_OF(type) *)lh_new(LHASH_HASH_FN(name), LHASH_COMP_FN(name)))
|
|
155
|
+
#define LHM_lh_error(type, lh) \
|
|
156
|
+
lh_error(CHECKED_LHASH_OF(type,lh))
|
|
157
|
+
#define LHM_lh_insert(type, lh, inst) \
|
|
158
|
+
((type *)lh_insert(CHECKED_LHASH_OF(type, lh), \
|
|
159
|
+
CHECKED_PTR_OF(type, inst)))
|
|
160
|
+
#define LHM_lh_retrieve(type, lh, inst) \
|
|
161
|
+
((type *)lh_retrieve(CHECKED_LHASH_OF(type, lh), \
|
|
162
|
+
CHECKED_PTR_OF(type, inst)))
|
|
163
|
+
#define LHM_lh_delete(type, lh, inst) \
|
|
164
|
+
((type *)lh_delete(CHECKED_LHASH_OF(type, lh), \
|
|
165
|
+
CHECKED_PTR_OF(type, inst)))
|
|
166
|
+
#define LHM_lh_doall(type, lh,fn) lh_doall(CHECKED_LHASH_OF(type, lh), fn)
|
|
167
|
+
#define LHM_lh_doall_arg(type, lh, fn, arg_type, arg) \
|
|
168
|
+
lh_doall_arg(CHECKED_LHASH_OF(type, lh), fn, CHECKED_PTR_OF(arg_type, arg))
|
|
169
|
+
#define LHM_lh_num_items(type, lh) lh_num_items(CHECKED_LHASH_OF(type, lh))
|
|
170
|
+
#define LHM_lh_free(type, lh) lh_free(CHECKED_LHASH_OF(type, lh))
|
|
171
|
+
|
|
172
|
+
DECLARE_LHASH_OF(OPENSSL_STRING);
|
|
173
|
+
DECLARE_LHASH_OF(OPENSSL_CSTRING);
|
|
174
|
+
|
|
175
|
+
#ifdef __cplusplus
|
|
176
|
+
}
|
|
177
|
+
#endif
|
|
178
|
+
|
|
179
|
+
#endif
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* $OpenBSD: md4.h,v 1.22 2025/01/25 17:59:44 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
|
+
|
|
59
|
+
#include <stddef.h>
|
|
60
|
+
|
|
61
|
+
#ifndef HEADER_MD4_H
|
|
62
|
+
#define HEADER_MD4_H
|
|
63
|
+
|
|
64
|
+
#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__OpenBSD__)
|
|
65
|
+
#define __bounded__(x, y, z)
|
|
66
|
+
#endif
|
|
67
|
+
|
|
68
|
+
#include <openssl/opensslconf.h>
|
|
69
|
+
|
|
70
|
+
#ifdef __cplusplus
|
|
71
|
+
extern "C" {
|
|
72
|
+
#endif
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
76
|
+
* ! MD4_LONG has to be at least 32 bits wide. !
|
|
77
|
+
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
#define MD4_LONG unsigned int
|
|
81
|
+
|
|
82
|
+
#define MD4_CBLOCK 64
|
|
83
|
+
#define MD4_LBLOCK (MD4_CBLOCK/4)
|
|
84
|
+
#define MD4_DIGEST_LENGTH 16
|
|
85
|
+
|
|
86
|
+
typedef struct MD4state_st {
|
|
87
|
+
MD4_LONG A, B,C, D;
|
|
88
|
+
MD4_LONG Nl, Nh;
|
|
89
|
+
MD4_LONG data[MD4_LBLOCK];
|
|
90
|
+
unsigned int num;
|
|
91
|
+
} MD4_CTX;
|
|
92
|
+
|
|
93
|
+
int MD4_Init(MD4_CTX *c);
|
|
94
|
+
int MD4_Update(MD4_CTX *c, const void *data, size_t len)
|
|
95
|
+
__attribute__ ((__bounded__(__buffer__, 2, 3)));
|
|
96
|
+
int MD4_Final(unsigned char *md, MD4_CTX *c);
|
|
97
|
+
unsigned char *MD4(const unsigned char *d, size_t n, unsigned char *md)
|
|
98
|
+
__attribute__ ((__bounded__(__buffer__, 1, 2)))
|
|
99
|
+
__attribute__ ((__nonnull__(3)));
|
|
100
|
+
void MD4_Transform(MD4_CTX *c, const unsigned char *b);
|
|
101
|
+
#ifdef __cplusplus
|
|
102
|
+
}
|
|
103
|
+
#endif
|
|
104
|
+
|
|
105
|
+
#endif
|