mirror of
https://github.com/apple/swift-nio-ssl
synced 2026-11-26 04:57:52 +00:00
Update BoringSSL to 1c58648f14ed75f2a8cc3ae08897987d97f493ec (#239)
* Update patch-2-arm-arch.patch * Update BoringSSL to 1c58648f14ed75f2a8cc3ae08897987d97f493ec
This commit is contained in:
1 parent
7932e709af
commit
ea1dfd6419
67 files changed
+1698
-1037
No files matched your search
+1
-1
@@ -22,7 +22,7 @@ import PackageDescription
|
||||
// Sources/CNIOBoringSSL directory. The source repository is at
|
||||
// https://boringssl.googlesource.com/boringssl.
|
||||
//
|
||||
// BoringSSL Commit: 54858b63c1d886f6c8d903d4a4f594f1485de189
|
||||
// BoringSSL Commit: 1c58648f14ed75f2a8cc3ae08897987d97f493ec
|
||||
|
||||
let package = Package(
|
||||
name: "swift-nio-ssl",
|
||||
|
||||
@@ -35,6 +35,7 @@ Lone:
|
||||
|
||||
.align 5
|
||||
_ChaCha20_ctr32:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
cbz x2,Labort
|
||||
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
|
||||
adrp x5,:pg_hi21_nc:_OPENSSL_armcap_P
|
||||
@@ -48,6 +49,7 @@ _ChaCha20_ctr32:
|
||||
b.ne ChaCha20_neon
|
||||
|
||||
Lshort:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-96]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -260,6 +262,7 @@ Loop:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
Labort:
|
||||
ret
|
||||
|
||||
@@ -316,12 +319,14 @@ Loop_tail:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
|
||||
.align 5
|
||||
ChaCha20_neon:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-96]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -702,6 +707,7 @@ Loop_neon:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
Ltail_neon:
|
||||
@@ -811,11 +817,13 @@ Ldone_neon:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
.align 5
|
||||
ChaCha20_512_neon:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-96]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -1979,6 +1987,7 @@ Ldone_512_neon:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
#endif // !OPENSSL_NO_ASM
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
.type ChaCha20_ctr32,%function
|
||||
.align 5
|
||||
ChaCha20_ctr32:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
cbz x2,.Labort
|
||||
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
|
||||
adrp x5,:pg_hi21_nc:OPENSSL_armcap_P
|
||||
@@ -49,6 +50,7 @@ ChaCha20_ctr32:
|
||||
b.ne ChaCha20_neon
|
||||
|
||||
.Lshort:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-96]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -261,6 +263,7 @@ ChaCha20_ctr32:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
.Labort:
|
||||
ret
|
||||
|
||||
@@ -317,12 +320,14 @@ ChaCha20_ctr32:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size ChaCha20_ctr32,.-ChaCha20_ctr32
|
||||
|
||||
.type ChaCha20_neon,%function
|
||||
.align 5
|
||||
ChaCha20_neon:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-96]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -703,6 +708,7 @@ ChaCha20_neon:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
.Ltail_neon:
|
||||
@@ -812,11 +818,13 @@ ChaCha20_neon:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size ChaCha20_neon,.-ChaCha20_neon
|
||||
.type ChaCha20_512_neon,%function
|
||||
.align 5
|
||||
ChaCha20_512_neon:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-96]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -1980,6 +1988,7 @@ ChaCha20_512_neon:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#96
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size ChaCha20_512_neon,.-ChaCha20_512_neon
|
||||
#endif
|
||||
|
||||
@@ -72,12 +72,11 @@
|
||||
#include <CNIOBoringSSL_sha.h>
|
||||
#include <CNIOBoringSSL_thread.h>
|
||||
|
||||
#include "internal.h"
|
||||
#include "../fipsmodule/bn/internal.h"
|
||||
#include "../internal.h"
|
||||
|
||||
|
||||
#define OPENSSL_DSA_MAX_MODULUS_BITS 10000
|
||||
|
||||
// Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of
|
||||
// Miller-Rabin.
|
||||
#define DSS_prime_checks 50
|
||||
@@ -568,23 +567,7 @@ static int mod_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
}
|
||||
|
||||
DSA_SIG *DSA_do_sign(const uint8_t *digest, size_t digest_len, const DSA *dsa) {
|
||||
if (!dsa->p || !dsa->q || !dsa->g) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Reject invalid parameters. In particular, the algorithm will infinite loop
|
||||
// if |g| is zero.
|
||||
if (BN_is_zero(dsa->p) || BN_is_zero(dsa->q) || BN_is_zero(dsa->g)) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_INVALID_PARAMETERS);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// We only support DSA keys that are a multiple of 8 bits. (This is a weaker
|
||||
// check than the one in |DSA_do_check_signature|, which only allows 160-,
|
||||
// 224-, and 256-bit keys.
|
||||
if (BN_num_bits(dsa->q) % 8 != 0) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_Q_VALUE);
|
||||
if (!dsa_check_parameters(dsa)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -678,35 +661,17 @@ int DSA_do_verify(const uint8_t *digest, size_t digest_len, DSA_SIG *sig,
|
||||
|
||||
int DSA_do_check_signature(int *out_valid, const uint8_t *digest,
|
||||
size_t digest_len, DSA_SIG *sig, const DSA *dsa) {
|
||||
BN_CTX *ctx;
|
||||
BIGNUM u1, u2, t1;
|
||||
int ret = 0;
|
||||
unsigned i;
|
||||
|
||||
*out_valid = 0;
|
||||
|
||||
if (!dsa->p || !dsa->q || !dsa->g) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
i = BN_num_bits(dsa->q);
|
||||
// FIPS 186-3 allows only different sizes for q.
|
||||
if (i != 160 && i != 224 && i != 256) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_Q_VALUE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (BN_num_bits(dsa->p) > OPENSSL_DSA_MAX_MODULUS_BITS) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_MODULUS_TOO_LARGE);
|
||||
if (!dsa_check_parameters(dsa)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = 0;
|
||||
BIGNUM u1, u2, t1;
|
||||
BN_init(&u1);
|
||||
BN_init(&u2);
|
||||
BN_init(&t1);
|
||||
|
||||
ctx = BN_CTX_new();
|
||||
BN_CTX *ctx = BN_CTX_new();
|
||||
if (ctx == NULL) {
|
||||
goto err;
|
||||
}
|
||||
@@ -729,11 +694,12 @@ int DSA_do_check_signature(int *out_valid, const uint8_t *digest,
|
||||
}
|
||||
|
||||
// save M in u1
|
||||
if (digest_len > (i >> 3)) {
|
||||
unsigned q_bits = BN_num_bits(dsa->q);
|
||||
if (digest_len > (q_bits >> 3)) {
|
||||
// if the digest length is greater than the size of q use the
|
||||
// BN_num_bits(dsa->q) leftmost bits of the digest, see
|
||||
// fips 186-3, 4.2
|
||||
digest_len = (i >> 3);
|
||||
digest_len = (q_bits >> 3);
|
||||
}
|
||||
|
||||
if (BN_bin2bn(digest, digest_len, &u1) == NULL) {
|
||||
|
||||
@@ -61,9 +61,45 @@
|
||||
#include <CNIOBoringSSL_err.h>
|
||||
#include <CNIOBoringSSL_mem.h>
|
||||
|
||||
#include "internal.h"
|
||||
#include "../bytestring/internal.h"
|
||||
|
||||
|
||||
#define OPENSSL_DSA_MAX_MODULUS_BITS 10000
|
||||
|
||||
// This function is in dsa_asn1.c rather than dsa.c because it is reachable from
|
||||
// |EVP_PKEY| parsers. This makes it easier for the static linker to drop most
|
||||
// of the DSA implementation.
|
||||
int dsa_check_parameters(const DSA *dsa) {
|
||||
if (!dsa->p || !dsa->q || !dsa->g) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Reject invalid parameters. In particular, signing will infinite loop if |g|
|
||||
// is zero.
|
||||
if (BN_is_zero(dsa->p) || BN_is_zero(dsa->q) || BN_is_zero(dsa->g)) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_INVALID_PARAMETERS);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// FIPS 186-4 allows only three different sizes for q.
|
||||
unsigned q_bits = BN_num_bits(dsa->q);
|
||||
if (q_bits != 160 && q_bits != 224 && q_bits != 256) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_Q_VALUE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Bound |dsa->p| to avoid a DoS vector. Note this limit is much larger than
|
||||
// the one in FIPS 186-4, which only allows L = 1024, 2048, and 3072.
|
||||
if (BN_num_bits(dsa->p) > OPENSSL_DSA_MAX_MODULUS_BITS) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_MODULUS_TOO_LARGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int parse_integer(CBS *cbs, BIGNUM **out) {
|
||||
assert(*out == NULL);
|
||||
*out = BN_new();
|
||||
@@ -124,10 +160,16 @@ DSA *DSA_parse_public_key(CBS *cbs) {
|
||||
!parse_integer(&child, &ret->g) ||
|
||||
CBS_len(&child) != 0) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR);
|
||||
DSA_free(ret);
|
||||
return NULL;
|
||||
goto err;
|
||||
}
|
||||
if (!dsa_check_parameters(ret)) {
|
||||
goto err;
|
||||
}
|
||||
return ret;
|
||||
|
||||
err:
|
||||
DSA_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int DSA_marshal_public_key(CBB *cbb, const DSA *dsa) {
|
||||
@@ -156,10 +198,16 @@ DSA *DSA_parse_parameters(CBS *cbs) {
|
||||
!parse_integer(&child, &ret->g) ||
|
||||
CBS_len(&child) != 0) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR);
|
||||
DSA_free(ret);
|
||||
return NULL;
|
||||
goto err;
|
||||
}
|
||||
if (!dsa_check_parameters(ret)) {
|
||||
goto err;
|
||||
}
|
||||
return ret;
|
||||
|
||||
err:
|
||||
DSA_free(ret);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int DSA_marshal_parameters(CBB *cbb, const DSA *dsa) {
|
||||
@@ -203,6 +251,9 @@ DSA *DSA_parse_private_key(CBS *cbs) {
|
||||
OPENSSL_PUT_ERROR(DSA, DSA_R_DECODE_ERROR);
|
||||
goto err;
|
||||
}
|
||||
if (!dsa_check_parameters(ret)) {
|
||||
goto err;
|
||||
}
|
||||
return ret;
|
||||
|
||||
err:
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/* Copyright (c) 2020, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
||||
|
||||
#ifndef OPENSSL_HEADER_DSA_INTERNAL_H
|
||||
#define OPENSSL_HEADER_DSA_INTERNAL_H
|
||||
|
||||
#include <CNIOBoringSSL_dsa.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// dsa_check_parameters checks that |dsa|'s group is within DoS bounds. It
|
||||
// returns one on success and zero on error.
|
||||
int dsa_check_parameters(const DSA *dsa);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // extern C
|
||||
#endif
|
||||
|
||||
#endif // OPENSSL_HEADER_DSA_INTERNAL_H
|
||||
@@ -191,47 +191,47 @@ const uint32_t kOpenSSLReasonValues[] = {
|
||||
0x283480ac,
|
||||
0x283500ea,
|
||||
0x28358c6c,
|
||||
0x2c323012,
|
||||
0x2c32308b,
|
||||
0x2c3292e8,
|
||||
0x2c333020,
|
||||
0x2c33b032,
|
||||
0x2c343046,
|
||||
0x2c34b058,
|
||||
0x2c353073,
|
||||
0x2c35b085,
|
||||
0x2c3630b5,
|
||||
0x2c333099,
|
||||
0x2c33b0ab,
|
||||
0x2c3430bf,
|
||||
0x2c34b0d1,
|
||||
0x2c3530ec,
|
||||
0x2c35b0fe,
|
||||
0x2c36312e,
|
||||
0x2c36832d,
|
||||
0x2c3730c2,
|
||||
0x2c37b0ee,
|
||||
0x2c383113,
|
||||
0x2c38b12a,
|
||||
0x2c393148,
|
||||
0x2c39b158,
|
||||
0x2c3a316a,
|
||||
0x2c3ab17e,
|
||||
0x2c3b318f,
|
||||
0x2c3bb1ae,
|
||||
0x2c37313b,
|
||||
0x2c37b167,
|
||||
0x2c38318c,
|
||||
0x2c38b1a3,
|
||||
0x2c3931c1,
|
||||
0x2c39b1d1,
|
||||
0x2c3a31e3,
|
||||
0x2c3ab1f7,
|
||||
0x2c3b3208,
|
||||
0x2c3bb227,
|
||||
0x2c3c12fa,
|
||||
0x2c3c9310,
|
||||
0x2c3d31c2,
|
||||
0x2c3d323b,
|
||||
0x2c3d9329,
|
||||
0x2c3e31df,
|
||||
0x2c3eb1ed,
|
||||
0x2c3f3205,
|
||||
0x2c3fb21d,
|
||||
0x2c403247,
|
||||
0x2c3e3258,
|
||||
0x2c3eb266,
|
||||
0x2c3f327e,
|
||||
0x2c3fb296,
|
||||
0x2c4032c0,
|
||||
0x2c4091fb,
|
||||
0x2c413258,
|
||||
0x2c41b26b,
|
||||
0x2c4132d1,
|
||||
0x2c41b2e4,
|
||||
0x2c4211c1,
|
||||
0x2c42b27c,
|
||||
0x2c42b2f5,
|
||||
0x2c430722,
|
||||
0x2c43b1a0,
|
||||
0x2c443101,
|
||||
0x2c44b22a,
|
||||
0x2c453098,
|
||||
0x2c45b0d4,
|
||||
0x2c463138,
|
||||
0x2c43b219,
|
||||
0x2c44317a,
|
||||
0x2c44b2a3,
|
||||
0x2c453111,
|
||||
0x2c45b14d,
|
||||
0x2c4631b1,
|
||||
0x30320000,
|
||||
0x30328015,
|
||||
0x3033001f,
|
||||
@@ -429,180 +429,183 @@ const uint32_t kOpenSSLReasonValues[] = {
|
||||
0x4050203c,
|
||||
0x4050a050,
|
||||
0x40512083,
|
||||
0x40522093,
|
||||
0x4052a0b7,
|
||||
0x405320cf,
|
||||
0x4053a0e2,
|
||||
0x405420f7,
|
||||
0x4054a11a,
|
||||
0x40552128,
|
||||
0x4055a165,
|
||||
0x40562172,
|
||||
0x4056a18b,
|
||||
0x405721a3,
|
||||
0x4057a1b6,
|
||||
0x405821cb,
|
||||
0x4058a1f2,
|
||||
0x40592221,
|
||||
0x4059a24e,
|
||||
0x405a2262,
|
||||
0x405aa272,
|
||||
0x405b228a,
|
||||
0x405ba29b,
|
||||
0x405c22ae,
|
||||
0x405ca2ed,
|
||||
0x405d22fa,
|
||||
0x405da31f,
|
||||
0x405e235d,
|
||||
0x405220a0,
|
||||
0x4052a0c4,
|
||||
0x405320dc,
|
||||
0x4053a0ef,
|
||||
0x40542104,
|
||||
0x4054a127,
|
||||
0x40552135,
|
||||
0x4055a172,
|
||||
0x4056217f,
|
||||
0x4056a198,
|
||||
0x405721b0,
|
||||
0x4057a1c3,
|
||||
0x405821d8,
|
||||
0x4058a1ff,
|
||||
0x4059222e,
|
||||
0x4059a25b,
|
||||
0x405a226f,
|
||||
0x405aa27f,
|
||||
0x405b2297,
|
||||
0x405ba2a8,
|
||||
0x405c22bb,
|
||||
0x405ca2fa,
|
||||
0x405d2307,
|
||||
0x405da32c,
|
||||
0x405e236a,
|
||||
0x405e8ab3,
|
||||
0x405f237e,
|
||||
0x405fa38b,
|
||||
0x40602399,
|
||||
0x4060a3bb,
|
||||
0x4061241c,
|
||||
0x4061a454,
|
||||
0x4062246b,
|
||||
0x4062a47c,
|
||||
0x406324c9,
|
||||
0x4063a4de,
|
||||
0x406424f5,
|
||||
0x4064a521,
|
||||
0x4065253c,
|
||||
0x4065a553,
|
||||
0x4066256b,
|
||||
0x4066a595,
|
||||
0x406725c0,
|
||||
0x4067a605,
|
||||
0x4068264d,
|
||||
0x4068a66e,
|
||||
0x406926a0,
|
||||
0x4069a6ce,
|
||||
0x406a26ef,
|
||||
0x406aa70f,
|
||||
0x406b2897,
|
||||
0x406ba8ba,
|
||||
0x406c28d0,
|
||||
0x406cab73,
|
||||
0x406d2ba2,
|
||||
0x406dabca,
|
||||
0x406e2bf8,
|
||||
0x406eac45,
|
||||
0x406f2c80,
|
||||
0x406facb8,
|
||||
0x40702ccb,
|
||||
0x4070ace8,
|
||||
0x405f238b,
|
||||
0x405fa398,
|
||||
0x406023a6,
|
||||
0x4060a3c8,
|
||||
0x40612429,
|
||||
0x4061a461,
|
||||
0x40622478,
|
||||
0x4062a489,
|
||||
0x406324d6,
|
||||
0x4063a4eb,
|
||||
0x40642502,
|
||||
0x4064a52e,
|
||||
0x40652549,
|
||||
0x4065a560,
|
||||
0x40662578,
|
||||
0x4066a5a2,
|
||||
0x406725cd,
|
||||
0x4067a612,
|
||||
0x4068265a,
|
||||
0x4068a67b,
|
||||
0x406926ad,
|
||||
0x4069a6db,
|
||||
0x406a26fc,
|
||||
0x406aa71c,
|
||||
0x406b28a4,
|
||||
0x406ba8c7,
|
||||
0x406c28dd,
|
||||
0x406cabce,
|
||||
0x406d2bfd,
|
||||
0x406dac25,
|
||||
0x406e2c53,
|
||||
0x406eaca0,
|
||||
0x406f2cf9,
|
||||
0x406fad31,
|
||||
0x40702d44,
|
||||
0x4070ad61,
|
||||
0x40710802,
|
||||
0x4071acfa,
|
||||
0x40722d0d,
|
||||
0x4072ad43,
|
||||
0x40732d5b,
|
||||
0x4071ad73,
|
||||
0x40722d86,
|
||||
0x4072adbc,
|
||||
0x40732dd4,
|
||||
0x407394fa,
|
||||
0x40742d6f,
|
||||
0x4074ad89,
|
||||
0x40752d9a,
|
||||
0x4075adae,
|
||||
0x40762dbc,
|
||||
0x40742de8,
|
||||
0x4074ae02,
|
||||
0x40752e13,
|
||||
0x4075ae27,
|
||||
0x40762e35,
|
||||
0x407692be,
|
||||
0x40772de1,
|
||||
0x4077ae03,
|
||||
0x40782e1e,
|
||||
0x4078ae57,
|
||||
0x40792e6e,
|
||||
0x4079ae84,
|
||||
0x407a2eb0,
|
||||
0x407aaec3,
|
||||
0x407b2ed8,
|
||||
0x407baeea,
|
||||
0x407c2f1b,
|
||||
0x407caf24,
|
||||
0x407d2689,
|
||||
0x40772e5a,
|
||||
0x4077ae7c,
|
||||
0x40782e97,
|
||||
0x4078aed0,
|
||||
0x40792ee7,
|
||||
0x4079aefd,
|
||||
0x407a2f29,
|
||||
0x407aaf3c,
|
||||
0x407b2f51,
|
||||
0x407baf63,
|
||||
0x407c2f94,
|
||||
0x407caf9d,
|
||||
0x407d2696,
|
||||
0x407d9ff5,
|
||||
0x407e2e33,
|
||||
0x407ea202,
|
||||
0x407e2eac,
|
||||
0x407ea20f,
|
||||
0x407f1d53,
|
||||
0x407f9e9f,
|
||||
0x40801faf,
|
||||
0x40809d7b,
|
||||
0x408120a5,
|
||||
0x408120b2,
|
||||
0x40819f89,
|
||||
0x40822be3,
|
||||
0x40822c3e,
|
||||
0x40829ae4,
|
||||
0x408321dd,
|
||||
0x4083a506,
|
||||
0x408321ea,
|
||||
0x4083a513,
|
||||
0x40841d8f,
|
||||
0x4084a23a,
|
||||
0x408522bf,
|
||||
0x4085a3e3,
|
||||
0x4086233f,
|
||||
0x4084a247,
|
||||
0x408522cc,
|
||||
0x4085a3f0,
|
||||
0x4086234c,
|
||||
0x4086a00f,
|
||||
0x40872c29,
|
||||
0x4087a431,
|
||||
0x40872c84,
|
||||
0x4087a43e,
|
||||
0x40881b22,
|
||||
0x4088a618,
|
||||
0x4088a625,
|
||||
0x40891b71,
|
||||
0x40899afe,
|
||||
0x408a2908,
|
||||
0x408a2915,
|
||||
0x408a9912,
|
||||
0x408b2eff,
|
||||
0x408bac95,
|
||||
0x408c22cf,
|
||||
0x408b2f78,
|
||||
0x408bad0e,
|
||||
0x408c22dc,
|
||||
0x408c992e,
|
||||
0x408d1df0,
|
||||
0x408d9dc1,
|
||||
0x408e1f20,
|
||||
0x408ea145,
|
||||
0x408f262c,
|
||||
0x408fa3ff,
|
||||
0x409025e1,
|
||||
0x4090a311,
|
||||
0x409128f0,
|
||||
0x408ea152,
|
||||
0x408f2639,
|
||||
0x408fa40c,
|
||||
0x409025ee,
|
||||
0x4090a31e,
|
||||
0x409128fd,
|
||||
0x40919954,
|
||||
0x40921bbe,
|
||||
0x4092ac64,
|
||||
0x40932d26,
|
||||
0x4092acbf,
|
||||
0x40932d9f,
|
||||
0x4093a020,
|
||||
0x40941da3,
|
||||
0x4094a921,
|
||||
0x4095248d,
|
||||
0x4095ae90,
|
||||
0x40962c10,
|
||||
0x4094a92e,
|
||||
0x4095249a,
|
||||
0x4095af09,
|
||||
0x40962c6b,
|
||||
0x40969fc8,
|
||||
0x4097206b,
|
||||
0x40979f6f,
|
||||
0x40981c1e,
|
||||
0x4098a4a1,
|
||||
0x41f427c2,
|
||||
0x41f92854,
|
||||
0x41fe2747,
|
||||
0x41fea964,
|
||||
0x41ff2a55,
|
||||
0x420327db,
|
||||
0x420827fd,
|
||||
0x4208a839,
|
||||
0x4209272b,
|
||||
0x4209a873,
|
||||
0x420a2782,
|
||||
0x420aa762,
|
||||
0x420b27a2,
|
||||
0x420ba81b,
|
||||
0x420c2a71,
|
||||
0x420ca931,
|
||||
0x420d294b,
|
||||
0x420da982,
|
||||
0x4212299c,
|
||||
0x42172a38,
|
||||
0x4217a9de,
|
||||
0x421c2a00,
|
||||
0x421f29bb,
|
||||
0x42212a88,
|
||||
0x42262a1b,
|
||||
0x422b2b57,
|
||||
0x422bab05,
|
||||
0x422c2b3f,
|
||||
0x422caac4,
|
||||
0x422d2aa3,
|
||||
0x422dab24,
|
||||
0x422e2aea,
|
||||
0x4098a4ae,
|
||||
0x40992cdb,
|
||||
0x4099a093,
|
||||
0x41f427cf,
|
||||
0x41f92861,
|
||||
0x41fe2754,
|
||||
0x41feaa0a,
|
||||
0x41ff2b1f,
|
||||
0x420327e8,
|
||||
0x4208280a,
|
||||
0x4208a846,
|
||||
0x42092738,
|
||||
0x4209a880,
|
||||
0x420a278f,
|
||||
0x420aa76f,
|
||||
0x420b27af,
|
||||
0x420ba828,
|
||||
0x420c2b3b,
|
||||
0x420ca93e,
|
||||
0x420d29f1,
|
||||
0x420daa28,
|
||||
0x42122a42,
|
||||
0x42172b02,
|
||||
0x4217aa84,
|
||||
0x421c2aa6,
|
||||
0x421f2a61,
|
||||
0x42212bb3,
|
||||
0x42262ae5,
|
||||
0x422b2b91,
|
||||
0x422ba9cc,
|
||||
0x422c2b73,
|
||||
0x422ca97f,
|
||||
0x422d2958,
|
||||
0x422dab52,
|
||||
0x422e29ab,
|
||||
0x42302ac1,
|
||||
0x4432072d,
|
||||
0x4432873c,
|
||||
0x44330748,
|
||||
@@ -657,69 +660,69 @@ const uint32_t kOpenSSLReasonValues[] = {
|
||||
0x4c411557,
|
||||
0x4c4193da,
|
||||
0x4c421543,
|
||||
0x5032328e,
|
||||
0x5032b29d,
|
||||
0x503332a8,
|
||||
0x5033b2b8,
|
||||
0x503432d1,
|
||||
0x5034b2eb,
|
||||
0x503532f9,
|
||||
0x5035b30f,
|
||||
0x50363321,
|
||||
0x5036b337,
|
||||
0x50373350,
|
||||
0x5037b363,
|
||||
0x5038337b,
|
||||
0x5038b38c,
|
||||
0x503933a1,
|
||||
0x5039b3b5,
|
||||
0x503a33d5,
|
||||
0x503ab3eb,
|
||||
0x503b3403,
|
||||
0x503bb415,
|
||||
0x503c3431,
|
||||
0x503cb448,
|
||||
0x503d3461,
|
||||
0x503db477,
|
||||
0x503e3484,
|
||||
0x503eb49a,
|
||||
0x503f34ac,
|
||||
0x50323307,
|
||||
0x5032b316,
|
||||
0x50333321,
|
||||
0x5033b331,
|
||||
0x5034334a,
|
||||
0x5034b364,
|
||||
0x50353372,
|
||||
0x5035b388,
|
||||
0x5036339a,
|
||||
0x5036b3b0,
|
||||
0x503733c9,
|
||||
0x5037b3dc,
|
||||
0x503833f4,
|
||||
0x5038b405,
|
||||
0x5039341a,
|
||||
0x5039b42e,
|
||||
0x503a344e,
|
||||
0x503ab464,
|
||||
0x503b347c,
|
||||
0x503bb48e,
|
||||
0x503c34aa,
|
||||
0x503cb4c1,
|
||||
0x503d34da,
|
||||
0x503db4f0,
|
||||
0x503e34fd,
|
||||
0x503eb513,
|
||||
0x503f3525,
|
||||
0x503f837b,
|
||||
0x504034bf,
|
||||
0x5040b4cf,
|
||||
0x504134e9,
|
||||
0x5041b4f8,
|
||||
0x50423512,
|
||||
0x5042b52f,
|
||||
0x5043353f,
|
||||
0x5043b54f,
|
||||
0x5044355e,
|
||||
0x50403538,
|
||||
0x5040b548,
|
||||
0x50413562,
|
||||
0x5041b571,
|
||||
0x5042358b,
|
||||
0x5042b5a8,
|
||||
0x504335b8,
|
||||
0x5043b5c8,
|
||||
0x504435d7,
|
||||
0x50448431,
|
||||
0x50453572,
|
||||
0x5045b590,
|
||||
0x504635a3,
|
||||
0x5046b5b9,
|
||||
0x504735cb,
|
||||
0x5047b5e0,
|
||||
0x50483606,
|
||||
0x5048b614,
|
||||
0x50493627,
|
||||
0x5049b63c,
|
||||
0x504a3652,
|
||||
0x504ab662,
|
||||
0x504b3682,
|
||||
0x504bb695,
|
||||
0x504c36b8,
|
||||
0x504cb6e6,
|
||||
0x504d36f8,
|
||||
0x504db715,
|
||||
0x504e3730,
|
||||
0x504eb74c,
|
||||
0x504f375e,
|
||||
0x504fb775,
|
||||
0x50503784,
|
||||
0x504535eb,
|
||||
0x5045b609,
|
||||
0x5046361c,
|
||||
0x5046b632,
|
||||
0x50473644,
|
||||
0x5047b659,
|
||||
0x5048367f,
|
||||
0x5048b68d,
|
||||
0x504936a0,
|
||||
0x5049b6b5,
|
||||
0x504a36cb,
|
||||
0x504ab6db,
|
||||
0x504b36fb,
|
||||
0x504bb70e,
|
||||
0x504c3731,
|
||||
0x504cb75f,
|
||||
0x504d3771,
|
||||
0x504db78e,
|
||||
0x504e37a9,
|
||||
0x504eb7c5,
|
||||
0x504f37d7,
|
||||
0x504fb7ee,
|
||||
0x505037fd,
|
||||
0x505086f1,
|
||||
0x50513797,
|
||||
0x50513810,
|
||||
0x58320f65,
|
||||
0x68320f27,
|
||||
0x68328c7f,
|
||||
@@ -763,19 +766,19 @@ const uint32_t kOpenSSLReasonValues[] = {
|
||||
0x7c3211d7,
|
||||
0x803213ed,
|
||||
0x80328083,
|
||||
0x80332fe1,
|
||||
0x8033305a,
|
||||
0x803380ac,
|
||||
0x80342ff0,
|
||||
0x8034af58,
|
||||
0x80352f76,
|
||||
0x8035b004,
|
||||
0x80362fb8,
|
||||
0x8036af67,
|
||||
0x80372faa,
|
||||
0x8037af45,
|
||||
0x80382fcb,
|
||||
0x8038af87,
|
||||
0x80392f9c,
|
||||
0x80343069,
|
||||
0x8034afd1,
|
||||
0x80352fef,
|
||||
0x8035b07d,
|
||||
0x80363031,
|
||||
0x8036afe0,
|
||||
0x80373023,
|
||||
0x8037afbe,
|
||||
0x80383044,
|
||||
0x8038b000,
|
||||
0x80393015,
|
||||
};
|
||||
|
||||
const size_t kOpenSSLReasonValuesLen = sizeof(kOpenSSLReasonValues) / sizeof(kOpenSSLReasonValues[0]);
|
||||
@@ -1191,6 +1194,7 @@ const char kOpenSSLReasonStringData[] =
|
||||
"INVALID_TICKET_KEYS_LENGTH\0"
|
||||
"KEY_USAGE_BIT_INCORRECT\0"
|
||||
"LENGTH_MISMATCH\0"
|
||||
"MISSING_ALPN\0"
|
||||
"MISSING_EXTENSION\0"
|
||||
"MISSING_KEY_SHARE\0"
|
||||
"MISSING_RSA_CERTIFICATE\0"
|
||||
@@ -1278,6 +1282,10 @@ const char kOpenSSLReasonStringData[] =
|
||||
"TICKET_ENCRYPTION_FAILED\0"
|
||||
"TLS13_DOWNGRADE\0"
|
||||
"TLSV1_ALERT_ACCESS_DENIED\0"
|
||||
"TLSV1_ALERT_BAD_CERTIFICATE_HASH_VALUE\0"
|
||||
"TLSV1_ALERT_BAD_CERTIFICATE_STATUS_RESPONSE\0"
|
||||
"TLSV1_ALERT_CERTIFICATE_REQUIRED\0"
|
||||
"TLSV1_ALERT_CERTIFICATE_UNOBTAINABLE\0"
|
||||
"TLSV1_ALERT_DECODE_ERROR\0"
|
||||
"TLSV1_ALERT_DECRYPTION_FAILED\0"
|
||||
"TLSV1_ALERT_DECRYPT_ERROR\0"
|
||||
@@ -1285,18 +1293,15 @@ const char kOpenSSLReasonStringData[] =
|
||||
"TLSV1_ALERT_INAPPROPRIATE_FALLBACK\0"
|
||||
"TLSV1_ALERT_INSUFFICIENT_SECURITY\0"
|
||||
"TLSV1_ALERT_INTERNAL_ERROR\0"
|
||||
"TLSV1_ALERT_NO_APPLICATION_PROTOCOL\0"
|
||||
"TLSV1_ALERT_NO_RENEGOTIATION\0"
|
||||
"TLSV1_ALERT_PROTOCOL_VERSION\0"
|
||||
"TLSV1_ALERT_RECORD_OVERFLOW\0"
|
||||
"TLSV1_ALERT_UNKNOWN_CA\0"
|
||||
"TLSV1_ALERT_UNKNOWN_PSK_IDENTITY\0"
|
||||
"TLSV1_ALERT_UNRECOGNIZED_NAME\0"
|
||||
"TLSV1_ALERT_UNSUPPORTED_EXTENSION\0"
|
||||
"TLSV1_ALERT_USER_CANCELLED\0"
|
||||
"TLSV1_BAD_CERTIFICATE_HASH_VALUE\0"
|
||||
"TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\0"
|
||||
"TLSV1_CERTIFICATE_REQUIRED\0"
|
||||
"TLSV1_CERTIFICATE_UNOBTAINABLE\0"
|
||||
"TLSV1_UNKNOWN_PSK_IDENTITY\0"
|
||||
"TLSV1_UNRECOGNIZED_NAME\0"
|
||||
"TLSV1_UNSUPPORTED_EXTENSION\0"
|
||||
"TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\0"
|
||||
"TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG\0"
|
||||
"TOO_MANY_EMPTY_FRAGMENTS\0"
|
||||
@@ -1306,6 +1311,7 @@ const char kOpenSSLReasonStringData[] =
|
||||
"TOO_MUCH_SKIPPED_EARLY_DATA\0"
|
||||
"UNABLE_TO_FIND_ECDH_PARAMETERS\0"
|
||||
"UNCOMPRESSED_CERT_TOO_LARGE\0"
|
||||
"UNEXPECTED_COMPATIBILITY_MODE\0"
|
||||
"UNEXPECTED_EXTENSION\0"
|
||||
"UNEXPECTED_EXTENSION_ON_EARLY_DATA\0"
|
||||
"UNEXPECTED_MESSAGE\0"
|
||||
|
||||
@@ -407,6 +407,10 @@ EVP_PKEY *d2i_PUBKEY(EVP_PKEY **out, const uint8_t **inp, long len) {
|
||||
}
|
||||
|
||||
int i2d_PUBKEY(const EVP_PKEY *pkey, uint8_t **outp) {
|
||||
if (pkey == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
CBB cbb;
|
||||
if (!CBB_init(&cbb, 128) ||
|
||||
!EVP_marshal_public_key(&cbb, pkey)) {
|
||||
@@ -440,6 +444,10 @@ RSA *d2i_RSA_PUBKEY(RSA **out, const uint8_t **inp, long len) {
|
||||
}
|
||||
|
||||
int i2d_RSA_PUBKEY(const RSA *rsa, uint8_t **outp) {
|
||||
if (rsa == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = -1;
|
||||
EVP_PKEY *pkey = EVP_PKEY_new();
|
||||
if (pkey == NULL ||
|
||||
@@ -478,6 +486,10 @@ DSA *d2i_DSA_PUBKEY(DSA **out, const uint8_t **inp, long len) {
|
||||
}
|
||||
|
||||
int i2d_DSA_PUBKEY(const DSA *dsa, uint8_t **outp) {
|
||||
if (dsa == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = -1;
|
||||
EVP_PKEY *pkey = EVP_PKEY_new();
|
||||
if (pkey == NULL ||
|
||||
@@ -516,6 +528,10 @@ EC_KEY *d2i_EC_PUBKEY(EC_KEY **out, const uint8_t **inp, long len) {
|
||||
}
|
||||
|
||||
int i2d_EC_PUBKEY(const EC_KEY *ec_key, uint8_t **outp) {
|
||||
if (ec_key == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ret = -1;
|
||||
EVP_PKEY *pkey = EVP_PKEY_new();
|
||||
if (pkey == NULL ||
|
||||
|
||||
@@ -141,9 +141,13 @@ static int dsa_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) {
|
||||
goto err;
|
||||
}
|
||||
|
||||
// Decode the key.
|
||||
// Decode the key. To avoid DoS attacks when importing private keys, we bound
|
||||
// |dsa->priv_key| against |dsa->q|, which itself bound by
|
||||
// |DSA_parse_parameters|. (We cannot call |BN_num_bits| on |dsa->priv_key|.
|
||||
// That would leak a secret bit width.)
|
||||
if (!BN_parse_asn1_unsigned(key, dsa->priv_key) ||
|
||||
CBS_len(key) != 0) {
|
||||
CBS_len(key) != 0 ||
|
||||
BN_cmp(dsa->priv_key, dsa->q) >= 0) {
|
||||
OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR);
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ Lrcon:
|
||||
.align 5
|
||||
_aes_hw_set_encrypt_key:
|
||||
Lenc_key:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
mov x3,#-1
|
||||
@@ -202,6 +204,7 @@ Lenc_key_abort:
|
||||
|
||||
.align 5
|
||||
_aes_hw_set_decrypt_key:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
bl Lenc_key
|
||||
@@ -235,6 +238,7 @@ Loop_imc:
|
||||
eor x0,x0,x0 // return value
|
||||
Ldec_key_abort:
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
.globl _aes_hw_encrypt
|
||||
@@ -242,6 +246,7 @@ Ldec_key_abort:
|
||||
|
||||
.align 5
|
||||
_aes_hw_encrypt:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ldr w3,[x2,#240]
|
||||
ld1 {v0.4s},[x2],#16
|
||||
ld1 {v2.16b},[x0]
|
||||
@@ -272,6 +277,7 @@ Loop_enc:
|
||||
|
||||
.align 5
|
||||
_aes_hw_decrypt:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ldr w3,[x2,#240]
|
||||
ld1 {v0.4s},[x2],#16
|
||||
ld1 {v2.16b},[x0]
|
||||
@@ -302,6 +308,8 @@ Loop_dec:
|
||||
|
||||
.align 5
|
||||
_aes_hw_cbc_encrypt:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
subs x2,x2,#16
|
||||
@@ -593,6 +601,8 @@ Lcbc_abort:
|
||||
|
||||
.align 5
|
||||
_aes_hw_ctr32_encrypt_blocks:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
ldr w5,[x3,#240]
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
.align 5
|
||||
aes_hw_set_encrypt_key:
|
||||
.Lenc_key:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
mov x3,#-1
|
||||
@@ -203,6 +205,7 @@ aes_hw_set_encrypt_key:
|
||||
.type aes_hw_set_decrypt_key,%function
|
||||
.align 5
|
||||
aes_hw_set_decrypt_key:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
bl .Lenc_key
|
||||
@@ -236,6 +239,7 @@ aes_hw_set_decrypt_key:
|
||||
eor x0,x0,x0 // return value
|
||||
.Ldec_key_abort:
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size aes_hw_set_decrypt_key,.-aes_hw_set_decrypt_key
|
||||
.globl aes_hw_encrypt
|
||||
@@ -243,6 +247,7 @@ aes_hw_set_decrypt_key:
|
||||
.type aes_hw_encrypt,%function
|
||||
.align 5
|
||||
aes_hw_encrypt:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ldr w3,[x2,#240]
|
||||
ld1 {v0.4s},[x2],#16
|
||||
ld1 {v2.16b},[x0]
|
||||
@@ -273,6 +278,7 @@ aes_hw_encrypt:
|
||||
.type aes_hw_decrypt,%function
|
||||
.align 5
|
||||
aes_hw_decrypt:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ldr w3,[x2,#240]
|
||||
ld1 {v0.4s},[x2],#16
|
||||
ld1 {v2.16b},[x0]
|
||||
@@ -303,6 +309,8 @@ aes_hw_decrypt:
|
||||
.type aes_hw_cbc_encrypt,%function
|
||||
.align 5
|
||||
aes_hw_cbc_encrypt:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
subs x2,x2,#16
|
||||
@@ -594,6 +602,8 @@ aes_hw_cbc_encrypt:
|
||||
.type aes_hw_ctr32_encrypt_blocks,%function
|
||||
.align 5
|
||||
aes_hw_ctr32_encrypt_blocks:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
ldr w5,[x3,#240]
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CNIOBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
#include <CNIOBoringSSL_arm_arch.h>
|
||||
|
||||
.text
|
||||
|
||||
.globl _bn_mul_mont
|
||||
@@ -21,6 +23,7 @@
|
||||
|
||||
.align 5
|
||||
_bn_mul_mont:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
tst x5,#7
|
||||
b.eq __bn_sqr8x_mont
|
||||
tst x5,#3
|
||||
@@ -218,11 +221,14 @@ Lcond_copy:
|
||||
mov x0,#1
|
||||
ldp x23,x24,[x29,#48]
|
||||
ldr x29,[sp],#64
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
.align 5
|
||||
__bn_sqr8x_mont:
|
||||
// Not adding AARCH64_SIGN_LINK_REGISTER here because __bn_sqr8x_mont is jumped to
|
||||
// only from bn_mul_mont which has already signed the return address.
|
||||
cmp x1,x2
|
||||
b.ne __bn_mul4x_mont
|
||||
Lsqr8x_mont:
|
||||
@@ -976,11 +982,16 @@ Lsqr8x_done:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldr x29,[sp],#128
|
||||
// x30 is popped earlier
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
.align 5
|
||||
__bn_mul4x_mont:
|
||||
// Not adding AARCH64_SIGN_LINK_REGISTER here because __bn_mul4x_mont is jumped to
|
||||
// only from bn_mul_mont or __bn_mul8x_mont which have already signed the
|
||||
// return address.
|
||||
stp x29,x30,[sp,#-128]!
|
||||
add x29,sp,#0
|
||||
stp x19,x20,[sp,#16]
|
||||
@@ -1414,6 +1425,8 @@ Lmul4x_done:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldr x29,[sp],#128
|
||||
// x30 is popped earlier
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
.byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CNIOBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
#include <CNIOBoringSSL_arm_arch.h>
|
||||
|
||||
.text
|
||||
|
||||
.globl bn_mul_mont
|
||||
@@ -22,6 +24,7 @@
|
||||
.type bn_mul_mont,%function
|
||||
.align 5
|
||||
bn_mul_mont:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
tst x5,#7
|
||||
b.eq __bn_sqr8x_mont
|
||||
tst x5,#3
|
||||
@@ -219,11 +222,14 @@ bn_mul_mont:
|
||||
mov x0,#1
|
||||
ldp x23,x24,[x29,#48]
|
||||
ldr x29,[sp],#64
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size bn_mul_mont,.-bn_mul_mont
|
||||
.type __bn_sqr8x_mont,%function
|
||||
.align 5
|
||||
__bn_sqr8x_mont:
|
||||
// Not adding AARCH64_SIGN_LINK_REGISTER here because __bn_sqr8x_mont is jumped to
|
||||
// only from bn_mul_mont which has already signed the return address.
|
||||
cmp x1,x2
|
||||
b.ne __bn_mul4x_mont
|
||||
.Lsqr8x_mont:
|
||||
@@ -977,11 +983,16 @@ __bn_sqr8x_mont:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldr x29,[sp],#128
|
||||
// x30 is popped earlier
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size __bn_sqr8x_mont,.-__bn_sqr8x_mont
|
||||
.type __bn_mul4x_mont,%function
|
||||
.align 5
|
||||
__bn_mul4x_mont:
|
||||
// Not adding AARCH64_SIGN_LINK_REGISTER here because __bn_mul4x_mont is jumped to
|
||||
// only from bn_mul_mont or __bn_mul8x_mont which have already signed the
|
||||
// return address.
|
||||
stp x29,x30,[sp,#-128]!
|
||||
add x29,sp,#0
|
||||
stp x19,x20,[sp,#16]
|
||||
@@ -1415,6 +1426,8 @@ __bn_mul4x_mont:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldr x29,[sp],#128
|
||||
// x30 is popped earlier
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size __bn_mul4x_mont,.-__bn_mul4x_mont
|
||||
.byte 77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CNIOBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
#include <CNIOBoringSSL_arm_arch.h>
|
||||
|
||||
.text
|
||||
|
||||
.globl _gcm_init_neon
|
||||
@@ -21,6 +23,7 @@
|
||||
|
||||
.align 4
|
||||
_gcm_init_neon:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
// This function is adapted from gcm_init_v8. xC2 is t3.
|
||||
ld1 {v17.2d}, [x1] // load H
|
||||
movi v19.16b, #0xe1
|
||||
@@ -46,6 +49,7 @@ _gcm_init_neon:
|
||||
|
||||
.align 4
|
||||
_gcm_gmult_neon:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v3.16b}, [x0] // load Xi
|
||||
ld1 {v5.1d}, [x1], #8 // load twisted H
|
||||
ld1 {v6.1d}, [x1]
|
||||
@@ -65,6 +69,7 @@ _gcm_gmult_neon:
|
||||
|
||||
.align 4
|
||||
_gcm_ghash_neon:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v0.16b}, [x0] // load Xi
|
||||
ld1 {v5.1d}, [x1], #8 // load twisted H
|
||||
ld1 {v6.1d}, [x1]
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CNIOBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
#include <CNIOBoringSSL_arm_arch.h>
|
||||
|
||||
.text
|
||||
|
||||
.globl gcm_init_neon
|
||||
@@ -22,6 +24,7 @@
|
||||
.type gcm_init_neon,%function
|
||||
.align 4
|
||||
gcm_init_neon:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
// This function is adapted from gcm_init_v8. xC2 is t3.
|
||||
ld1 {v17.2d}, [x1] // load H
|
||||
movi v19.16b, #0xe1
|
||||
@@ -47,6 +50,7 @@ gcm_init_neon:
|
||||
.type gcm_gmult_neon,%function
|
||||
.align 4
|
||||
gcm_gmult_neon:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v3.16b}, [x0] // load Xi
|
||||
ld1 {v5.1d}, [x1], #8 // load twisted H
|
||||
ld1 {v6.1d}, [x1]
|
||||
@@ -66,6 +70,7 @@ gcm_gmult_neon:
|
||||
.type gcm_ghash_neon,%function
|
||||
.align 4
|
||||
gcm_ghash_neon:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v0.16b}, [x0] // load Xi
|
||||
ld1 {v5.1d}, [x1], #8 // load twisted H
|
||||
ld1 {v6.1d}, [x1]
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
.align 4
|
||||
_gcm_init_v8:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v17.2d},[x1] //load input H
|
||||
movi v19.16b,#0xe1
|
||||
shl v19.2d,v19.2d,#57 //0xc2.0
|
||||
@@ -74,6 +75,7 @@ _gcm_init_v8:
|
||||
|
||||
.align 4
|
||||
_gcm_gmult_v8:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v17.2d},[x0] //load Xi
|
||||
movi v19.16b,#0xe1
|
||||
ld1 {v20.2d,v21.2d},[x1] //load twisted H, ...
|
||||
@@ -116,6 +118,7 @@ _gcm_gmult_v8:
|
||||
|
||||
.align 4
|
||||
_gcm_ghash_v8:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v0.2d},[x0] //load [rotated] Xi
|
||||
//"[rotated]" means that
|
||||
//loaded value would have
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
.type gcm_init_v8,%function
|
||||
.align 4
|
||||
gcm_init_v8:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v17.2d},[x1] //load input H
|
||||
movi v19.16b,#0xe1
|
||||
shl v19.2d,v19.2d,#57 //0xc2.0
|
||||
@@ -75,6 +76,7 @@ gcm_init_v8:
|
||||
.type gcm_gmult_v8,%function
|
||||
.align 4
|
||||
gcm_gmult_v8:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v17.2d},[x0] //load Xi
|
||||
movi v19.16b,#0xe1
|
||||
ld1 {v20.2d,v21.2d},[x1] //load twisted H, ...
|
||||
@@ -117,6 +119,7 @@ gcm_gmult_v8:
|
||||
.type gcm_ghash_v8,%function
|
||||
.align 4
|
||||
gcm_ghash_v8:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
ld1 {v0.2d},[x0] //load [rotated] Xi
|
||||
//"[rotated]" means that
|
||||
//loaded value would have
|
||||
|
||||
@@ -108,6 +108,10 @@ int RSA_padding_check_PKCS1_OAEP_mgf1(uint8_t *out, size_t *out_len,
|
||||
int RSA_padding_add_none(uint8_t *to, size_t to_len, const uint8_t *from,
|
||||
size_t from_len);
|
||||
|
||||
// rsa_check_public_key checks that |rsa|'s public modulus and exponent are
|
||||
// within DoS bounds.
|
||||
int rsa_check_public_key(const RSA *rsa);
|
||||
|
||||
// RSA_private_transform calls either the method-specific |private_transform|
|
||||
// function (if given) or the generic one. See the comment for
|
||||
// |private_transform| in |rsa_meth_st|.
|
||||
|
||||
@@ -661,6 +661,9 @@ static int check_mod_inverse(int *out_ok, const BIGNUM *a, const BIGNUM *ainv,
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Note |bn_mul_consttime| and |bn_div_consttime| do not scale linearly, but
|
||||
// checking |ainv| is in range bounds the running time, assuming |m|'s bounds
|
||||
// were checked by the caller.
|
||||
BN_CTX_start(ctx);
|
||||
BIGNUM *tmp = BN_CTX_get(ctx);
|
||||
int ret = tmp != NULL &&
|
||||
@@ -674,22 +677,35 @@ static int check_mod_inverse(int *out_ok, const BIGNUM *a, const BIGNUM *ainv,
|
||||
}
|
||||
|
||||
int RSA_check_key(const RSA *key) {
|
||||
// TODO(davidben): RSA key initialization is spread across
|
||||
// |rsa_check_public_key|, |RSA_check_key|, |freeze_private_key|, and
|
||||
// |BN_MONT_CTX_set_locked| as a result of API issues. See
|
||||
// https://crbug.com/boringssl/316. As a result, we inconsistently check RSA
|
||||
// invariants. We should fix this and integrate that logic.
|
||||
|
||||
if (RSA_is_opaque(key)) {
|
||||
// Opaque keys can't be checked.
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!rsa_check_public_key(key)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((key->p != NULL) != (key->q != NULL)) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_ONLY_ONE_OF_P_Q_GIVEN);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!key->n || !key->e) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING);
|
||||
// |key->d| must be bounded by |key->n|. This ensures bounds on |RSA_bits|
|
||||
// translate to bounds on the running time of private key operations.
|
||||
if (key->d != NULL &&
|
||||
(BN_is_negative(key->d) || BN_cmp(key->d, key->n) >= 0)) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_D_OUT_OF_RANGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!key->d || !key->p) {
|
||||
if (key->d == NULL || key->p == NULL) {
|
||||
// For a public key, or without p and q, there's nothing that can be
|
||||
// checked.
|
||||
return 1;
|
||||
@@ -709,24 +725,28 @@ int RSA_check_key(const RSA *key) {
|
||||
BN_init(&qm1);
|
||||
BN_init(&dmp1);
|
||||
BN_init(&dmq1);
|
||||
|
||||
// Check that p * q == n. Before we multiply, we check that p and q are in
|
||||
// bounds, to avoid a DoS vector in |bn_mul_consttime| below. Note that
|
||||
// n was bound by |rsa_check_public_key|.
|
||||
if (BN_is_negative(key->p) || BN_cmp(key->p, key->n) >= 0 ||
|
||||
BN_is_negative(key->q) || BN_cmp(key->q, key->n) >= 0) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_N_NOT_EQUAL_P_Q);
|
||||
goto out;
|
||||
}
|
||||
if (!bn_mul_consttime(&tmp, key->p, key->q, ctx)) {
|
||||
OPENSSL_PUT_ERROR(RSA, ERR_LIB_BN);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (BN_cmp(&tmp, key->n) != 0) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_N_NOT_EQUAL_P_Q);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (BN_is_negative(key->d) || BN_cmp(key->d, key->n) >= 0) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_D_OUT_OF_RANGE);
|
||||
goto out;
|
||||
}
|
||||
|
||||
// d must be an inverse of e mod the Carmichael totient, lcm(p-1, q-1), but it
|
||||
// may be unreduced because other implementations use the Euler totient. We
|
||||
// simply check that d * e is one mod p-1 and mod q-1.
|
||||
// simply check that d * e is one mod p-1 and mod q-1. Note d and e were bound
|
||||
// by earlier checks in this function.
|
||||
if (!bn_usub_consttime(&pm1, key->p, BN_value_one()) ||
|
||||
!bn_usub_consttime(&qm1, key->q, BN_value_one()) ||
|
||||
!bn_mul_consttime(&de, key->d, key->e, ctx) ||
|
||||
|
||||
@@ -73,7 +73,12 @@
|
||||
#include "../rand/fork_detect.h"
|
||||
|
||||
|
||||
static int check_modulus_and_exponent_sizes(const RSA *rsa) {
|
||||
int rsa_check_public_key(const RSA *rsa) {
|
||||
if (rsa->n == NULL || rsa->e == NULL) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING);
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned rsa_bits = BN_num_bits(rsa->n);
|
||||
|
||||
if (rsa_bits > 16 * 1024) {
|
||||
@@ -253,8 +258,7 @@ size_t rsa_default_size(const RSA *rsa) {
|
||||
|
||||
int RSA_encrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
|
||||
const uint8_t *in, size_t in_len, int padding) {
|
||||
if (rsa->n == NULL || rsa->e == NULL) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING);
|
||||
if (!rsa_check_public_key(rsa)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -269,10 +273,6 @@ int RSA_encrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!check_modulus_and_exponent_sizes(rsa)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
ctx = BN_CTX_new();
|
||||
if (ctx == NULL) {
|
||||
goto err;
|
||||
@@ -592,8 +592,7 @@ static int mod_exp(BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx);
|
||||
|
||||
int RSA_verify_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
|
||||
const uint8_t *in, size_t in_len, int padding) {
|
||||
if (rsa->n == NULL || rsa->e == NULL) {
|
||||
OPENSSL_PUT_ERROR(RSA, RSA_R_VALUE_MISSING);
|
||||
if (!rsa_check_public_key(rsa)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -610,10 +609,6 @@ int RSA_verify_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!check_modulus_and_exponent_sizes(rsa)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
BN_CTX *ctx = BN_CTX_new();
|
||||
if (ctx == NULL) {
|
||||
return 0;
|
||||
@@ -1121,8 +1116,8 @@ static int rsa_generate_key_impl(RSA *rsa, int bits, const BIGNUM *e_value,
|
||||
|
||||
// Reject excessively large public exponents. Windows CryptoAPI and Go don't
|
||||
// support values larger than 32 bits, so match their limits for generating
|
||||
// keys. (|check_modulus_and_exponent_sizes| uses a slightly more conservative
|
||||
// value, but we don't need to support generating such keys.)
|
||||
// keys. (|rsa_check_public_key| uses a slightly more conservative value, but
|
||||
// we don't need to support generating such keys.)
|
||||
// https://github.com/golang/go/issues/3161
|
||||
// https://msdn.microsoft.com/en-us/library/aa387685(VS.85).aspx
|
||||
if (BN_num_bits(e_value) > 32) {
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
|
||||
.align 6
|
||||
_sha1_block_data_order:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
|
||||
adrp x16,:pg_hi21_nc:_OPENSSL_armcap_P
|
||||
#else
|
||||
@@ -1091,6 +1093,8 @@ Loop:
|
||||
|
||||
.align 6
|
||||
sha1_block_armv8:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
Lv8_entry:
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
.type sha1_block_data_order,%function
|
||||
.align 6
|
||||
sha1_block_data_order:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
|
||||
adrp x16,:pg_hi21_nc:OPENSSL_armcap_P
|
||||
#else
|
||||
@@ -1092,6 +1094,8 @@ sha1_block_data_order:
|
||||
.type sha1_block_armv8,%function
|
||||
.align 6
|
||||
sha1_block_armv8:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
.Lv8_entry:
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
.align 6
|
||||
_sha256_block_data_order:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
#ifndef __KERNEL__
|
||||
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
|
||||
adrp x16,:pg_hi21_nc:_OPENSSL_armcap_P
|
||||
@@ -75,6 +76,7 @@ _sha256_block_data_order:
|
||||
tst w16,#ARMV8_SHA256
|
||||
b.ne Lv8_entry
|
||||
#endif
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-128]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -1035,6 +1037,7 @@ Loop_16_xx:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#128
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
@@ -1069,6 +1072,7 @@ LK256:
|
||||
.align 6
|
||||
sha256_block_armv8:
|
||||
Lv8_entry:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
.type sha256_block_data_order,%function
|
||||
.align 6
|
||||
sha256_block_data_order:
|
||||
AARCH64_VALID_CALL_TARGET
|
||||
#ifndef __KERNEL__
|
||||
#if __has_feature(hwaddress_sanitizer) && __clang_major__ >= 10
|
||||
adrp x16,:pg_hi21_nc:OPENSSL_armcap_P
|
||||
@@ -76,6 +77,7 @@ sha256_block_data_order:
|
||||
tst w16,#ARMV8_SHA256
|
||||
b.ne .Lv8_entry
|
||||
#endif
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-128]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -1036,6 +1038,7 @@ sha256_block_data_order:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#128
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size sha256_block_data_order,.-sha256_block_data_order
|
||||
|
||||
@@ -1070,6 +1073,7 @@ sha256_block_data_order:
|
||||
.align 6
|
||||
sha256_block_armv8:
|
||||
.Lv8_entry:
|
||||
// Armv8.3-A PAuth: even though x30 is pushed to stack it is not popped later.
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
|
||||
.align 6
|
||||
_sha512_block_data_order:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-128]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -1025,6 +1026,7 @@ Loop_16_xx:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#128
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@
|
||||
.type sha512_block_data_order,%function
|
||||
.align 6
|
||||
sha512_block_data_order:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-128]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -1026,6 +1027,7 @@ sha512_block_data_order:
|
||||
ldp x25,x26,[x29,#64]
|
||||
ldp x27,x28,[x29,#80]
|
||||
ldp x29,x30,[sp],#128
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size sha512_block_data_order,.-sha512_block_data_order
|
||||
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CNIOBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
#include <CNIOBoringSSL_arm_arch.h>
|
||||
|
||||
.section __TEXT,__const
|
||||
|
||||
|
||||
@@ -216,6 +218,7 @@ Lenc_entry:
|
||||
|
||||
.align 4
|
||||
_vpaes_encrypt:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -225,6 +228,7 @@ _vpaes_encrypt:
|
||||
st1 {v0.16b}, [x1]
|
||||
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
@@ -453,6 +457,7 @@ Ldec_entry:
|
||||
|
||||
.align 4
|
||||
_vpaes_decrypt:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -462,6 +467,7 @@ _vpaes_decrypt:
|
||||
st1 {v0.16b}, [x1]
|
||||
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
@@ -631,6 +637,7 @@ _vpaes_key_preheat:
|
||||
|
||||
.align 4
|
||||
_vpaes_schedule_core:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29, x30, [sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -800,6 +807,7 @@ Lschedule_mangle_last_dec:
|
||||
eor v6.16b, v6.16b, v6.16b // vpxor %xmm6, %xmm6, %xmm6
|
||||
eor v7.16b, v7.16b, v7.16b // vpxor %xmm7, %xmm7, %xmm7
|
||||
ldp x29, x30, [sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
@@ -1013,6 +1021,7 @@ Lschedule_mangle_both:
|
||||
|
||||
.align 4
|
||||
_vpaes_set_encrypt_key:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
stp d8,d9,[sp,#-16]! // ABI spec says so
|
||||
@@ -1028,6 +1037,7 @@ _vpaes_set_encrypt_key:
|
||||
|
||||
ldp d8,d9,[sp],#16
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
|
||||
@@ -1036,6 +1046,7 @@ _vpaes_set_encrypt_key:
|
||||
|
||||
.align 4
|
||||
_vpaes_set_decrypt_key:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
stp d8,d9,[sp,#-16]! // ABI spec says so
|
||||
@@ -1055,6 +1066,7 @@ _vpaes_set_decrypt_key:
|
||||
|
||||
ldp d8,d9,[sp],#16
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
.globl _vpaes_cbc_encrypt
|
||||
@@ -1062,6 +1074,7 @@ _vpaes_set_decrypt_key:
|
||||
|
||||
.align 4
|
||||
_vpaes_cbc_encrypt:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
cbz x2, Lcbc_abort
|
||||
cmp w5, #0 // check direction
|
||||
b.eq vpaes_cbc_decrypt
|
||||
@@ -1088,6 +1101,7 @@ Lcbc_enc_loop:
|
||||
st1 {v0.16b}, [x4] // write ivec
|
||||
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
Lcbc_abort:
|
||||
ret
|
||||
|
||||
@@ -1095,6 +1109,8 @@ Lcbc_abort:
|
||||
|
||||
.align 4
|
||||
vpaes_cbc_decrypt:
|
||||
// Not adding AARCH64_SIGN_LINK_REGISTER here because vpaes_cbc_decrypt is jumped to
|
||||
// only from vpaes_cbc_encrypt which has already signed the return address.
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
stp d8,d9,[sp,#-16]! // ABI spec says so
|
||||
@@ -1136,6 +1152,7 @@ Lcbc_dec_done:
|
||||
ldp d10,d11,[sp],#16
|
||||
ldp d8,d9,[sp],#16
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
.globl _vpaes_ctr32_encrypt_blocks
|
||||
@@ -1143,6 +1160,7 @@ Lcbc_dec_done:
|
||||
|
||||
.align 4
|
||||
_vpaes_ctr32_encrypt_blocks:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
stp d8,d9,[sp,#-16]! // ABI spec says so
|
||||
@@ -1210,6 +1228,7 @@ Lctr32_done:
|
||||
ldp d10,d11,[sp],#16
|
||||
ldp d8,d9,[sp],#16
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
|
||||
#endif // !OPENSSL_NO_ASM
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
#if defined(BORINGSSL_PREFIX)
|
||||
#include <CNIOBoringSSL_boringssl_prefix_symbols_asm.h>
|
||||
#endif
|
||||
#include <CNIOBoringSSL_arm_arch.h>
|
||||
|
||||
.section .rodata
|
||||
|
||||
.type _vpaes_consts,%object
|
||||
@@ -217,6 +219,7 @@ _vpaes_encrypt_core:
|
||||
.type vpaes_encrypt,%function
|
||||
.align 4
|
||||
vpaes_encrypt:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -226,6 +229,7 @@ vpaes_encrypt:
|
||||
st1 {v0.16b}, [x1]
|
||||
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size vpaes_encrypt,.-vpaes_encrypt
|
||||
|
||||
@@ -454,6 +458,7 @@ _vpaes_decrypt_core:
|
||||
.type vpaes_decrypt,%function
|
||||
.align 4
|
||||
vpaes_decrypt:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -463,6 +468,7 @@ vpaes_decrypt:
|
||||
st1 {v0.16b}, [x1]
|
||||
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size vpaes_decrypt,.-vpaes_decrypt
|
||||
|
||||
@@ -632,6 +638,7 @@ _vpaes_key_preheat:
|
||||
.type _vpaes_schedule_core,%function
|
||||
.align 4
|
||||
_vpaes_schedule_core:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29, x30, [sp,#-16]!
|
||||
add x29,sp,#0
|
||||
|
||||
@@ -801,6 +808,7 @@ _vpaes_schedule_core:
|
||||
eor v6.16b, v6.16b, v6.16b // vpxor %xmm6, %xmm6, %xmm6
|
||||
eor v7.16b, v7.16b, v7.16b // vpxor %xmm7, %xmm7, %xmm7
|
||||
ldp x29, x30, [sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size _vpaes_schedule_core,.-_vpaes_schedule_core
|
||||
|
||||
@@ -1014,6 +1022,7 @@ _vpaes_schedule_mangle:
|
||||
.type vpaes_set_encrypt_key,%function
|
||||
.align 4
|
||||
vpaes_set_encrypt_key:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
stp d8,d9,[sp,#-16]! // ABI spec says so
|
||||
@@ -1029,6 +1038,7 @@ vpaes_set_encrypt_key:
|
||||
|
||||
ldp d8,d9,[sp],#16
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size vpaes_set_encrypt_key,.-vpaes_set_encrypt_key
|
||||
|
||||
@@ -1037,6 +1047,7 @@ vpaes_set_encrypt_key:
|
||||
.type vpaes_set_decrypt_key,%function
|
||||
.align 4
|
||||
vpaes_set_decrypt_key:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
stp d8,d9,[sp,#-16]! // ABI spec says so
|
||||
@@ -1056,6 +1067,7 @@ vpaes_set_decrypt_key:
|
||||
|
||||
ldp d8,d9,[sp],#16
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size vpaes_set_decrypt_key,.-vpaes_set_decrypt_key
|
||||
.globl vpaes_cbc_encrypt
|
||||
@@ -1063,6 +1075,7 @@ vpaes_set_decrypt_key:
|
||||
.type vpaes_cbc_encrypt,%function
|
||||
.align 4
|
||||
vpaes_cbc_encrypt:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
cbz x2, .Lcbc_abort
|
||||
cmp w5, #0 // check direction
|
||||
b.eq vpaes_cbc_decrypt
|
||||
@@ -1089,6 +1102,7 @@ vpaes_cbc_encrypt:
|
||||
st1 {v0.16b}, [x4] // write ivec
|
||||
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
.Lcbc_abort:
|
||||
ret
|
||||
.size vpaes_cbc_encrypt,.-vpaes_cbc_encrypt
|
||||
@@ -1096,6 +1110,8 @@ vpaes_cbc_encrypt:
|
||||
.type vpaes_cbc_decrypt,%function
|
||||
.align 4
|
||||
vpaes_cbc_decrypt:
|
||||
// Not adding AARCH64_SIGN_LINK_REGISTER here because vpaes_cbc_decrypt is jumped to
|
||||
// only from vpaes_cbc_encrypt which has already signed the return address.
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
stp d8,d9,[sp,#-16]! // ABI spec says so
|
||||
@@ -1137,6 +1153,7 @@ vpaes_cbc_decrypt:
|
||||
ldp d10,d11,[sp],#16
|
||||
ldp d8,d9,[sp],#16
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size vpaes_cbc_decrypt,.-vpaes_cbc_decrypt
|
||||
.globl vpaes_ctr32_encrypt_blocks
|
||||
@@ -1144,6 +1161,7 @@ vpaes_cbc_decrypt:
|
||||
.type vpaes_ctr32_encrypt_blocks,%function
|
||||
.align 4
|
||||
vpaes_ctr32_encrypt_blocks:
|
||||
AARCH64_SIGN_LINK_REGISTER
|
||||
stp x29,x30,[sp,#-16]!
|
||||
add x29,sp,#0
|
||||
stp d8,d9,[sp,#-16]! // ABI spec says so
|
||||
@@ -1211,6 +1229,7 @@ vpaes_ctr32_encrypt_blocks:
|
||||
ldp d10,d11,[sp],#16
|
||||
ldp d8,d9,[sp],#16
|
||||
ldp x29,x30,[sp],#16
|
||||
AARCH64_VALIDATE_LINK_REGISTER
|
||||
ret
|
||||
.size vpaes_ctr32_encrypt_blocks,.-vpaes_ctr32_encrypt_blocks
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,456 @@
|
||||
/* Copyright (c) 2020, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <CNIOBoringSSL_aead.h>
|
||||
#include <CNIOBoringSSL_bytestring.h>
|
||||
#include <CNIOBoringSSL_digest.h>
|
||||
#include <CNIOBoringSSL_err.h>
|
||||
#include <CNIOBoringSSL_evp.h>
|
||||
#include <CNIOBoringSSL_hkdf.h>
|
||||
#include <CNIOBoringSSL_sha.h>
|
||||
|
||||
#include "../internal.h"
|
||||
#include "internal.h"
|
||||
|
||||
|
||||
// This file implements draft-irtf-cfrg-hpke-05.
|
||||
|
||||
#define KEM_CONTEXT_LEN (2 * X25519_PUBLIC_VALUE_LEN)
|
||||
|
||||
// HPKE KEM scheme IDs.
|
||||
#define HPKE_DHKEM_X25519_HKDF_SHA256 0x0020
|
||||
|
||||
// This is strlen("HPKE") + 3 * sizeof(uint16_t).
|
||||
#define HPKE_SUITE_ID_LEN 10
|
||||
|
||||
#define HPKE_MODE_BASE 0
|
||||
|
||||
static const char kHpkeRfcId[] = "HPKE-05 ";
|
||||
|
||||
static int add_label_string(CBB *cbb, const char *label) {
|
||||
return CBB_add_bytes(cbb, (const uint8_t *)label, strlen(label));
|
||||
}
|
||||
|
||||
// The suite_id for the KEM is defined as concat("KEM", I2OSP(kem_id, 2)). Note
|
||||
// that the suite_id used outside of the KEM also includes the kdf_id and
|
||||
// aead_id.
|
||||
static const uint8_t kX25519SuiteID[] = {
|
||||
'K', 'E', 'M', HPKE_DHKEM_X25519_HKDF_SHA256 >> 8,
|
||||
HPKE_DHKEM_X25519_HKDF_SHA256 & 0x00ff};
|
||||
|
||||
// The suite_id for non-KEM pieces of HPKE is defined as concat("HPKE",
|
||||
// I2OSP(kem_id, 2), I2OSP(kdf_id, 2), I2OSP(aead_id, 2)).
|
||||
static int hpke_build_suite_id(uint8_t out[HPKE_SUITE_ID_LEN], uint16_t kdf_id,
|
||||
uint16_t aead_id) {
|
||||
CBB cbb;
|
||||
int ret = CBB_init_fixed(&cbb, out, HPKE_SUITE_ID_LEN) &&
|
||||
add_label_string(&cbb, "HPKE") &&
|
||||
CBB_add_u16(&cbb, HPKE_DHKEM_X25519_HKDF_SHA256) &&
|
||||
CBB_add_u16(&cbb, kdf_id) &&
|
||||
CBB_add_u16(&cbb, aead_id);
|
||||
CBB_cleanup(&cbb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int hpke_labeled_extract(const EVP_MD *hkdf_md, uint8_t *out_key,
|
||||
size_t *out_len, const uint8_t *salt,
|
||||
size_t salt_len, const uint8_t *suite_id,
|
||||
size_t suite_id_len, const char *label,
|
||||
const uint8_t *ikm, size_t ikm_len) {
|
||||
// labeledIKM = concat("RFCXXXX ", suite_id, label, IKM)
|
||||
CBB labeled_ikm;
|
||||
int ok = CBB_init(&labeled_ikm, 0) &&
|
||||
add_label_string(&labeled_ikm, kHpkeRfcId) &&
|
||||
CBB_add_bytes(&labeled_ikm, suite_id, suite_id_len) &&
|
||||
add_label_string(&labeled_ikm, label) &&
|
||||
CBB_add_bytes(&labeled_ikm, ikm, ikm_len) &&
|
||||
HKDF_extract(out_key, out_len, hkdf_md, CBB_data(&labeled_ikm),
|
||||
CBB_len(&labeled_ikm), salt, salt_len);
|
||||
CBB_cleanup(&labeled_ikm);
|
||||
return ok;
|
||||
}
|
||||
|
||||
static int hpke_labeled_expand(const EVP_MD *hkdf_md, uint8_t *out_key,
|
||||
size_t out_len, const uint8_t *prk,
|
||||
size_t prk_len, const uint8_t *suite_id,
|
||||
size_t suite_id_len, const char *label,
|
||||
const uint8_t *info, size_t info_len) {
|
||||
// labeledInfo = concat(I2OSP(L, 2), "RFCXXXX ", suite_id, label, info)
|
||||
CBB labeled_info;
|
||||
int ok = CBB_init(&labeled_info, 0) &&
|
||||
CBB_add_u16(&labeled_info, out_len) &&
|
||||
add_label_string(&labeled_info, kHpkeRfcId) &&
|
||||
CBB_add_bytes(&labeled_info, suite_id, suite_id_len) &&
|
||||
add_label_string(&labeled_info, label) &&
|
||||
CBB_add_bytes(&labeled_info, info, info_len) &&
|
||||
HKDF_expand(out_key, out_len, hkdf_md, prk, prk_len,
|
||||
CBB_data(&labeled_info), CBB_len(&labeled_info));
|
||||
CBB_cleanup(&labeled_info);
|
||||
return ok;
|
||||
}
|
||||
|
||||
static int hpke_extract_and_expand(const EVP_MD *hkdf_md, uint8_t *out_key,
|
||||
size_t out_len,
|
||||
const uint8_t dh[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t kem_context[KEM_CONTEXT_LEN]) {
|
||||
uint8_t prk[EVP_MAX_MD_SIZE];
|
||||
size_t prk_len;
|
||||
static const char kEaePrkLabel[] = "eae_prk";
|
||||
if (!hpke_labeled_extract(hkdf_md, prk, &prk_len, NULL, 0, kX25519SuiteID,
|
||||
sizeof(kX25519SuiteID), kEaePrkLabel, dh,
|
||||
X25519_PUBLIC_VALUE_LEN)) {
|
||||
return 0;
|
||||
}
|
||||
const char kPRKExpandLabel[] = "shared_secret";
|
||||
if (!hpke_labeled_expand(hkdf_md, out_key, out_len, prk, prk_len,
|
||||
kX25519SuiteID, sizeof(kX25519SuiteID),
|
||||
kPRKExpandLabel, kem_context, KEM_CONTEXT_LEN)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const EVP_AEAD *hpke_get_aead(uint16_t aead_id) {
|
||||
switch (aead_id) {
|
||||
case EVP_HPKE_AEAD_AES_GCM_128:
|
||||
return EVP_aead_aes_128_gcm();
|
||||
case EVP_HPKE_AEAD_AES_GCM_256:
|
||||
return EVP_aead_aes_256_gcm();
|
||||
case EVP_HPKE_AEAD_CHACHA20POLY1305:
|
||||
return EVP_aead_chacha20_poly1305();
|
||||
}
|
||||
OPENSSL_PUT_ERROR(EVP, ERR_R_INTERNAL_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const EVP_MD *hpke_get_kdf(uint16_t kdf_id) {
|
||||
switch (kdf_id) {
|
||||
case EVP_HPKE_HKDF_SHA256:
|
||||
return EVP_sha256();
|
||||
case EVP_HPKE_HKDF_SHA384:
|
||||
return EVP_sha384();
|
||||
case EVP_HPKE_HKDF_SHA512:
|
||||
return EVP_sha512();
|
||||
}
|
||||
OPENSSL_PUT_ERROR(EVP, ERR_R_INTERNAL_ERROR);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int hpke_key_schedule(EVP_HPKE_CTX *hpke, const uint8_t *shared_secret,
|
||||
size_t shared_secret_len, const uint8_t *info,
|
||||
size_t info_len) {
|
||||
// Attempt to get an EVP_AEAD*.
|
||||
const EVP_AEAD *aead = hpke_get_aead(hpke->aead_id);
|
||||
if (aead == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t suite_id[HPKE_SUITE_ID_LEN];
|
||||
if (!hpke_build_suite_id(suite_id, hpke->kdf_id, hpke->aead_id)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// psk_id_hash = LabeledExtract("", "psk_id_hash", psk_id)
|
||||
static const char kPskIdHashLabel[] = "psk_id_hash";
|
||||
uint8_t psk_id_hash[EVP_MAX_MD_SIZE];
|
||||
size_t psk_id_hash_len;
|
||||
if (!hpke_labeled_extract(hpke->hkdf_md, psk_id_hash, &psk_id_hash_len, NULL,
|
||||
0, suite_id, sizeof(suite_id), kPskIdHashLabel,
|
||||
NULL, 0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// info_hash = LabeledExtract("", "info_hash", info)
|
||||
static const char kInfoHashLabel[] = "info_hash";
|
||||
uint8_t info_hash[EVP_MAX_MD_SIZE];
|
||||
size_t info_hash_len;
|
||||
if (!hpke_labeled_extract(hpke->hkdf_md, info_hash, &info_hash_len, NULL, 0,
|
||||
suite_id, sizeof(suite_id), kInfoHashLabel, info,
|
||||
info_len)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// key_schedule_context = concat(mode, psk_id_hash, info_hash)
|
||||
uint8_t context[sizeof(uint8_t) + 2 * EVP_MAX_MD_SIZE];
|
||||
size_t context_len;
|
||||
CBB context_cbb;
|
||||
if (!CBB_init_fixed(&context_cbb, context, sizeof(context)) ||
|
||||
!CBB_add_u8(&context_cbb, HPKE_MODE_BASE) ||
|
||||
!CBB_add_bytes(&context_cbb, psk_id_hash, psk_id_hash_len) ||
|
||||
!CBB_add_bytes(&context_cbb, info_hash, info_hash_len) ||
|
||||
!CBB_finish(&context_cbb, NULL, &context_len)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// psk_hash = LabeledExtract("", "psk_hash", psk)
|
||||
static const char kPskHashLabel[] = "psk_hash";
|
||||
uint8_t psk_hash[EVP_MAX_MD_SIZE];
|
||||
size_t psk_hash_len;
|
||||
if (!hpke_labeled_extract(hpke->hkdf_md, psk_hash, &psk_hash_len, NULL, 0,
|
||||
suite_id, sizeof(suite_id), kPskHashLabel, NULL,
|
||||
0)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// secret = LabeledExtract(psk_hash, "secret", shared_secret)
|
||||
static const char kSecretExtractLabel[] = "secret";
|
||||
uint8_t secret[EVP_MAX_MD_SIZE];
|
||||
size_t secret_len;
|
||||
if (!hpke_labeled_extract(hpke->hkdf_md, secret, &secret_len, psk_hash,
|
||||
psk_hash_len, suite_id, sizeof(suite_id),
|
||||
kSecretExtractLabel, shared_secret,
|
||||
shared_secret_len)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// key = LabeledExpand(secret, "key", key_schedule_context, Nk)
|
||||
static const char kKeyExpandLabel[] = "key";
|
||||
uint8_t key[EVP_AEAD_MAX_KEY_LENGTH];
|
||||
const size_t kKeyLen = EVP_AEAD_key_length(aead);
|
||||
if (!hpke_labeled_expand(hpke->hkdf_md, key, kKeyLen, secret, secret_len,
|
||||
suite_id, sizeof(suite_id), kKeyExpandLabel, context,
|
||||
context_len)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Initialize the HPKE context's AEAD context, storing a copy of |key|.
|
||||
if (!EVP_AEAD_CTX_init(&hpke->aead_ctx, aead, key, kKeyLen, 0, NULL)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// nonce = LabeledExpand(secret, "nonce", key_schedule_context, Nn)
|
||||
static const char kNonceExpandLabel[] = "nonce";
|
||||
if (!hpke_labeled_expand(hpke->hkdf_md, hpke->nonce,
|
||||
EVP_AEAD_nonce_length(aead), secret, secret_len,
|
||||
suite_id, sizeof(suite_id), kNonceExpandLabel,
|
||||
context, context_len)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// exporter_secret = LabeledExpand(secret, "exp", key_schedule_context, Nh)
|
||||
static const char kExporterSecretExpandLabel[] = "exp";
|
||||
if (!hpke_labeled_expand(hpke->hkdf_md, hpke->exporter_secret,
|
||||
EVP_MD_size(hpke->hkdf_md), secret, secret_len,
|
||||
suite_id, sizeof(suite_id),
|
||||
kExporterSecretExpandLabel, context, context_len)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// The number of bytes written to |out_shared_secret| is the size of the KEM's
|
||||
// KDF (currently we only support SHA256).
|
||||
static int hpke_encap(EVP_HPKE_CTX *hpke,
|
||||
uint8_t out_shared_secret[SHA256_DIGEST_LENGTH],
|
||||
const uint8_t public_key_r[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t ephemeral_private[X25519_PRIVATE_KEY_LEN],
|
||||
const uint8_t ephemeral_public[X25519_PUBLIC_VALUE_LEN]) {
|
||||
uint8_t dh[X25519_PUBLIC_VALUE_LEN];
|
||||
if (!X25519(dh, ephemeral_private, public_key_r)) {
|
||||
OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PEER_KEY);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t kem_context[KEM_CONTEXT_LEN];
|
||||
OPENSSL_memcpy(kem_context, ephemeral_public, X25519_PUBLIC_VALUE_LEN);
|
||||
OPENSSL_memcpy(kem_context + X25519_PUBLIC_VALUE_LEN, public_key_r,
|
||||
X25519_PUBLIC_VALUE_LEN);
|
||||
if (!hpke_extract_and_expand(EVP_sha256(), out_shared_secret,
|
||||
SHA256_DIGEST_LENGTH, dh, kem_context)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int hpke_decap(const EVP_HPKE_CTX *hpke,
|
||||
uint8_t out_shared_secret[SHA256_DIGEST_LENGTH],
|
||||
const uint8_t enc[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t public_key_r[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t secret_key_r[X25519_PRIVATE_KEY_LEN]) {
|
||||
uint8_t dh[X25519_PUBLIC_VALUE_LEN];
|
||||
if (!X25519(dh, secret_key_r, enc)) {
|
||||
OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PEER_KEY);
|
||||
return 0;
|
||||
}
|
||||
uint8_t kem_context[KEM_CONTEXT_LEN];
|
||||
OPENSSL_memcpy(kem_context, enc, X25519_PUBLIC_VALUE_LEN);
|
||||
OPENSSL_memcpy(kem_context + X25519_PUBLIC_VALUE_LEN, public_key_r,
|
||||
X25519_PUBLIC_VALUE_LEN);
|
||||
if (!hpke_extract_and_expand(EVP_sha256(), out_shared_secret,
|
||||
SHA256_DIGEST_LENGTH, dh, kem_context)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void EVP_HPKE_CTX_init(EVP_HPKE_CTX *ctx) {
|
||||
OPENSSL_memset(ctx, 0, sizeof(EVP_HPKE_CTX));
|
||||
EVP_AEAD_CTX_zero(&ctx->aead_ctx);
|
||||
}
|
||||
|
||||
void EVP_HPKE_CTX_cleanup(EVP_HPKE_CTX *ctx) {
|
||||
EVP_AEAD_CTX_cleanup(&ctx->aead_ctx);
|
||||
}
|
||||
|
||||
int EVP_HPKE_CTX_setup_base_s_x25519(
|
||||
EVP_HPKE_CTX *hpke, uint8_t out_enc[X25519_PUBLIC_VALUE_LEN],
|
||||
uint16_t kdf_id, uint16_t aead_id,
|
||||
const uint8_t peer_public_value[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t *info, size_t info_len) {
|
||||
// The GenerateKeyPair() step technically belongs in the KEM's Encap()
|
||||
// function, but we've moved it up a layer to make it easier for tests to
|
||||
// inject an ephemeral keypair.
|
||||
uint8_t ephemeral_private[X25519_PRIVATE_KEY_LEN];
|
||||
X25519_keypair(out_enc, ephemeral_private);
|
||||
return EVP_HPKE_CTX_setup_base_s_x25519_for_test(
|
||||
hpke, kdf_id, aead_id, peer_public_value, info, info_len,
|
||||
ephemeral_private, out_enc);
|
||||
}
|
||||
|
||||
int EVP_HPKE_CTX_setup_base_s_x25519_for_test(
|
||||
EVP_HPKE_CTX *hpke, uint16_t kdf_id, uint16_t aead_id,
|
||||
const uint8_t peer_public_value[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t *info, size_t info_len,
|
||||
const uint8_t ephemeral_private[X25519_PRIVATE_KEY_LEN],
|
||||
const uint8_t ephemeral_public[X25519_PUBLIC_VALUE_LEN]) {
|
||||
hpke->is_sender = 1;
|
||||
hpke->kdf_id = kdf_id;
|
||||
hpke->aead_id = aead_id;
|
||||
hpke->hkdf_md = hpke_get_kdf(kdf_id);
|
||||
if (hpke->hkdf_md == NULL) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t shared_secret[SHA256_DIGEST_LENGTH];
|
||||
if (!hpke_encap(hpke, shared_secret, peer_public_value, ephemeral_private,
|
||||
ephemeral_public) ||
|
||||
!hpke_key_schedule(hpke, shared_secret, sizeof(shared_secret), info,
|
||||
info_len)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int EVP_HPKE_CTX_setup_base_r_x25519(
|
||||
EVP_HPKE_CTX *hpke, uint16_t kdf_id, uint16_t aead_id,
|
||||
const uint8_t enc[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t public_key[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t private_key[X25519_PRIVATE_KEY_LEN], const uint8_t *info,
|
||||
size_t info_len) {
|
||||
hpke->is_sender = 0;
|
||||
hpke->kdf_id = kdf_id;
|
||||
hpke->aead_id = aead_id;
|
||||
hpke->hkdf_md = hpke_get_kdf(kdf_id);
|
||||
if (hpke->hkdf_md == NULL) {
|
||||
return 0;
|
||||
}
|
||||
uint8_t shared_secret[SHA256_DIGEST_LENGTH];
|
||||
if (!hpke_decap(hpke, shared_secret, enc, public_key, private_key) ||
|
||||
!hpke_key_schedule(hpke, shared_secret, sizeof(shared_secret), info,
|
||||
info_len)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void hpke_nonce(const EVP_HPKE_CTX *hpke, uint8_t *out_nonce,
|
||||
size_t nonce_len) {
|
||||
assert(nonce_len >= 8);
|
||||
|
||||
// Write padded big-endian bytes of |hpke->seq| to |out_nonce|.
|
||||
OPENSSL_memset(out_nonce, 0, nonce_len);
|
||||
uint64_t seq_copy = hpke->seq;
|
||||
for (size_t i = 0; i < 8; i++) {
|
||||
out_nonce[nonce_len - i - 1] = seq_copy & 0xff;
|
||||
seq_copy >>= 8;
|
||||
}
|
||||
|
||||
// XOR the encoded sequence with the |hpke->nonce|.
|
||||
for (size_t i = 0; i < nonce_len; i++) {
|
||||
out_nonce[i] ^= hpke->nonce[i];
|
||||
}
|
||||
}
|
||||
|
||||
size_t EVP_HPKE_CTX_max_overhead(const EVP_HPKE_CTX *hpke) {
|
||||
assert(hpke->is_sender);
|
||||
return EVP_AEAD_max_overhead(hpke->aead_ctx.aead);
|
||||
}
|
||||
|
||||
int EVP_HPKE_CTX_open(EVP_HPKE_CTX *hpke, uint8_t *out, size_t *out_len,
|
||||
size_t max_out_len, const uint8_t *in, size_t in_len,
|
||||
const uint8_t *ad, size_t ad_len) {
|
||||
if (hpke->is_sender) {
|
||||
OPENSSL_PUT_ERROR(EVP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
||||
return 0;
|
||||
}
|
||||
if (hpke->seq == UINT64_MAX) {
|
||||
OPENSSL_PUT_ERROR(EVP, ERR_R_OVERFLOW);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH];
|
||||
const size_t nonce_len = EVP_AEAD_nonce_length(hpke->aead_ctx.aead);
|
||||
hpke_nonce(hpke, nonce, nonce_len);
|
||||
|
||||
if (!EVP_AEAD_CTX_open(&hpke->aead_ctx, out, out_len, max_out_len, nonce,
|
||||
nonce_len, in, in_len, ad, ad_len)) {
|
||||
return 0;
|
||||
}
|
||||
hpke->seq++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int EVP_HPKE_CTX_seal(EVP_HPKE_CTX *hpke, uint8_t *out, size_t *out_len,
|
||||
size_t max_out_len, const uint8_t *in, size_t in_len,
|
||||
const uint8_t *ad, size_t ad_len) {
|
||||
if (!hpke->is_sender) {
|
||||
OPENSSL_PUT_ERROR(EVP, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
|
||||
return 0;
|
||||
}
|
||||
if (hpke->seq == UINT64_MAX) {
|
||||
OPENSSL_PUT_ERROR(EVP, ERR_R_OVERFLOW);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH];
|
||||
const size_t nonce_len = EVP_AEAD_nonce_length(hpke->aead_ctx.aead);
|
||||
hpke_nonce(hpke, nonce, nonce_len);
|
||||
|
||||
if (!EVP_AEAD_CTX_seal(&hpke->aead_ctx, out, out_len, max_out_len, nonce,
|
||||
nonce_len, in, in_len, ad, ad_len)) {
|
||||
return 0;
|
||||
}
|
||||
hpke->seq++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int EVP_HPKE_CTX_export(const EVP_HPKE_CTX *hpke, uint8_t *out,
|
||||
size_t secret_len, const uint8_t *context,
|
||||
size_t context_len) {
|
||||
uint8_t suite_id[HPKE_SUITE_ID_LEN];
|
||||
if (!hpke_build_suite_id(suite_id, hpke->kdf_id, hpke->aead_id)) {
|
||||
return 0;
|
||||
}
|
||||
static const char kExportExpandLabel[] = "sec";
|
||||
if (!hpke_labeled_expand(hpke->hkdf_md, out, secret_len,
|
||||
hpke->exporter_secret, EVP_MD_size(hpke->hkdf_md),
|
||||
suite_id, sizeof(suite_id), kExportExpandLabel,
|
||||
context, context_len)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
/* Copyright (c) 2020, Google Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
||||
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
|
||||
|
||||
#ifndef OPENSSL_HEADER_CRYPTO_HPKE_INTERNAL_H
|
||||
#define OPENSSL_HEADER_CRYPTO_HPKE_INTERNAL_H
|
||||
|
||||
#include <CNIOBoringSSL_aead.h>
|
||||
#include <CNIOBoringSSL_base.h>
|
||||
#include <CNIOBoringSSL_curve25519.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// Hybrid Public Key Encryption.
|
||||
//
|
||||
// Hybrid Public Key Encryption (HPKE) enables a sender to encrypt messages to a
|
||||
// receiver with a public key.
|
||||
//
|
||||
// See https://tools.ietf.org/html/draft-irtf-cfrg-hpke-04.
|
||||
|
||||
// EVP_HPKE_AEAD_* are AEAD identifiers.
|
||||
#define EVP_HPKE_AEAD_AES_GCM_128 0x0001
|
||||
#define EVP_HPKE_AEAD_AES_GCM_256 0x0002
|
||||
#define EVP_HPKE_AEAD_CHACHA20POLY1305 0x0003
|
||||
|
||||
// EVP_HPKE_HKDF_* are HKDF identifiers.
|
||||
#define EVP_HPKE_HKDF_SHA256 0x0001
|
||||
#define EVP_HPKE_HKDF_SHA384 0x0002
|
||||
#define EVP_HPKE_HKDF_SHA512 0x0003
|
||||
|
||||
// EVP_HPKE_MAX_OVERHEAD contains the largest value that
|
||||
// |EVP_HPKE_CTX_max_overhead| would ever return for any context.
|
||||
#define EVP_HPKE_MAX_OVERHEAD EVP_AEAD_MAX_OVERHEAD
|
||||
|
||||
|
||||
// Encryption contexts.
|
||||
|
||||
// An |EVP_HPKE_CTX| is an HPKE encryption context.
|
||||
typedef struct evp_hpke_ctx_st {
|
||||
const EVP_MD *hkdf_md;
|
||||
EVP_AEAD_CTX aead_ctx;
|
||||
uint16_t kdf_id;
|
||||
uint16_t aead_id;
|
||||
uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH];
|
||||
uint8_t exporter_secret[EVP_MAX_MD_SIZE];
|
||||
uint64_t seq;
|
||||
int is_sender;
|
||||
} EVP_HPKE_CTX;
|
||||
|
||||
// EVP_HPKE_CTX_init initializes an already-allocated |EVP_HPKE_CTX|. The caller
|
||||
// should then use one of the |EVP_HPKE_CTX_setup_*| functions.
|
||||
//
|
||||
// It is safe, but not necessary to call |EVP_HPKE_CTX_cleanup| in this state.
|
||||
OPENSSL_EXPORT void EVP_HPKE_CTX_init(EVP_HPKE_CTX *ctx);
|
||||
|
||||
// EVP_HPKE_CTX_cleanup releases memory referenced by |ctx|. |ctx| must have
|
||||
// been initialized with |EVP_HPKE_CTX_init|.
|
||||
OPENSSL_EXPORT void EVP_HPKE_CTX_cleanup(EVP_HPKE_CTX *ctx);
|
||||
|
||||
|
||||
// Setting up HPKE contexts.
|
||||
//
|
||||
// In each of the following functions, |hpke| must have been initialized with
|
||||
// |EVP_HPKE_CTX_init|. |kdf_id| selects the KDF for non-KEM HPKE operations and
|
||||
// must be one of the |EVP_HPKE_HKDF_*| constants. |aead_id| selects the AEAD
|
||||
// for the "open" and "seal" operations and must be one of the |EVP_HPKE_AEAD_*"
|
||||
// constants."
|
||||
//
|
||||
// See https://www.ietf.org/id/draft-irtf-cfrg-hpke-04.html#section-5.1.1.
|
||||
|
||||
// EVP_HPKE_CTX_setup_base_s_x25519 sets up |hpke| as a sender context that can
|
||||
// encrypt for the private key corresponding to |peer_public_value| (the
|
||||
// recipient's public key). It returns one on success, and zero otherwise. Note
|
||||
// that this function may fail if |peer_public_value| is invalid.
|
||||
//
|
||||
// This function writes the encapsulated shared secret to |out_enc|.
|
||||
OPENSSL_EXPORT int EVP_HPKE_CTX_setup_base_s_x25519(
|
||||
EVP_HPKE_CTX *hpke, uint8_t out_enc[X25519_PUBLIC_VALUE_LEN],
|
||||
uint16_t kdf_id, uint16_t aead_id,
|
||||
const uint8_t peer_public_value[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t *info, size_t info_len);
|
||||
|
||||
// EVP_HPKE_CTX_setup_base_s_x25519_for_test behaves like
|
||||
// |EVP_HPKE_CTX_setup_base_s_x25519|, but takes a pre-generated ephemeral
|
||||
// sender key.
|
||||
OPENSSL_EXPORT int EVP_HPKE_CTX_setup_base_s_x25519_for_test(
|
||||
EVP_HPKE_CTX *hpke, uint16_t kdf_id, uint16_t aead_id,
|
||||
const uint8_t peer_public_value[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t *info, size_t info_len,
|
||||
const uint8_t ephemeral_private[X25519_PRIVATE_KEY_LEN],
|
||||
const uint8_t ephemeral_public[X25519_PUBLIC_VALUE_LEN]);
|
||||
|
||||
// EVP_HPKE_CTX_setup_base_r_x25519 sets up |hpke| as a recipient context that
|
||||
// can decrypt messages. |private_key| is the recipient's private key, and |enc|
|
||||
// is the encapsulated shared secret from the sender. Note that this function
|
||||
// may fail if |enc| is invalid.
|
||||
OPENSSL_EXPORT int EVP_HPKE_CTX_setup_base_r_x25519(
|
||||
EVP_HPKE_CTX *hpke, uint16_t kdf_id, uint16_t aead_id,
|
||||
const uint8_t enc[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t public_key[X25519_PUBLIC_VALUE_LEN],
|
||||
const uint8_t private_key[X25519_PRIVATE_KEY_LEN], const uint8_t *info,
|
||||
size_t info_len);
|
||||
|
||||
|
||||
// Using an HPKE context.
|
||||
|
||||
// EVP_HPKE_CTX_open uses the HPKE context |hpke| to authenticate |in_len| bytes
|
||||
// from |in| and |ad_len| bytes from |ad| and to decrypt at most |in_len| bytes
|
||||
// into |out|. It returns one on success, and zero otherwise.
|
||||
//
|
||||
// This operation will fail if the |hpke| context is not set up as a receiver.
|
||||
//
|
||||
// Note that HPKE encryption is stateful and ordered. The sender's first call to
|
||||
// |EVP_HPKE_CTX_seal| must correspond to the recipient's first call to
|
||||
// |EVP_HPKE_CTX_open|, etc.
|
||||
//
|
||||
// At most |in_len| bytes are written to |out|. In order to ensure success,
|
||||
// |max_out_len| should be at least |in_len|. On successful return, |*out_len|
|
||||
// is set to the actual number of bytes written.
|
||||
OPENSSL_EXPORT int EVP_HPKE_CTX_open(EVP_HPKE_CTX *hpke, uint8_t *out,
|
||||
size_t *out_len, size_t max_out_len,
|
||||
const uint8_t *in, size_t in_len,
|
||||
const uint8_t *ad, size_t ad_len);
|
||||
|
||||
// EVP_HPKE_CTX_seal uses the HPKE context |hpke| to encrypt and authenticate
|
||||
// |in_len| bytes of ciphertext |in| and authenticate |ad_len| bytes from |ad|,
|
||||
// writing the result to |out|. It returns one on success and zero otherwise.
|
||||
//
|
||||
// This operation will fail if the |hpke| context is not set up as a sender.
|
||||
//
|
||||
// Note that HPKE encryption is stateful and ordered. The sender's first call to
|
||||
// |EVP_HPKE_CTX_seal| must correspond to the recipient's first call to
|
||||
// |EVP_HPKE_CTX_open|, etc.
|
||||
//
|
||||
// At most, |max_out_len| encrypted bytes are written to |out|. On successful
|
||||
// return, |*out_len| is set to the actual number of bytes written.
|
||||
//
|
||||
// To ensure success, |max_out_len| should be |in_len| plus the result of
|
||||
// |EVP_HPKE_CTX_max_overhead| or |EVP_HPKE_MAX_OVERHEAD|.
|
||||
OPENSSL_EXPORT int EVP_HPKE_CTX_seal(EVP_HPKE_CTX *hpke, uint8_t *out,
|
||||
size_t *out_len, size_t max_out_len,
|
||||
const uint8_t *in, size_t in_len,
|
||||
const uint8_t *ad, size_t ad_len);
|
||||
|
||||
// EVP_HPKE_CTX_export uses the HPKE context |hpke| to export a secret of
|
||||
// |secret_len| bytes into |out|. This function uses |context_len| bytes from
|
||||
// |context| as a context string for the secret. This is necessary to separate
|
||||
// different uses of exported secrets and bind relevant caller-specific context
|
||||
// into the output. It returns one on success and zero otherwise.
|
||||
OPENSSL_EXPORT int EVP_HPKE_CTX_export(const EVP_HPKE_CTX *hpke, uint8_t *out,
|
||||
size_t secret_len,
|
||||
const uint8_t *context,
|
||||
size_t context_len);
|
||||
|
||||
// EVP_HPKE_CTX_max_overhead returns the maximum number of additional bytes
|
||||
// added by sealing data with |EVP_HPKE_CTX_seal|. The |hpke| context must be
|
||||
// set up as a sender.
|
||||
OPENSSL_EXPORT size_t EVP_HPKE_CTX_max_overhead(const EVP_HPKE_CTX *hpke);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // extern C
|
||||
#endif
|
||||
|
||||
#if !defined(BORINGSSL_NO_CXX)
|
||||
extern "C++" {
|
||||
|
||||
BSSL_NAMESPACE_BEGIN
|
||||
|
||||
using ScopedEVP_HPKE_CTX =
|
||||
internal::StackAllocated<EVP_HPKE_CTX, void, EVP_HPKE_CTX_init,
|
||||
EVP_HPKE_CTX_cleanup>;
|
||||
|
||||
BSSL_NAMESPACE_END
|
||||
|
||||
} // extern C++
|
||||
#endif
|
||||
|
||||
#endif // OPENSSL_HEADER_CRYPTO_HPKE_INTERNAL_H
|
||||
@@ -446,7 +446,7 @@ static int do_indent(char_io *io_ch, void *arg, int indent)
|
||||
#define FN_WIDTH_LN 25
|
||||
#define FN_WIDTH_SN 10
|
||||
|
||||
static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n,
|
||||
static int do_name_ex(char_io *io_ch, void *arg, const X509_NAME *n,
|
||||
int indent, unsigned long flags)
|
||||
{
|
||||
int i, prev = -1, orflags, cnt;
|
||||
@@ -584,7 +584,7 @@ static int do_name_ex(char_io *io_ch, void *arg, X509_NAME *n,
|
||||
|
||||
/* Wrappers round the main functions */
|
||||
|
||||
int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent,
|
||||
int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
|
||||
unsigned long flags)
|
||||
{
|
||||
if (flags == XN_FLAG_COMPAT)
|
||||
@@ -593,7 +593,7 @@ int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent,
|
||||
}
|
||||
|
||||
#ifndef OPENSSL_NO_FP_API
|
||||
int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent,
|
||||
int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
|
||||
unsigned long flags)
|
||||
{
|
||||
if (flags == XN_FLAG_COMPAT) {
|
||||
|
||||
@@ -91,10 +91,10 @@ int X509_CRL_print(BIO *out, X509_CRL *x)
|
||||
BIO_printf(out, "%8sIssuer: %s\n", "", p);
|
||||
OPENSSL_free(p);
|
||||
BIO_printf(out, "%8sLast Update: ", "");
|
||||
ASN1_TIME_print(out, X509_CRL_get_lastUpdate(x));
|
||||
ASN1_TIME_print(out, X509_CRL_get0_lastUpdate(x));
|
||||
BIO_printf(out, "\n%8sNext Update: ", "");
|
||||
if (X509_CRL_get_nextUpdate(x))
|
||||
ASN1_TIME_print(out, X509_CRL_get_nextUpdate(x));
|
||||
if (X509_CRL_get0_nextUpdate(x))
|
||||
ASN1_TIME_print(out, X509_CRL_get0_nextUpdate(x));
|
||||
else
|
||||
BIO_printf(out, "NONE");
|
||||
BIO_printf(out, "\n");
|
||||
|
||||
@@ -494,7 +494,7 @@ err:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int X509_NAME_print(BIO *bp, X509_NAME *name, int obase)
|
||||
int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase)
|
||||
{
|
||||
char *s, *c, *b;
|
||||
int ret = 0, l, i;
|
||||
|
||||
@@ -131,7 +131,7 @@ int X509_CRL_match(const X509_CRL *a, const X509_CRL *b)
|
||||
return OPENSSL_memcmp(a->sha1_hash, b->sha1_hash, 20);
|
||||
}
|
||||
|
||||
X509_NAME *X509_get_issuer_name(X509 *a)
|
||||
X509_NAME *X509_get_issuer_name(const X509 *a)
|
||||
{
|
||||
return (a->cert_info->issuer);
|
||||
}
|
||||
@@ -146,7 +146,7 @@ unsigned long X509_issuer_name_hash_old(X509 *x)
|
||||
return (X509_NAME_hash_old(x->cert_info->issuer));
|
||||
}
|
||||
|
||||
X509_NAME *X509_get_subject_name(X509 *a)
|
||||
X509_NAME *X509_get_subject_name(const X509 *a)
|
||||
{
|
||||
return (a->cert_info->subject);
|
||||
}
|
||||
@@ -156,6 +156,11 @@ ASN1_INTEGER *X509_get_serialNumber(X509 *a)
|
||||
return (a->cert_info->serialNumber);
|
||||
}
|
||||
|
||||
const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x509)
|
||||
{
|
||||
return x509->cert_info->serialNumber;
|
||||
}
|
||||
|
||||
unsigned long X509_subject_name_hash(X509 *x)
|
||||
{
|
||||
return (X509_NAME_hash(x->cert_info->subject));
|
||||
|
||||
@@ -62,27 +62,28 @@
|
||||
#include <CNIOBoringSSL_x509.h>
|
||||
#include <CNIOBoringSSL_x509v3.h>
|
||||
|
||||
int X509_CRL_get_ext_count(X509_CRL *x)
|
||||
int X509_CRL_get_ext_count(const X509_CRL *x)
|
||||
{
|
||||
return (X509v3_get_ext_count(x->crl->extensions));
|
||||
}
|
||||
|
||||
int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos)
|
||||
int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos));
|
||||
}
|
||||
|
||||
int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj, int lastpos)
|
||||
int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj,
|
||||
int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos));
|
||||
}
|
||||
|
||||
int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos)
|
||||
int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos));
|
||||
}
|
||||
|
||||
X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc)
|
||||
X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc)
|
||||
{
|
||||
return (X509v3_get_ext(x->crl->extensions, loc));
|
||||
}
|
||||
@@ -92,7 +93,7 @@ X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc)
|
||||
return (X509v3_delete_ext(x->crl->extensions, loc));
|
||||
}
|
||||
|
||||
void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx)
|
||||
void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx)
|
||||
{
|
||||
return X509V3_get_d2i(x->crl->extensions, nid, crit, idx);
|
||||
}
|
||||
@@ -108,28 +109,28 @@ int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc)
|
||||
return (X509v3_add_ext(&(x->crl->extensions), ex, loc) != NULL);
|
||||
}
|
||||
|
||||
int X509_get_ext_count(X509 *x)
|
||||
int X509_get_ext_count(const X509 *x)
|
||||
{
|
||||
return (X509v3_get_ext_count(x->cert_info->extensions));
|
||||
}
|
||||
|
||||
int X509_get_ext_by_NID(X509 *x, int nid, int lastpos)
|
||||
int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos));
|
||||
}
|
||||
|
||||
int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos)
|
||||
int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos));
|
||||
}
|
||||
|
||||
int X509_get_ext_by_critical(X509 *x, int crit, int lastpos)
|
||||
int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_critical
|
||||
(x->cert_info->extensions, crit, lastpos));
|
||||
}
|
||||
|
||||
X509_EXTENSION *X509_get_ext(X509 *x, int loc)
|
||||
X509_EXTENSION *X509_get_ext(const X509 *x, int loc)
|
||||
{
|
||||
return (X509v3_get_ext(x->cert_info->extensions, loc));
|
||||
}
|
||||
@@ -144,7 +145,7 @@ int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc)
|
||||
return (X509v3_add_ext(&(x->cert_info->extensions), ex, loc) != NULL);
|
||||
}
|
||||
|
||||
void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx)
|
||||
void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx)
|
||||
{
|
||||
return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx);
|
||||
}
|
||||
@@ -156,28 +157,29 @@ int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
|
||||
flags);
|
||||
}
|
||||
|
||||
int X509_REVOKED_get_ext_count(X509_REVOKED *x)
|
||||
int X509_REVOKED_get_ext_count(const X509_REVOKED *x)
|
||||
{
|
||||
return (X509v3_get_ext_count(x->extensions));
|
||||
}
|
||||
|
||||
int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos)
|
||||
int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_NID(x->extensions, nid, lastpos));
|
||||
}
|
||||
|
||||
int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x, ASN1_OBJECT *obj,
|
||||
int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj,
|
||||
int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_OBJ(x->extensions, obj, lastpos));
|
||||
}
|
||||
|
||||
int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos)
|
||||
int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit,
|
||||
int lastpos)
|
||||
{
|
||||
return (X509v3_get_ext_by_critical(x->extensions, crit, lastpos));
|
||||
}
|
||||
|
||||
X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc)
|
||||
X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc)
|
||||
{
|
||||
return (X509v3_get_ext(x->extensions, loc));
|
||||
}
|
||||
@@ -192,7 +194,8 @@ int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc)
|
||||
return (X509v3_add_ext(&(x->extensions), ex, loc) != NULL);
|
||||
}
|
||||
|
||||
void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx)
|
||||
void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit,
|
||||
int *idx)
|
||||
{
|
||||
return X509V3_get_d2i(x->extensions, nid, crit, idx);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
#define NAME_ONELINE_MAX (1024 * 1024)
|
||||
|
||||
char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
|
||||
char *X509_NAME_oneline(const X509_NAME *a, char *buf, int len)
|
||||
{
|
||||
X509_NAME_ENTRY *ne;
|
||||
size_t i;
|
||||
|
||||
@@ -117,7 +117,7 @@ int X509_set_subject_name(X509 *x, X509_NAME *name)
|
||||
return (X509_NAME_set(&x->cert_info->subject, name));
|
||||
}
|
||||
|
||||
int X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
|
||||
int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm)
|
||||
{
|
||||
ASN1_TIME *in;
|
||||
|
||||
@@ -134,6 +134,11 @@ int X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
|
||||
return (in != NULL);
|
||||
}
|
||||
|
||||
int X509_set_notBefore(X509 *x, const ASN1_TIME *tm)
|
||||
{
|
||||
return X509_set1_notBefore(x, tm);
|
||||
}
|
||||
|
||||
const ASN1_TIME *X509_get0_notBefore(const X509 *x)
|
||||
{
|
||||
return x->cert_info->validity->notBefore;
|
||||
@@ -155,7 +160,7 @@ ASN1_TIME *X509_get_notBefore(const X509 *x509)
|
||||
return x509->cert_info->validity->notBefore;
|
||||
}
|
||||
|
||||
int X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
|
||||
int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm)
|
||||
{
|
||||
ASN1_TIME *in;
|
||||
|
||||
@@ -172,6 +177,11 @@ int X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
|
||||
return (in != NULL);
|
||||
}
|
||||
|
||||
int X509_set_notAfter(X509 *x, const ASN1_TIME *tm)
|
||||
{
|
||||
return X509_set1_notAfter(x, tm);
|
||||
}
|
||||
|
||||
const ASN1_TIME *X509_get0_notAfter(const X509 *x)
|
||||
{
|
||||
return x->cert_info->validity->notAfter;
|
||||
@@ -193,6 +203,17 @@ ASN1_TIME *X509_get_notAfter(const X509 *x509)
|
||||
return x509->cert_info->validity->notAfter;
|
||||
}
|
||||
|
||||
void X509_get0_uids(const X509 *x509, const ASN1_BIT_STRING **out_issuer_uid,
|
||||
const ASN1_BIT_STRING **out_subject_uid)
|
||||
{
|
||||
if (out_issuer_uid != NULL) {
|
||||
*out_issuer_uid = x509->cert_info->issuerUID;
|
||||
}
|
||||
if (out_subject_uid != NULL) {
|
||||
*out_subject_uid = x509->cert_info->subjectUID;
|
||||
}
|
||||
}
|
||||
|
||||
int X509_set_pubkey(X509 *x, EVP_PKEY *pkey)
|
||||
{
|
||||
if ((x == NULL) || (x->cert_info == NULL))
|
||||
|
||||
@@ -260,17 +260,17 @@ void X509_TRUST_cleanup(void)
|
||||
trtable = NULL;
|
||||
}
|
||||
|
||||
int X509_TRUST_get_flags(X509_TRUST *xp)
|
||||
int X509_TRUST_get_flags(const X509_TRUST *xp)
|
||||
{
|
||||
return xp->flags;
|
||||
}
|
||||
|
||||
char *X509_TRUST_get0_name(X509_TRUST *xp)
|
||||
char *X509_TRUST_get0_name(const X509_TRUST *xp)
|
||||
{
|
||||
return xp->name;
|
||||
}
|
||||
|
||||
int X509_TRUST_get_trust(X509_TRUST *xp)
|
||||
int X509_TRUST_get_trust(const X509_TRUST *xp)
|
||||
{
|
||||
return xp->trust;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
|
||||
|
||||
X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,
|
||||
int crit,
|
||||
ASN1_OCTET_STRING *data)
|
||||
const ASN1_OCTET_STRING *data)
|
||||
{
|
||||
const ASN1_OBJECT *obj;
|
||||
X509_EXTENSION *ret;
|
||||
@@ -197,7 +197,7 @@ X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,
|
||||
|
||||
X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
|
||||
const ASN1_OBJECT *obj, int crit,
|
||||
ASN1_OCTET_STRING *data)
|
||||
const ASN1_OCTET_STRING *data)
|
||||
{
|
||||
X509_EXTENSION *ret;
|
||||
|
||||
@@ -242,7 +242,7 @@ int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit)
|
||||
return (1);
|
||||
}
|
||||
|
||||
int X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data)
|
||||
int X509_EXTENSION_set_data(X509_EXTENSION *ex, const ASN1_OCTET_STRING *data)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -1037,7 +1037,7 @@ static int check_crl_time(X509_STORE_CTX *ctx, X509_CRL *crl, int notify)
|
||||
else
|
||||
ptime = NULL;
|
||||
|
||||
i = X509_cmp_time(X509_CRL_get_lastUpdate(crl), ptime);
|
||||
i = X509_cmp_time(X509_CRL_get0_lastUpdate(crl), ptime);
|
||||
if (i == 0) {
|
||||
if (!notify)
|
||||
return 0;
|
||||
@@ -1054,8 +1054,8 @@ static int check_crl_time(X509_STORE_CTX *ctx, X509_CRL *crl, int notify)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (X509_CRL_get_nextUpdate(crl)) {
|
||||
i = X509_cmp_time(X509_CRL_get_nextUpdate(crl), ptime);
|
||||
if (X509_CRL_get0_nextUpdate(crl)) {
|
||||
i = X509_cmp_time(X509_CRL_get0_nextUpdate(crl), ptime);
|
||||
|
||||
if (i == 0) {
|
||||
if (!notify)
|
||||
@@ -1100,8 +1100,8 @@ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
|
||||
/* If current CRL is equivalent use it if it is newer */
|
||||
if (crl_score == best_score && best_crl != NULL) {
|
||||
int day, sec;
|
||||
if (ASN1_TIME_diff(&day, &sec, X509_CRL_get_lastUpdate(best_crl),
|
||||
X509_CRL_get_lastUpdate(crl)) == 0)
|
||||
if (ASN1_TIME_diff(&day, &sec, X509_CRL_get0_lastUpdate(best_crl),
|
||||
X509_CRL_get0_lastUpdate(crl)) == 0)
|
||||
continue;
|
||||
/*
|
||||
* ASN1_TIME_diff never returns inconsistent signs for |day|
|
||||
@@ -2058,9 +2058,9 @@ X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer,
|
||||
if (!X509_CRL_set_issuer_name(crl, X509_CRL_get_issuer(newer)))
|
||||
goto memerr;
|
||||
|
||||
if (!X509_CRL_set_lastUpdate(crl, X509_CRL_get_lastUpdate(newer)))
|
||||
if (!X509_CRL_set1_lastUpdate(crl, X509_CRL_get0_lastUpdate(newer)))
|
||||
goto memerr;
|
||||
if (!X509_CRL_set_nextUpdate(crl, X509_CRL_get_nextUpdate(newer)))
|
||||
if (!X509_CRL_set1_nextUpdate(crl, X509_CRL_get0_nextUpdate(newer)))
|
||||
goto memerr;
|
||||
|
||||
/* Set base CRL number: must be critical */
|
||||
|
||||
@@ -79,7 +79,7 @@ int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name)
|
||||
return (X509_NAME_set(&x->crl->issuer, name));
|
||||
}
|
||||
|
||||
int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm)
|
||||
int X509_CRL_set1_lastUpdate(X509_CRL *x, const ASN1_TIME *tm)
|
||||
{
|
||||
ASN1_TIME *in;
|
||||
|
||||
@@ -96,7 +96,7 @@ int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm)
|
||||
return (in != NULL);
|
||||
}
|
||||
|
||||
int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm)
|
||||
int X509_CRL_set1_nextUpdate(X509_CRL *x, const ASN1_TIME *tm)
|
||||
{
|
||||
ASN1_TIME *in;
|
||||
|
||||
|
||||
@@ -66,7 +66,8 @@
|
||||
#include "../internal.h"
|
||||
|
||||
|
||||
int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len)
|
||||
int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid, char *buf,
|
||||
int len)
|
||||
{
|
||||
const ASN1_OBJECT *obj;
|
||||
|
||||
@@ -76,7 +77,7 @@ int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len)
|
||||
return (X509_NAME_get_text_by_OBJ(name, obj, buf, len));
|
||||
}
|
||||
|
||||
int X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj,
|
||||
int X509_NAME_get_text_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
|
||||
char *buf, int len)
|
||||
{
|
||||
int i;
|
||||
@@ -94,14 +95,14 @@ int X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj,
|
||||
return (i);
|
||||
}
|
||||
|
||||
int X509_NAME_entry_count(X509_NAME *name)
|
||||
int X509_NAME_entry_count(const X509_NAME *name)
|
||||
{
|
||||
if (name == NULL)
|
||||
return (0);
|
||||
return (sk_X509_NAME_ENTRY_num(name->entries));
|
||||
}
|
||||
|
||||
int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos)
|
||||
int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos)
|
||||
{
|
||||
const ASN1_OBJECT *obj;
|
||||
|
||||
@@ -112,7 +113,7 @@ int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos)
|
||||
}
|
||||
|
||||
/* NOTE: you should be passsing -1, not 0 as lastpos */
|
||||
int X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj,
|
||||
int X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
|
||||
int lastpos)
|
||||
{
|
||||
int n;
|
||||
@@ -133,7 +134,7 @@ int X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj,
|
||||
return (-1);
|
||||
}
|
||||
|
||||
X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc)
|
||||
X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc)
|
||||
{
|
||||
if (name == NULL || loc < 0
|
||||
|| sk_X509_NAME_ENTRY_num(name->entries) <= (size_t)loc)
|
||||
@@ -374,14 +375,14 @@ int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
|
||||
return (1);
|
||||
}
|
||||
|
||||
ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne)
|
||||
ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne)
|
||||
{
|
||||
if (ne == NULL)
|
||||
return (NULL);
|
||||
return (ne->object);
|
||||
}
|
||||
|
||||
ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne)
|
||||
ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne)
|
||||
{
|
||||
if (ne == NULL)
|
||||
return (NULL);
|
||||
|
||||
@@ -67,3 +67,23 @@ ASN1_SEQUENCE(X509_SIG) = {
|
||||
} ASN1_SEQUENCE_END(X509_SIG)
|
||||
|
||||
IMPLEMENT_ASN1_FUNCTIONS(X509_SIG)
|
||||
|
||||
void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **out_alg,
|
||||
const ASN1_OCTET_STRING **out_digest) {
|
||||
if (out_alg != NULL) {
|
||||
*out_alg = sig->algor;
|
||||
}
|
||||
if (out_digest != NULL) {
|
||||
*out_digest = sig->digest;
|
||||
}
|
||||
}
|
||||
|
||||
void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **out_alg,
|
||||
ASN1_OCTET_STRING **out_digest) {
|
||||
if (out_alg != NULL) {
|
||||
*out_alg = sig->algor;
|
||||
}
|
||||
if (out_digest != NULL) {
|
||||
*out_digest = sig->digest;
|
||||
}
|
||||
}
|
||||
@@ -61,8 +61,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern const X509V3_EXT_METHOD v3_bcons, v3_nscert, v3_key_usage, v3_ext_ku;
|
||||
extern const X509V3_EXT_METHOD v3_pkey_usage_period, v3_sxnet, v3_info,
|
||||
v3_sinfo;
|
||||
extern const X509V3_EXT_METHOD v3_info, v3_sinfo;
|
||||
extern const X509V3_EXT_METHOD v3_ns_ia5_list[], v3_alt[], v3_skey_id,
|
||||
v3_akey_id;
|
||||
extern const X509V3_EXT_METHOD v3_crl_num, v3_crl_reason, v3_crl_invdate;
|
||||
@@ -96,7 +95,6 @@ static const X509V3_EXT_METHOD *const standard_exts[] = {
|
||||
&v3_ns_ia5_list[6],
|
||||
&v3_skey_id,
|
||||
&v3_key_usage,
|
||||
&v3_pkey_usage_period,
|
||||
&v3_alt[0],
|
||||
&v3_alt[1],
|
||||
&v3_bcons,
|
||||
@@ -108,7 +106,6 @@ static const X509V3_EXT_METHOD *const standard_exts[] = {
|
||||
&v3_delta_crl,
|
||||
&v3_crl_reason,
|
||||
&v3_crl_invdate,
|
||||
&v3_sxnet,
|
||||
&v3_info,
|
||||
#ifndef OPENSSL_NO_OCSP
|
||||
&v3_ocsp_nonce,
|
||||
|
||||
@@ -188,7 +188,7 @@ void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value)
|
||||
a->type = type;
|
||||
}
|
||||
|
||||
void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype)
|
||||
void *GENERAL_NAME_get0_value(const GENERAL_NAME *a, int *ptype)
|
||||
{
|
||||
if (ptype)
|
||||
*ptype = a->type;
|
||||
@@ -233,7 +233,7 @@ int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
|
||||
return 1;
|
||||
}
|
||||
|
||||
int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen,
|
||||
int GENERAL_NAME_get0_otherName(const GENERAL_NAME *gen,
|
||||
ASN1_OBJECT **poid, ASN1_TYPE **pvalue)
|
||||
{
|
||||
if (gen->type != GEN_OTHERNAME)
|
||||
|
||||
@@ -208,7 +208,7 @@ static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION *a)
|
||||
int i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION *a)
|
||||
{
|
||||
i2a_ASN1_OBJECT(bp, a->method);
|
||||
#ifdef UNDEF
|
||||
|
||||
@@ -1,110 +0,0 @@
|
||||
/* v3_pku.c */
|
||||
/*
|
||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
||||
* 1999.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com). */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <CNIOBoringSSL_asn1.h>
|
||||
#include <CNIOBoringSSL_asn1t.h>
|
||||
#include <CNIOBoringSSL_mem.h>
|
||||
#include <CNIOBoringSSL_obj.h>
|
||||
#include <CNIOBoringSSL_x509v3.h>
|
||||
|
||||
static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
|
||||
PKEY_USAGE_PERIOD *usage, BIO *out,
|
||||
int indent);
|
||||
/*
|
||||
* static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
|
||||
* X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *values);
|
||||
*/
|
||||
const X509V3_EXT_METHOD v3_pkey_usage_period = {
|
||||
NID_private_key_usage_period, 0, ASN1_ITEM_ref(PKEY_USAGE_PERIOD),
|
||||
0, 0, 0, 0,
|
||||
0, 0, 0, 0,
|
||||
(X509V3_EXT_I2R)i2r_PKEY_USAGE_PERIOD, NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
ASN1_SEQUENCE(PKEY_USAGE_PERIOD) = {
|
||||
ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notBefore, ASN1_GENERALIZEDTIME, 0),
|
||||
ASN1_IMP_OPT(PKEY_USAGE_PERIOD, notAfter, ASN1_GENERALIZEDTIME, 1)
|
||||
} ASN1_SEQUENCE_END(PKEY_USAGE_PERIOD)
|
||||
|
||||
IMPLEMENT_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
|
||||
|
||||
static int i2r_PKEY_USAGE_PERIOD(X509V3_EXT_METHOD *method,
|
||||
PKEY_USAGE_PERIOD *usage, BIO *out,
|
||||
int indent)
|
||||
{
|
||||
BIO_printf(out, "%*s", indent, "");
|
||||
if (usage->notBefore) {
|
||||
BIO_write(out, "Not Before: ", 12);
|
||||
ASN1_GENERALIZEDTIME_print(out, usage->notBefore);
|
||||
if (usage->notAfter)
|
||||
BIO_write(out, ", ", 2);
|
||||
}
|
||||
if (usage->notAfter) {
|
||||
BIO_write(out, "Not After: ", 11);
|
||||
ASN1_GENERALIZEDTIME_print(out, usage->notAfter);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* static PKEY_USAGE_PERIOD *v2i_PKEY_USAGE_PERIOD(method, ctx, values)
|
||||
* X509V3_EXT_METHOD *method; X509V3_CTX *ctx; STACK_OF(CONF_VALUE) *values;
|
||||
* { return NULL; }
|
||||
*/
|
||||
@@ -307,22 +307,22 @@ void X509_PURPOSE_cleanup(void)
|
||||
xptable = NULL;
|
||||
}
|
||||
|
||||
int X509_PURPOSE_get_id(X509_PURPOSE *xp)
|
||||
int X509_PURPOSE_get_id(const X509_PURPOSE *xp)
|
||||
{
|
||||
return xp->purpose;
|
||||
}
|
||||
|
||||
char *X509_PURPOSE_get0_name(X509_PURPOSE *xp)
|
||||
char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp)
|
||||
{
|
||||
return xp->name;
|
||||
}
|
||||
|
||||
char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp)
|
||||
char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp)
|
||||
{
|
||||
return xp->sname;
|
||||
}
|
||||
|
||||
int X509_PURPOSE_get_trust(X509_PURPOSE *xp)
|
||||
int X509_PURPOSE_get_trust(const X509_PURPOSE *xp)
|
||||
{
|
||||
return xp->trust;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ const X509V3_EXT_METHOD v3_skey_id = {
|
||||
NULL
|
||||
};
|
||||
|
||||
char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *oct)
|
||||
char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, const ASN1_OCTET_STRING *oct)
|
||||
{
|
||||
return x509v3_bytes_to_hex(oct->data, oct->length);
|
||||
}
|
||||
|
||||
@@ -1,274 +0,0 @@
|
||||
/* v3_sxnet.c */
|
||||
/*
|
||||
* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL project
|
||||
* 1999.
|
||||
*/
|
||||
/* ====================================================================
|
||||
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3. All advertising materials mentioning features or use of this
|
||||
* software must display the following acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
* endorse or promote products derived from this software without
|
||||
* prior written permission. For written permission, please contact
|
||||
* licensing@OpenSSL.org.
|
||||
*
|
||||
* 5. Products derived from this software may not be called "OpenSSL"
|
||||
* nor may "OpenSSL" appear in their names without prior written
|
||||
* permission of the OpenSSL Project.
|
||||
*
|
||||
* 6. Redistributions of any form whatsoever must retain the following
|
||||
* acknowledgment:
|
||||
* "This product includes software developed by the OpenSSL Project
|
||||
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* ====================================================================
|
||||
*
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com).
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <CNIOBoringSSL_asn1.h>
|
||||
#include <CNIOBoringSSL_asn1t.h>
|
||||
#include <CNIOBoringSSL_conf.h>
|
||||
#include <CNIOBoringSSL_err.h>
|
||||
#include <CNIOBoringSSL_mem.h>
|
||||
#include <CNIOBoringSSL_obj.h>
|
||||
#include <CNIOBoringSSL_x509v3.h>
|
||||
|
||||
/* Support for Thawte strong extranet extension */
|
||||
|
||||
#define SXNET_TEST
|
||||
|
||||
static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
|
||||
int indent);
|
||||
#ifdef SXNET_TEST
|
||||
static SXNET *sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
|
||||
STACK_OF(CONF_VALUE) *nval);
|
||||
#endif
|
||||
const X509V3_EXT_METHOD v3_sxnet = {
|
||||
NID_sxnet, X509V3_EXT_MULTILINE, ASN1_ITEM_ref(SXNET),
|
||||
0, 0, 0, 0,
|
||||
0, 0,
|
||||
0,
|
||||
#ifdef SXNET_TEST
|
||||
(X509V3_EXT_V2I)sxnet_v2i,
|
||||
#else
|
||||
0,
|
||||
#endif
|
||||
(X509V3_EXT_I2R)sxnet_i2r,
|
||||
0,
|
||||
NULL
|
||||
};
|
||||
|
||||
ASN1_SEQUENCE(SXNETID) = {
|
||||
ASN1_SIMPLE(SXNETID, zone, ASN1_INTEGER),
|
||||
ASN1_SIMPLE(SXNETID, user, ASN1_OCTET_STRING)
|
||||
} ASN1_SEQUENCE_END(SXNETID)
|
||||
|
||||
IMPLEMENT_ASN1_FUNCTIONS(SXNETID)
|
||||
|
||||
ASN1_SEQUENCE(SXNET) = {
|
||||
ASN1_SIMPLE(SXNET, version, ASN1_INTEGER),
|
||||
ASN1_SEQUENCE_OF(SXNET, ids, SXNETID)
|
||||
} ASN1_SEQUENCE_END(SXNET)
|
||||
|
||||
IMPLEMENT_ASN1_FUNCTIONS(SXNET)
|
||||
|
||||
static int sxnet_i2r(X509V3_EXT_METHOD *method, SXNET *sx, BIO *out,
|
||||
int indent)
|
||||
{
|
||||
long v;
|
||||
char *tmp;
|
||||
SXNETID *id;
|
||||
size_t i;
|
||||
v = ASN1_INTEGER_get(sx->version);
|
||||
BIO_printf(out, "%*sVersion: %ld (0x%lX)", indent, "", v + 1, v);
|
||||
for (i = 0; i < sk_SXNETID_num(sx->ids); i++) {
|
||||
id = sk_SXNETID_value(sx->ids, i);
|
||||
tmp = i2s_ASN1_INTEGER(NULL, id->zone);
|
||||
BIO_printf(out, "\n%*sZone: %s, User: ", indent, "", tmp);
|
||||
OPENSSL_free(tmp);
|
||||
M_ASN1_OCTET_STRING_print(out, id->user);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef SXNET_TEST
|
||||
|
||||
/*
|
||||
* NBB: this is used for testing only. It should *not* be used for anything
|
||||
* else because it will just take static IDs from the configuration file and
|
||||
* they should really be separate values for each user.
|
||||
*/
|
||||
|
||||
static SXNET *sxnet_v2i(X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
|
||||
STACK_OF(CONF_VALUE) *nval)
|
||||
{
|
||||
CONF_VALUE *cnf;
|
||||
SXNET *sx = NULL;
|
||||
size_t i;
|
||||
for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
|
||||
cnf = sk_CONF_VALUE_value(nval, i);
|
||||
if (!SXNET_add_id_asc(&sx, cnf->name, cnf->value, -1))
|
||||
return NULL;
|
||||
}
|
||||
return sx;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Strong Extranet utility functions */
|
||||
|
||||
/* Add an id given the zone as an ASCII number */
|
||||
|
||||
int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen)
|
||||
{
|
||||
ASN1_INTEGER *izone = NULL;
|
||||
if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) {
|
||||
OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CONVERTING_ZONE);
|
||||
return 0;
|
||||
}
|
||||
return SXNET_add_id_INTEGER(psx, izone, user, userlen);
|
||||
}
|
||||
|
||||
/* Add an id given the zone as an unsigned long */
|
||||
|
||||
int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user,
|
||||
int userlen)
|
||||
{
|
||||
ASN1_INTEGER *izone = NULL;
|
||||
if (!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
|
||||
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
||||
M_ASN1_INTEGER_free(izone);
|
||||
return 0;
|
||||
}
|
||||
return SXNET_add_id_INTEGER(psx, izone, user, userlen);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Add an id given the zone as an ASN1_INTEGER. Note this version uses the
|
||||
* passed integer and doesn't make a copy so don't free it up afterwards.
|
||||
*/
|
||||
|
||||
int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *zone, char *user,
|
||||
int userlen)
|
||||
{
|
||||
SXNET *sx = NULL;
|
||||
SXNETID *id = NULL;
|
||||
if (!psx || !zone || !user) {
|
||||
OPENSSL_PUT_ERROR(X509V3, X509V3_R_INVALID_NULL_ARGUMENT);
|
||||
return 0;
|
||||
}
|
||||
if (userlen == -1)
|
||||
userlen = strlen(user);
|
||||
if (userlen > 64) {
|
||||
OPENSSL_PUT_ERROR(X509V3, X509V3_R_USER_TOO_LONG);
|
||||
return 0;
|
||||
}
|
||||
if (!*psx) {
|
||||
if (!(sx = SXNET_new()))
|
||||
goto err;
|
||||
if (!ASN1_INTEGER_set(sx->version, 0))
|
||||
goto err;
|
||||
*psx = sx;
|
||||
} else
|
||||
sx = *psx;
|
||||
if (SXNET_get_id_INTEGER(sx, zone)) {
|
||||
OPENSSL_PUT_ERROR(X509V3, X509V3_R_DUPLICATE_ZONE_ID);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(id = SXNETID_new()))
|
||||
goto err;
|
||||
if (userlen == -1)
|
||||
userlen = strlen(user);
|
||||
|
||||
if (!M_ASN1_OCTET_STRING_set(id->user, user, userlen))
|
||||
goto err;
|
||||
if (!sk_SXNETID_push(sx->ids, id))
|
||||
goto err;
|
||||
id->zone = zone;
|
||||
return 1;
|
||||
|
||||
err:
|
||||
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
||||
SXNETID_free(id);
|
||||
SXNET_free(sx);
|
||||
*psx = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone)
|
||||
{
|
||||
ASN1_INTEGER *izone = NULL;
|
||||
ASN1_OCTET_STRING *oct;
|
||||
if (!(izone = s2i_ASN1_INTEGER(NULL, zone))) {
|
||||
OPENSSL_PUT_ERROR(X509V3, X509V3_R_ERROR_CONVERTING_ZONE);
|
||||
return NULL;
|
||||
}
|
||||
oct = SXNET_get_id_INTEGER(sx, izone);
|
||||
M_ASN1_INTEGER_free(izone);
|
||||
return oct;
|
||||
}
|
||||
|
||||
ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone)
|
||||
{
|
||||
ASN1_INTEGER *izone = NULL;
|
||||
ASN1_OCTET_STRING *oct;
|
||||
if (!(izone = M_ASN1_INTEGER_new()) || !ASN1_INTEGER_set(izone, lzone)) {
|
||||
OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE);
|
||||
M_ASN1_INTEGER_free(izone);
|
||||
return NULL;
|
||||
}
|
||||
oct = SXNET_get_id_INTEGER(sx, izone);
|
||||
M_ASN1_INTEGER_free(izone);
|
||||
return oct;
|
||||
}
|
||||
|
||||
ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone)
|
||||
{
|
||||
SXNETID *id;
|
||||
size_t i;
|
||||
for (i = 0; i < sk_SXNETID_num(sx->ids); i++) {
|
||||
id = sk_SXNETID_value(sx->ids, i);
|
||||
if (!M_ASN1_INTEGER_cmp(id->zone, zone))
|
||||
return id->user;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
IMPLEMENT_ASN1_SET_OF(SXNETID)
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
This directory is derived from BoringSSL cloned from https://boringssl.googlesource.com/boringssl at revision 54858b63c1d886f6c8d903d4a4f594f1485de189
|
||||
This directory is derived from BoringSSL cloned from https://boringssl.googlesource.com/boringssl at revision 1c58648f14ed75f2a8cc3ae08897987d97f493ec
|
||||
@@ -49,6 +49,7 @@
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com). */
|
||||
|
||||
#if __arm__ || __arm64__ || __aarch64__
|
||||
#ifndef OPENSSL_HEADER_ARM_ARCH_H
|
||||
#define OPENSSL_HEADER_ARM_ARCH_H
|
||||
@@ -117,6 +118,58 @@
|
||||
// ARMV8_PMULL indicates support for carryless multiplication.
|
||||
#define ARMV8_PMULL (1 << 5)
|
||||
|
||||
#if defined(__ASSEMBLER__)
|
||||
|
||||
// Support macros for
|
||||
// - Armv8.3-A Pointer Authentication and
|
||||
// - Armv8.5-A Branch Target Identification
|
||||
// features which require emitting a .note.gnu.property section with the
|
||||
// appropriate architecture-dependent feature bits set.
|
||||
// Read more: "ELF for the Arm® 64-bit Architecture"
|
||||
|
||||
#if (__ARM_FEATURE_BTI_DEFAULT == 1)
|
||||
#define GNU_PROPERTY_AARCH64_BTI (1 << 0) // Has Branch Target Identification
|
||||
#define AARCH64_VALID_CALL_TARGET hint #34 // BTI 'c'
|
||||
#else
|
||||
#define GNU_PROPERTY_AARCH64_BTI 0 // No Branch Target Identification
|
||||
#define AARCH64_VALID_CALL_TARGET
|
||||
#endif
|
||||
|
||||
#if ((__ARM_FEATURE_PAC_DEFAULT & 1) == 1) // Signed with A-key
|
||||
#define GNU_PROPERTY_AARCH64_POINTER_AUTH \
|
||||
(1 << 1) // Has Pointer Authentication
|
||||
#define AARCH64_SIGN_LINK_REGISTER hint #25 // PACIASP
|
||||
#define AARCH64_VALIDATE_LINK_REGISTER hint #29 // AUTIASP
|
||||
#elif ((__ARM_FEATURE_PAC_DEFAULT & 2) == 2) // Signed with B-key
|
||||
#define GNU_PROPERTY_AARCH64_POINTER_AUTH \
|
||||
(1 << 1) // Has Pointer Authentication
|
||||
#define AARCH64_SIGN_LINK_REGISTER hint #27 // PACIBSP
|
||||
#define AARCH64_VALIDATE_LINK_REGISTER hint #31 // AUTIBSP
|
||||
#else
|
||||
#define GNU_PROPERTY_AARCH64_POINTER_AUTH 0 // No Pointer Authentication
|
||||
#if defined(__ARM_FEATURE_BTI_DEFAULT)
|
||||
#define AARCH64_SIGN_LINK_REGISTER AARCH64_VALID_CALL_TARGET
|
||||
#else
|
||||
#define AARCH64_SIGN_LINK_REGISTER
|
||||
#endif
|
||||
#define AARCH64_VALIDATE_LINK_REGISTER
|
||||
#endif
|
||||
|
||||
#if (GNU_PROPERTY_AARCH64_POINTER_AUTH != 0) || (GNU_PROPERTY_AARCH64_BTI != 0)
|
||||
.pushsection note.gnu.property, "a";
|
||||
.balign 8;
|
||||
.long 4;
|
||||
.long 0x10;
|
||||
.long 0x5;
|
||||
.asciz "GNU";
|
||||
.long 0xc0000000; /* GNU_PROPERTY_AARCH64_FEATURE_1_AND */
|
||||
.long 4;
|
||||
.long (GNU_PROPERTY_AARCH64_POINTER_AUTH | GNU_PROPERTY_AARCH64_BTI);
|
||||
.long 0
|
||||
.popsection
|
||||
#endif
|
||||
|
||||
#endif /* defined __ASSEMBLER__ */
|
||||
|
||||
#endif // OPENSSL_HEADER_ARM_ARCH_H
|
||||
#endif // __arm__ || __arm64__ || __aarch64__
|
||||
@@ -189,7 +189,7 @@ extern "C" {
|
||||
// A consumer may use this symbol in the preprocessor to temporarily build
|
||||
// against multiple revisions of BoringSSL at the same time. It is not
|
||||
// recommended to do so for longer than is necessary.
|
||||
#define BORINGSSL_API_VERSION 10
|
||||
#define BORINGSSL_API_VERSION 11
|
||||
|
||||
#if defined(BORINGSSL_SHARED_LIBRARY)
|
||||
|
||||
|
||||
@@ -958,6 +958,15 @@
|
||||
#define EVP_EncryptInit BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncryptInit)
|
||||
#define EVP_EncryptInit_ex BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncryptInit_ex)
|
||||
#define EVP_EncryptUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_EncryptUpdate)
|
||||
#define EVP_HPKE_CTX_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_cleanup)
|
||||
#define EVP_HPKE_CTX_export BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_export)
|
||||
#define EVP_HPKE_CTX_init BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_init)
|
||||
#define EVP_HPKE_CTX_max_overhead BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_max_overhead)
|
||||
#define EVP_HPKE_CTX_open BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_open)
|
||||
#define EVP_HPKE_CTX_seal BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_seal)
|
||||
#define EVP_HPKE_CTX_setup_base_r_x25519 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_r_x25519)
|
||||
#define EVP_HPKE_CTX_setup_base_s_x25519 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_s_x25519)
|
||||
#define EVP_HPKE_CTX_setup_base_s_x25519_for_test BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_s_x25519_for_test)
|
||||
#define EVP_MD_CTX_block_size BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_block_size)
|
||||
#define EVP_MD_CTX_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_cleanup)
|
||||
#define EVP_MD_CTX_copy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, EVP_MD_CTX_copy)
|
||||
@@ -1422,9 +1431,6 @@
|
||||
#define PKCS8_parse_encrypted_private_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS8_parse_encrypted_private_key)
|
||||
#define PKCS8_pkey_get0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS8_pkey_get0)
|
||||
#define PKCS8_pkey_set0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKCS8_pkey_set0)
|
||||
#define PKEY_USAGE_PERIOD_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKEY_USAGE_PERIOD_free)
|
||||
#define PKEY_USAGE_PERIOD_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKEY_USAGE_PERIOD_it)
|
||||
#define PKEY_USAGE_PERIOD_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PKEY_USAGE_PERIOD_new)
|
||||
#define PMBTOKEN_PRETOKEN_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, PMBTOKEN_PRETOKEN_free)
|
||||
#define POLICYINFO_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, POLICYINFO_free)
|
||||
#define POLICYINFO_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, POLICYINFO_it)
|
||||
@@ -1827,6 +1833,7 @@
|
||||
#define SSL_get0_ocsp_response BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_ocsp_response)
|
||||
#define SSL_get0_param BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_param)
|
||||
#define SSL_get0_peer_certificates BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_peer_certificates)
|
||||
#define SSL_get0_peer_delegation_algorithms BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_peer_delegation_algorithms)
|
||||
#define SSL_get0_peer_verify_algorithms BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_peer_verify_algorithms)
|
||||
#define SSL_get0_server_requested_CAs BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_server_requested_CAs)
|
||||
#define SSL_get0_session_id_context BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSL_get0_session_id_context)
|
||||
@@ -2040,18 +2047,6 @@
|
||||
#define SSLv23_client_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSLv23_client_method)
|
||||
#define SSLv23_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSLv23_method)
|
||||
#define SSLv23_server_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SSLv23_server_method)
|
||||
#define SXNETID_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNETID_free)
|
||||
#define SXNETID_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNETID_it)
|
||||
#define SXNETID_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNETID_new)
|
||||
#define SXNET_add_id_INTEGER BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_add_id_INTEGER)
|
||||
#define SXNET_add_id_asc BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_add_id_asc)
|
||||
#define SXNET_add_id_ulong BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_add_id_ulong)
|
||||
#define SXNET_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_free)
|
||||
#define SXNET_get_id_INTEGER BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_get_id_INTEGER)
|
||||
#define SXNET_get_id_asc BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_get_id_asc)
|
||||
#define SXNET_get_id_ulong BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_get_id_ulong)
|
||||
#define SXNET_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_it)
|
||||
#define SXNET_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, SXNET_new)
|
||||
#define TLS_client_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, TLS_client_method)
|
||||
#define TLS_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, TLS_method)
|
||||
#define TLS_server_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, TLS_server_method)
|
||||
@@ -2202,11 +2197,11 @@
|
||||
#define X509_CRL_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_new)
|
||||
#define X509_CRL_print BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_print)
|
||||
#define X509_CRL_print_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_print_fp)
|
||||
#define X509_CRL_set1_lastUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set1_lastUpdate)
|
||||
#define X509_CRL_set1_nextUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set1_nextUpdate)
|
||||
#define X509_CRL_set_default_method BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_default_method)
|
||||
#define X509_CRL_set_issuer_name BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_issuer_name)
|
||||
#define X509_CRL_set_lastUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_lastUpdate)
|
||||
#define X509_CRL_set_meth_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_meth_data)
|
||||
#define X509_CRL_set_nextUpdate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_nextUpdate)
|
||||
#define X509_CRL_set_version BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_set_version)
|
||||
#define X509_CRL_sign BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_sign)
|
||||
#define X509_CRL_sign_ctx BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_CRL_sign_ctx)
|
||||
@@ -2364,6 +2359,8 @@
|
||||
#define X509_REVOKED_set_revocationDate BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_REVOKED_set_revocationDate)
|
||||
#define X509_REVOKED_set_serialNumber BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_REVOKED_set_serialNumber)
|
||||
#define X509_SIG_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_SIG_free)
|
||||
#define X509_SIG_get0 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_SIG_get0)
|
||||
#define X509_SIG_getm BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_SIG_getm)
|
||||
#define X509_SIG_it BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_SIG_it)
|
||||
#define X509_SIG_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_SIG_new)
|
||||
#define X509_STORE_CTX_cleanup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_STORE_CTX_cleanup)
|
||||
@@ -2518,8 +2515,10 @@
|
||||
#define X509_get0_notAfter BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get0_notAfter)
|
||||
#define X509_get0_notBefore BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get0_notBefore)
|
||||
#define X509_get0_pubkey_bitstr BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get0_pubkey_bitstr)
|
||||
#define X509_get0_serialNumber BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get0_serialNumber)
|
||||
#define X509_get0_signature BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get0_signature)
|
||||
#define X509_get0_tbs_sigalg BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get0_tbs_sigalg)
|
||||
#define X509_get0_uids BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get0_uids)
|
||||
#define X509_get1_email BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get1_email)
|
||||
#define X509_get1_ocsp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get1_ocsp)
|
||||
#define X509_get_X509_PUBKEY BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_get_X509_PUBKEY)
|
||||
@@ -2583,6 +2582,8 @@
|
||||
#define X509_print_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_print_fp)
|
||||
#define X509_pubkey_digest BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_pubkey_digest)
|
||||
#define X509_reject_clear BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_reject_clear)
|
||||
#define X509_set1_notAfter BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_set1_notAfter)
|
||||
#define X509_set1_notBefore BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_set1_notBefore)
|
||||
#define X509_set_ex_data BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_set_ex_data)
|
||||
#define X509_set_issuer_name BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_set_issuer_name)
|
||||
#define X509_set_notAfter BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, X509_set_notAfter)
|
||||
@@ -2843,7 +2844,6 @@
|
||||
#define d2i_PKCS8_PRIV_KEY_INFO_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_PKCS8_PRIV_KEY_INFO_fp)
|
||||
#define d2i_PKCS8_bio BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_PKCS8_bio)
|
||||
#define d2i_PKCS8_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_PKCS8_fp)
|
||||
#define d2i_PKEY_USAGE_PERIOD BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_PKEY_USAGE_PERIOD)
|
||||
#define d2i_POLICYINFO BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_POLICYINFO)
|
||||
#define d2i_POLICYQUALINFO BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_POLICYQUALINFO)
|
||||
#define d2i_PROXY_CERT_INFO_EXTENSION BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_PROXY_CERT_INFO_EXTENSION)
|
||||
@@ -2867,8 +2867,6 @@
|
||||
#define d2i_RSA_PUBKEY_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_RSA_PUBKEY_fp)
|
||||
#define d2i_SSL_SESSION BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_SSL_SESSION)
|
||||
#define d2i_SSL_SESSION_bio BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_SSL_SESSION_bio)
|
||||
#define d2i_SXNET BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_SXNET)
|
||||
#define d2i_SXNETID BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_SXNETID)
|
||||
#define d2i_USERNOTICE BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_USERNOTICE)
|
||||
#define d2i_X509 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_X509)
|
||||
#define d2i_X509_ALGOR BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_X509_ALGOR)
|
||||
@@ -2896,6 +2894,7 @@
|
||||
#define d2i_X509_bio BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_X509_bio)
|
||||
#define d2i_X509_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, d2i_X509_fp)
|
||||
#define dsa_asn1_meth BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, dsa_asn1_meth)
|
||||
#define dsa_check_parameters BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, dsa_check_parameters)
|
||||
#define ec_GFp_mont_add BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ec_GFp_mont_add)
|
||||
#define ec_GFp_mont_dbl BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ec_GFp_mont_dbl)
|
||||
#define ec_GFp_mont_felem_from_bytes BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, ec_GFp_mont_felem_from_bytes)
|
||||
@@ -3095,7 +3094,6 @@
|
||||
#define i2d_PKCS8_PRIV_KEY_INFO_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_PKCS8_PRIV_KEY_INFO_fp)
|
||||
#define i2d_PKCS8_bio BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_PKCS8_bio)
|
||||
#define i2d_PKCS8_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_PKCS8_fp)
|
||||
#define i2d_PKEY_USAGE_PERIOD BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_PKEY_USAGE_PERIOD)
|
||||
#define i2d_POLICYINFO BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_POLICYINFO)
|
||||
#define i2d_POLICYQUALINFO BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_POLICYQUALINFO)
|
||||
#define i2d_PROXY_CERT_INFO_EXTENSION BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_PROXY_CERT_INFO_EXTENSION)
|
||||
@@ -3119,8 +3117,6 @@
|
||||
#define i2d_RSA_PUBKEY_fp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_RSA_PUBKEY_fp)
|
||||
#define i2d_SSL_SESSION BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_SSL_SESSION)
|
||||
#define i2d_SSL_SESSION_bio BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_SSL_SESSION_bio)
|
||||
#define i2d_SXNET BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_SXNET)
|
||||
#define i2d_SXNETID BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_SXNETID)
|
||||
#define i2d_USERNOTICE BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_USERNOTICE)
|
||||
#define i2d_X509 BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_X509)
|
||||
#define i2d_X509_ALGOR BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, i2d_X509_ALGOR)
|
||||
@@ -3204,6 +3200,7 @@
|
||||
#define poly_Rq_mul BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, poly_Rq_mul)
|
||||
#define rand_fork_unsafe_buffering_enabled BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, rand_fork_unsafe_buffering_enabled)
|
||||
#define rsa_asn1_meth BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, rsa_asn1_meth)
|
||||
#define rsa_check_public_key BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, rsa_check_public_key)
|
||||
#define rsa_default_decrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, rsa_default_decrypt)
|
||||
#define rsa_default_private_transform BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, rsa_default_private_transform)
|
||||
#define rsa_default_sign_raw BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, rsa_default_sign_raw)
|
||||
@@ -3304,12 +3301,10 @@
|
||||
#define v3_ocsp_accresp BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_ocsp_accresp)
|
||||
#define v3_ocsp_nocheck BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_ocsp_nocheck)
|
||||
#define v3_pci BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_pci)
|
||||
#define v3_pkey_usage_period BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_pkey_usage_period)
|
||||
#define v3_policy_constraints BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_policy_constraints)
|
||||
#define v3_policy_mappings BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_policy_mappings)
|
||||
#define v3_sinfo BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_sinfo)
|
||||
#define v3_skey_id BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_skey_id)
|
||||
#define v3_sxnet BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, v3_sxnet)
|
||||
#define vpaes_cbc_encrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, vpaes_cbc_encrypt)
|
||||
#define vpaes_ctr32_encrypt_blocks BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, vpaes_ctr32_encrypt_blocks)
|
||||
#define vpaes_decrypt BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, vpaes_decrypt)
|
||||
@@ -3983,29 +3978,6 @@
|
||||
#define sk_DIST_POINT_is_sorted BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_DIST_POINT_is_sorted)
|
||||
#define sk_DIST_POINT_set_cmp_func BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_DIST_POINT_set_cmp_func)
|
||||
#define sk_DIST_POINT_deep_copy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_DIST_POINT_deep_copy)
|
||||
#define sk_SXNETID_call_free_func BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_call_free_func)
|
||||
#define sk_SXNETID_call_copy_func BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_call_copy_func)
|
||||
#define sk_SXNETID_call_cmp_func BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_call_cmp_func)
|
||||
#define sk_SXNETID_new BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_new)
|
||||
#define sk_SXNETID_new_null BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_new_null)
|
||||
#define sk_SXNETID_num BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_num)
|
||||
#define sk_SXNETID_zero BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_zero)
|
||||
#define sk_SXNETID_value BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_value)
|
||||
#define sk_SXNETID_set BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_set)
|
||||
#define sk_SXNETID_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_free)
|
||||
#define sk_SXNETID_pop_free BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_pop_free)
|
||||
#define sk_SXNETID_insert BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_insert)
|
||||
#define sk_SXNETID_delete BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_delete)
|
||||
#define sk_SXNETID_delete_ptr BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_delete_ptr)
|
||||
#define sk_SXNETID_find BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_find)
|
||||
#define sk_SXNETID_shift BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_shift)
|
||||
#define sk_SXNETID_push BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_push)
|
||||
#define sk_SXNETID_pop BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_pop)
|
||||
#define sk_SXNETID_dup BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_dup)
|
||||
#define sk_SXNETID_sort BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_sort)
|
||||
#define sk_SXNETID_is_sorted BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_is_sorted)
|
||||
#define sk_SXNETID_set_cmp_func BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_set_cmp_func)
|
||||
#define sk_SXNETID_deep_copy BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_SXNETID_deep_copy)
|
||||
#define sk_POLICYQUALINFO_call_free_func BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_POLICYQUALINFO_call_free_func)
|
||||
#define sk_POLICYQUALINFO_call_copy_func BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_POLICYQUALINFO_call_copy_func)
|
||||
#define sk_POLICYQUALINFO_call_cmp_func BORINGSSL_ADD_PREFIX(BORINGSSL_PREFIX, sk_POLICYQUALINFO_call_cmp_func)
|
||||
|
||||
@@ -963,6 +963,15 @@
|
||||
#define _EVP_EncryptInit BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_EncryptInit)
|
||||
#define _EVP_EncryptInit_ex BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_EncryptInit_ex)
|
||||
#define _EVP_EncryptUpdate BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_EncryptUpdate)
|
||||
#define _EVP_HPKE_CTX_cleanup BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_cleanup)
|
||||
#define _EVP_HPKE_CTX_export BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_export)
|
||||
#define _EVP_HPKE_CTX_init BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_init)
|
||||
#define _EVP_HPKE_CTX_max_overhead BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_max_overhead)
|
||||
#define _EVP_HPKE_CTX_open BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_open)
|
||||
#define _EVP_HPKE_CTX_seal BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_seal)
|
||||
#define _EVP_HPKE_CTX_setup_base_r_x25519 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_r_x25519)
|
||||
#define _EVP_HPKE_CTX_setup_base_s_x25519 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_s_x25519)
|
||||
#define _EVP_HPKE_CTX_setup_base_s_x25519_for_test BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_HPKE_CTX_setup_base_s_x25519_for_test)
|
||||
#define _EVP_MD_CTX_block_size BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_MD_CTX_block_size)
|
||||
#define _EVP_MD_CTX_cleanup BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_MD_CTX_cleanup)
|
||||
#define _EVP_MD_CTX_copy BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, EVP_MD_CTX_copy)
|
||||
@@ -1427,9 +1436,6 @@
|
||||
#define _PKCS8_parse_encrypted_private_key BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, PKCS8_parse_encrypted_private_key)
|
||||
#define _PKCS8_pkey_get0 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, PKCS8_pkey_get0)
|
||||
#define _PKCS8_pkey_set0 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, PKCS8_pkey_set0)
|
||||
#define _PKEY_USAGE_PERIOD_free BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, PKEY_USAGE_PERIOD_free)
|
||||
#define _PKEY_USAGE_PERIOD_it BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, PKEY_USAGE_PERIOD_it)
|
||||
#define _PKEY_USAGE_PERIOD_new BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, PKEY_USAGE_PERIOD_new)
|
||||
#define _PMBTOKEN_PRETOKEN_free BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, PMBTOKEN_PRETOKEN_free)
|
||||
#define _POLICYINFO_free BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, POLICYINFO_free)
|
||||
#define _POLICYINFO_it BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, POLICYINFO_it)
|
||||
@@ -1832,6 +1838,7 @@
|
||||
#define _SSL_get0_ocsp_response BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSL_get0_ocsp_response)
|
||||
#define _SSL_get0_param BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSL_get0_param)
|
||||
#define _SSL_get0_peer_certificates BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSL_get0_peer_certificates)
|
||||
#define _SSL_get0_peer_delegation_algorithms BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSL_get0_peer_delegation_algorithms)
|
||||
#define _SSL_get0_peer_verify_algorithms BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSL_get0_peer_verify_algorithms)
|
||||
#define _SSL_get0_server_requested_CAs BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSL_get0_server_requested_CAs)
|
||||
#define _SSL_get0_session_id_context BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSL_get0_session_id_context)
|
||||
@@ -2045,18 +2052,6 @@
|
||||
#define _SSLv23_client_method BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSLv23_client_method)
|
||||
#define _SSLv23_method BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSLv23_method)
|
||||
#define _SSLv23_server_method BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SSLv23_server_method)
|
||||
#define _SXNETID_free BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNETID_free)
|
||||
#define _SXNETID_it BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNETID_it)
|
||||
#define _SXNETID_new BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNETID_new)
|
||||
#define _SXNET_add_id_INTEGER BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_add_id_INTEGER)
|
||||
#define _SXNET_add_id_asc BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_add_id_asc)
|
||||
#define _SXNET_add_id_ulong BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_add_id_ulong)
|
||||
#define _SXNET_free BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_free)
|
||||
#define _SXNET_get_id_INTEGER BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_get_id_INTEGER)
|
||||
#define _SXNET_get_id_asc BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_get_id_asc)
|
||||
#define _SXNET_get_id_ulong BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_get_id_ulong)
|
||||
#define _SXNET_it BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_it)
|
||||
#define _SXNET_new BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, SXNET_new)
|
||||
#define _TLS_client_method BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, TLS_client_method)
|
||||
#define _TLS_method BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, TLS_method)
|
||||
#define _TLS_server_method BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, TLS_server_method)
|
||||
@@ -2207,11 +2202,11 @@
|
||||
#define _X509_CRL_new BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_new)
|
||||
#define _X509_CRL_print BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_print)
|
||||
#define _X509_CRL_print_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_print_fp)
|
||||
#define _X509_CRL_set1_lastUpdate BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_set1_lastUpdate)
|
||||
#define _X509_CRL_set1_nextUpdate BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_set1_nextUpdate)
|
||||
#define _X509_CRL_set_default_method BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_set_default_method)
|
||||
#define _X509_CRL_set_issuer_name BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_set_issuer_name)
|
||||
#define _X509_CRL_set_lastUpdate BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_set_lastUpdate)
|
||||
#define _X509_CRL_set_meth_data BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_set_meth_data)
|
||||
#define _X509_CRL_set_nextUpdate BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_set_nextUpdate)
|
||||
#define _X509_CRL_set_version BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_set_version)
|
||||
#define _X509_CRL_sign BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_sign)
|
||||
#define _X509_CRL_sign_ctx BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_CRL_sign_ctx)
|
||||
@@ -2369,6 +2364,8 @@
|
||||
#define _X509_REVOKED_set_revocationDate BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_REVOKED_set_revocationDate)
|
||||
#define _X509_REVOKED_set_serialNumber BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_REVOKED_set_serialNumber)
|
||||
#define _X509_SIG_free BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_SIG_free)
|
||||
#define _X509_SIG_get0 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_SIG_get0)
|
||||
#define _X509_SIG_getm BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_SIG_getm)
|
||||
#define _X509_SIG_it BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_SIG_it)
|
||||
#define _X509_SIG_new BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_SIG_new)
|
||||
#define _X509_STORE_CTX_cleanup BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_STORE_CTX_cleanup)
|
||||
@@ -2523,8 +2520,10 @@
|
||||
#define _X509_get0_notAfter BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get0_notAfter)
|
||||
#define _X509_get0_notBefore BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get0_notBefore)
|
||||
#define _X509_get0_pubkey_bitstr BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get0_pubkey_bitstr)
|
||||
#define _X509_get0_serialNumber BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get0_serialNumber)
|
||||
#define _X509_get0_signature BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get0_signature)
|
||||
#define _X509_get0_tbs_sigalg BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get0_tbs_sigalg)
|
||||
#define _X509_get0_uids BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get0_uids)
|
||||
#define _X509_get1_email BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get1_email)
|
||||
#define _X509_get1_ocsp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get1_ocsp)
|
||||
#define _X509_get_X509_PUBKEY BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_get_X509_PUBKEY)
|
||||
@@ -2588,6 +2587,8 @@
|
||||
#define _X509_print_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_print_fp)
|
||||
#define _X509_pubkey_digest BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_pubkey_digest)
|
||||
#define _X509_reject_clear BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_reject_clear)
|
||||
#define _X509_set1_notAfter BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_set1_notAfter)
|
||||
#define _X509_set1_notBefore BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_set1_notBefore)
|
||||
#define _X509_set_ex_data BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_set_ex_data)
|
||||
#define _X509_set_issuer_name BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_set_issuer_name)
|
||||
#define _X509_set_notAfter BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, X509_set_notAfter)
|
||||
@@ -2848,7 +2849,6 @@
|
||||
#define _d2i_PKCS8_PRIV_KEY_INFO_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_PKCS8_PRIV_KEY_INFO_fp)
|
||||
#define _d2i_PKCS8_bio BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_PKCS8_bio)
|
||||
#define _d2i_PKCS8_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_PKCS8_fp)
|
||||
#define _d2i_PKEY_USAGE_PERIOD BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_PKEY_USAGE_PERIOD)
|
||||
#define _d2i_POLICYINFO BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_POLICYINFO)
|
||||
#define _d2i_POLICYQUALINFO BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_POLICYQUALINFO)
|
||||
#define _d2i_PROXY_CERT_INFO_EXTENSION BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_PROXY_CERT_INFO_EXTENSION)
|
||||
@@ -2872,8 +2872,6 @@
|
||||
#define _d2i_RSA_PUBKEY_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_RSA_PUBKEY_fp)
|
||||
#define _d2i_SSL_SESSION BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_SSL_SESSION)
|
||||
#define _d2i_SSL_SESSION_bio BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_SSL_SESSION_bio)
|
||||
#define _d2i_SXNET BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_SXNET)
|
||||
#define _d2i_SXNETID BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_SXNETID)
|
||||
#define _d2i_USERNOTICE BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_USERNOTICE)
|
||||
#define _d2i_X509 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_X509)
|
||||
#define _d2i_X509_ALGOR BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_X509_ALGOR)
|
||||
@@ -2901,6 +2899,7 @@
|
||||
#define _d2i_X509_bio BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_X509_bio)
|
||||
#define _d2i_X509_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, d2i_X509_fp)
|
||||
#define _dsa_asn1_meth BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, dsa_asn1_meth)
|
||||
#define _dsa_check_parameters BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, dsa_check_parameters)
|
||||
#define _ec_GFp_mont_add BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, ec_GFp_mont_add)
|
||||
#define _ec_GFp_mont_dbl BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, ec_GFp_mont_dbl)
|
||||
#define _ec_GFp_mont_felem_from_bytes BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, ec_GFp_mont_felem_from_bytes)
|
||||
@@ -3100,7 +3099,6 @@
|
||||
#define _i2d_PKCS8_PRIV_KEY_INFO_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_PKCS8_PRIV_KEY_INFO_fp)
|
||||
#define _i2d_PKCS8_bio BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_PKCS8_bio)
|
||||
#define _i2d_PKCS8_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_PKCS8_fp)
|
||||
#define _i2d_PKEY_USAGE_PERIOD BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_PKEY_USAGE_PERIOD)
|
||||
#define _i2d_POLICYINFO BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_POLICYINFO)
|
||||
#define _i2d_POLICYQUALINFO BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_POLICYQUALINFO)
|
||||
#define _i2d_PROXY_CERT_INFO_EXTENSION BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_PROXY_CERT_INFO_EXTENSION)
|
||||
@@ -3124,8 +3122,6 @@
|
||||
#define _i2d_RSA_PUBKEY_fp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_RSA_PUBKEY_fp)
|
||||
#define _i2d_SSL_SESSION BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_SSL_SESSION)
|
||||
#define _i2d_SSL_SESSION_bio BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_SSL_SESSION_bio)
|
||||
#define _i2d_SXNET BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_SXNET)
|
||||
#define _i2d_SXNETID BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_SXNETID)
|
||||
#define _i2d_USERNOTICE BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_USERNOTICE)
|
||||
#define _i2d_X509 BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_X509)
|
||||
#define _i2d_X509_ALGOR BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, i2d_X509_ALGOR)
|
||||
@@ -3209,6 +3205,7 @@
|
||||
#define _poly_Rq_mul BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, poly_Rq_mul)
|
||||
#define _rand_fork_unsafe_buffering_enabled BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, rand_fork_unsafe_buffering_enabled)
|
||||
#define _rsa_asn1_meth BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, rsa_asn1_meth)
|
||||
#define _rsa_check_public_key BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, rsa_check_public_key)
|
||||
#define _rsa_default_decrypt BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, rsa_default_decrypt)
|
||||
#define _rsa_default_private_transform BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, rsa_default_private_transform)
|
||||
#define _rsa_default_sign_raw BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, rsa_default_sign_raw)
|
||||
@@ -3309,12 +3306,10 @@
|
||||
#define _v3_ocsp_accresp BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_ocsp_accresp)
|
||||
#define _v3_ocsp_nocheck BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_ocsp_nocheck)
|
||||
#define _v3_pci BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_pci)
|
||||
#define _v3_pkey_usage_period BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_pkey_usage_period)
|
||||
#define _v3_policy_constraints BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_policy_constraints)
|
||||
#define _v3_policy_mappings BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_policy_mappings)
|
||||
#define _v3_sinfo BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_sinfo)
|
||||
#define _v3_skey_id BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_skey_id)
|
||||
#define _v3_sxnet BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, v3_sxnet)
|
||||
#define _vpaes_cbc_encrypt BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, vpaes_cbc_encrypt)
|
||||
#define _vpaes_ctr32_encrypt_blocks BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, vpaes_ctr32_encrypt_blocks)
|
||||
#define _vpaes_decrypt BORINGSSL_ADD_PREFIX_MAC_ASM(BORINGSSL_PREFIX, vpaes_decrypt)
|
||||
|
||||
@@ -219,7 +219,9 @@ OPENSSL_EXPORT int EVP_marshal_public_key(CBB *cbb, const EVP_PKEY *key);
|
||||
//
|
||||
// The caller must check the type of the parsed private key to ensure it is
|
||||
// suitable and validate other desired key properties such as RSA modulus size
|
||||
// or EC curve.
|
||||
// or EC curve. In particular, RSA private key operations scale cubicly, so
|
||||
// applications accepting RSA private keys from external sources may need to
|
||||
// bound key sizes (use |EVP_PKEY_bits| or |RSA_bits|) to avoid a DoS vector.
|
||||
//
|
||||
// A PrivateKeyInfo ends with an optional set of attributes. These are not
|
||||
// processed and so this function will silently ignore any trailing data in the
|
||||
|
||||
@@ -953,6 +953,18 @@ OPENSSL_EXPORT size_t SSL_get0_certificate_types(const SSL *ssl,
|
||||
OPENSSL_EXPORT size_t
|
||||
SSL_get0_peer_verify_algorithms(const SSL *ssl, const uint16_t **out_sigalgs);
|
||||
|
||||
// SSL_get0_peer_delegation_algorithms sets |*out_sigalgs| to an array
|
||||
// containing the signature algorithms the peer is willing to use with delegated
|
||||
// credentials. It returns the length of the array. If not sent, the empty
|
||||
// array is returned.
|
||||
//
|
||||
// The behavior of this function is undefined except during the callbacks set by
|
||||
// by |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb| or when the
|
||||
// handshake is paused because of them.
|
||||
OPENSSL_EXPORT size_t
|
||||
SSL_get0_peer_delegation_algorithms(const SSL *ssl,
|
||||
const uint16_t **out_sigalgs);
|
||||
|
||||
// SSL_certs_clear resets the private key, leaf certificate, and certificate
|
||||
// chain of |ssl|.
|
||||
OPENSSL_EXPORT void SSL_certs_clear(SSL *ssl);
|
||||
@@ -4688,6 +4700,23 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx,
|
||||
// |SSL_CTX_set_tlsext_status_cb|'s callback and returns one.
|
||||
OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg);
|
||||
|
||||
// The following symbols are compatibility aliases for reason codes used when
|
||||
// receiving an alert from the peer. Use the other names instead, which fit the
|
||||
// naming convention.
|
||||
//
|
||||
// TODO(davidben): Fix references to |SSL_R_TLSV1_CERTIFICATE_REQUIRED| and
|
||||
// remove the compatibility value. The others come from OpenSSL.
|
||||
#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION \
|
||||
SSL_R_TLSV1_ALERT_UNSUPPORTED_EXTENSION
|
||||
#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE \
|
||||
SSL_R_TLSV1_ALERT_CERTIFICATE_UNOBTAINABLE
|
||||
#define SSL_R_TLSV1_UNRECOGNIZED_NAME SSL_R_TLSV1_ALERT_UNRECOGNIZED_NAME
|
||||
#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE \
|
||||
SSL_R_TLSV1_ALERT_BAD_CERTIFICATE_STATUS_RESPONSE
|
||||
#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE \
|
||||
SSL_R_TLSV1_ALERT_BAD_CERTIFICATE_HASH_VALUE
|
||||
#define SSL_R_TLSV1_CERTIFICATE_REQUIRED SSL_R_TLSV1_ALERT_CERTIFICATE_REQUIRED
|
||||
|
||||
|
||||
// Nodejs compatibility section (hidden).
|
||||
//
|
||||
@@ -5179,6 +5208,8 @@ BSSL_NAMESPACE_END
|
||||
#define SSL_R_INCONSISTENT_CLIENT_HELLO 303
|
||||
#define SSL_R_CIPHER_MISMATCH_ON_EARLY_DATA 304
|
||||
#define SSL_R_QUIC_TRANSPORT_PARAMETERS_MISCONFIGURED 305
|
||||
#define SSL_R_UNEXPECTED_COMPATIBILITY_MODE 306
|
||||
#define SSL_R_MISSING_ALPN 307
|
||||
#define SSL_R_SSLV3_ALERT_CLOSE_NOTIFY 1000
|
||||
#define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010
|
||||
#define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020
|
||||
@@ -5204,12 +5235,13 @@ BSSL_NAMESPACE_END
|
||||
#define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK 1086
|
||||
#define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090
|
||||
#define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100
|
||||
#define SSL_R_TLSV1_UNSUPPORTED_EXTENSION 1110
|
||||
#define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE 1111
|
||||
#define SSL_R_TLSV1_UNRECOGNIZED_NAME 1112
|
||||
#define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE 1113
|
||||
#define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114
|
||||
#define SSL_R_TLSV1_UNKNOWN_PSK_IDENTITY 1115
|
||||
#define SSL_R_TLSV1_CERTIFICATE_REQUIRED 1116
|
||||
#define SSL_R_TLSV1_ALERT_UNSUPPORTED_EXTENSION 1110
|
||||
#define SSL_R_TLSV1_ALERT_CERTIFICATE_UNOBTAINABLE 1111
|
||||
#define SSL_R_TLSV1_ALERT_UNRECOGNIZED_NAME 1112
|
||||
#define SSL_R_TLSV1_ALERT_BAD_CERTIFICATE_STATUS_RESPONSE 1113
|
||||
#define SSL_R_TLSV1_ALERT_BAD_CERTIFICATE_HASH_VALUE 1114
|
||||
#define SSL_R_TLSV1_ALERT_UNKNOWN_PSK_IDENTITY 1115
|
||||
#define SSL_R_TLSV1_ALERT_CERTIFICATE_REQUIRED 1116
|
||||
#define SSL_R_TLSV1_ALERT_NO_APPLICATION_PROTOCOL 1120
|
||||
|
||||
#endif // OPENSSL_HEADER_SSL_H
|
||||
@@ -232,9 +232,8 @@ extern "C" {
|
||||
// ExtensionType value from RFC5746
|
||||
#define TLSEXT_TYPE_renegotiate 0xff01
|
||||
|
||||
// ExtensionType value from draft-ietf-tls-subcerts. This is not an IANA defined
|
||||
// extension number.
|
||||
#define TLSEXT_TYPE_delegated_credential 0xff02
|
||||
// ExtensionType value from draft-ietf-tls-subcerts.
|
||||
#define TLSEXT_TYPE_delegated_credential 0x22
|
||||
|
||||
// ExtensionType value from RFC6962
|
||||
#define TLSEXT_TYPE_certificate_timestamp 18
|
||||
|
||||
@@ -146,7 +146,7 @@ struct X509_name_st {
|
||||
STACK_OF(X509_NAME_ENTRY) * entries;
|
||||
int modified; // true if 'bytes' needs to be built
|
||||
BUF_MEM *bytes;
|
||||
// unsigned long hash; Keep the hash around for lookups
|
||||
// unsigned long hash; Keep the hash around for lookups
|
||||
unsigned char *canon_enc;
|
||||
int canon_enclen;
|
||||
} /* X509_NAME */;
|
||||
@@ -470,6 +470,11 @@ struct Netscape_spki_st {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// TODO(davidben): Document remaining functions, reorganize them, and define
|
||||
// supported patterns for using |X509| objects in general. In particular, when
|
||||
// it is safe to call mutating functions is a little tricky due to various
|
||||
// internal caches.
|
||||
|
||||
// X509_get_version returns the numerical value of |x509|'s version. That is,
|
||||
// it returns zero for X.509v1, one for X.509v2, and two for X.509v3. Unknown
|
||||
// versions are rejected by the parser, but a manually-created |X509| object may
|
||||
@@ -477,16 +482,54 @@ extern "C" {
|
||||
// version, or -1 on overflow.
|
||||
OPENSSL_EXPORT long X509_get_version(const X509 *x509);
|
||||
|
||||
// X509_get_notBefore returns |x509|'s notBefore value. Note this function is
|
||||
// not const-correct for legacy reasons. Use |X509_get0_notBefore| or
|
||||
// X509_get0_serialNumber returns |x509|'s serial number.
|
||||
OPENSSL_EXPORT const ASN1_INTEGER *X509_get0_serialNumber(const X509 *x509);
|
||||
|
||||
// X509_get0_notBefore returns |x509|'s notBefore time.
|
||||
OPENSSL_EXPORT const ASN1_TIME *X509_get0_notBefore(const X509 *x509);
|
||||
|
||||
// X509_get0_notAfter returns |x509|'s notAfter time.
|
||||
OPENSSL_EXPORT const ASN1_TIME *X509_get0_notAfter(const X509 *x509);
|
||||
|
||||
// X509_set1_notBefore sets |x509|'s notBefore time to |tm|. It returns one on
|
||||
// success and zero on error.
|
||||
OPENSSL_EXPORT int X509_set1_notBefore(X509 *x509, const ASN1_TIME *tm);
|
||||
|
||||
// X509_set1_notAfter sets |x509|'s notAfter time to |tm|. it returns one on
|
||||
// success and zero on error.
|
||||
OPENSSL_EXPORT int X509_set1_notAfter(X509 *x509, const ASN1_TIME *tm);
|
||||
|
||||
// X509_getm_notBefore returns a mutable pointer to |x509|'s notBefore time.
|
||||
OPENSSL_EXPORT ASN1_TIME *X509_getm_notBefore(X509 *x509);
|
||||
|
||||
// X509_getm_notAfter returns a mutable pointer to |x509|'s notAfter time.
|
||||
OPENSSL_EXPORT ASN1_TIME *X509_getm_notAfter(X509 *x);
|
||||
|
||||
// X509_get_notBefore returns |x509|'s notBefore time. Note this function is not
|
||||
// const-correct for legacy reasons. Use |X509_get0_notBefore| or
|
||||
// |X509_getm_notBefore| instead.
|
||||
OPENSSL_EXPORT ASN1_TIME *X509_get_notBefore(const X509 *x509);
|
||||
|
||||
// X509_get_notAfter returns |x509|'s notAfter value. Note this function is not
|
||||
// X509_get_notAfter returns |x509|'s notAfter time. Note this function is not
|
||||
// const-correct for legacy reasons. Use |X509_get0_notAfter| or
|
||||
// |X509_getm_notAfter| instead.
|
||||
OPENSSL_EXPORT ASN1_TIME *X509_get_notAfter(const X509 *x509);
|
||||
|
||||
// X509_set_notBefore calls |X509_set1_notBefore|. Use |X509_set1_notBefore|
|
||||
// instead.
|
||||
OPENSSL_EXPORT int X509_set_notBefore(X509 *x509, const ASN1_TIME *tm);
|
||||
|
||||
// X509_set_notAfter calls |X509_set1_notAfter|. Use |X509_set1_notAfter|
|
||||
// instead.
|
||||
OPENSSL_EXPORT int X509_set_notAfter(X509 *x509, const ASN1_TIME *tm);
|
||||
|
||||
// X509_get0_uids sets |*out_issuer_uid| and |*out_subject_uid| to non-owning
|
||||
// pointers to the issuerUID and subjectUID fields, respectively, of |x509|.
|
||||
// Either output pointer may be NULL to skip the field.
|
||||
OPENSSL_EXPORT void X509_get0_uids(const X509 *x509,
|
||||
const ASN1_BIT_STRING **out_issuer_uid,
|
||||
const ASN1_BIT_STRING **out_subject_uid);
|
||||
|
||||
// X509_get_cert_info returns |x509|'s TBSCertificate structure. Note this
|
||||
// function is not const-correct for legacy reasons.
|
||||
//
|
||||
@@ -521,15 +564,29 @@ OPENSSL_EXPORT long X509_CRL_get_version(const X509_CRL *crl);
|
||||
// X509_CRL_get0_lastUpdate returns |crl|'s lastUpdate time.
|
||||
OPENSSL_EXPORT const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl);
|
||||
|
||||
// X509_CRL_get0_lastUpdate returns |crl|'s nextUpdate time.
|
||||
// X509_CRL_get0_nextUpdate returns |crl|'s nextUpdate time, or NULL if |crl|
|
||||
// has none.
|
||||
OPENSSL_EXPORT const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl);
|
||||
|
||||
// X509_CRL_set1_lastUpdate sets |crl|'s lastUpdate time to |tm|. It returns one
|
||||
// on success and zero on error.
|
||||
OPENSSL_EXPORT int X509_CRL_set1_lastUpdate(X509_CRL *crl, const ASN1_TIME *tm);
|
||||
|
||||
// X509_CRL_set1_nextUpdate sets |crl|'s nextUpdate time to |tm|. It returns one
|
||||
// on success and zero on error.
|
||||
OPENSSL_EXPORT int X509_CRL_set1_nextUpdate(X509_CRL *crl, const ASN1_TIME *tm);
|
||||
|
||||
// The following symbols are deprecated aliases to |X509_CRL_set1_*|.
|
||||
#define X509_CRL_set_lastUpdate X509_CRL_set1_lastUpdate
|
||||
#define X509_CRL_set_nextUpdate X509_CRL_set1_nextUpdate
|
||||
|
||||
// X509_CRL_get_lastUpdate returns a mutable pointer to |crl|'s lastUpdate time.
|
||||
// Use |X509_CRL_get0_lastUpdate| or |X509_CRL_set_lastUpdate| instead.
|
||||
// Use |X509_CRL_get0_lastUpdate| or |X509_CRL_set1_lastUpdate| instead.
|
||||
OPENSSL_EXPORT ASN1_TIME *X509_CRL_get_lastUpdate(X509_CRL *crl);
|
||||
|
||||
// X509_CRL_get_nextUpdate returns a mutable pointer to |crl|'s nextUpdate time.
|
||||
// Use |X509_CRL_get0_nextUpdate| or |X509_CRL_set_nextUpdate| instead.
|
||||
// X509_CRL_get_nextUpdate returns a mutable pointer to |crl|'s nextUpdate time,
|
||||
// or NULL if |crl| has none. Use |X509_CRL_get0_nextUpdate| or
|
||||
// |X509_CRL_set1_nextUpdate| instead.
|
||||
OPENSSL_EXPORT ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl);
|
||||
|
||||
// X509_CRL_get_issuer returns |crl|'s issuer name. Note this function is not
|
||||
@@ -559,6 +616,17 @@ OPENSSL_EXPORT void X509_CINF_set_modified(X509_CINF *cinf);
|
||||
// |X509_get0_tbs_sigalg| instead.
|
||||
OPENSSL_EXPORT const X509_ALGOR *X509_CINF_get_signature(const X509_CINF *cinf);
|
||||
|
||||
// X509_SIG_get0 sets |*out_alg| and |*out_digest| to non-owning pointers to
|
||||
// |sig|'s algorithm and digest fields, respectively. Either |out_alg| and
|
||||
// |out_digest| may be NULL to skip those fields.
|
||||
OPENSSL_EXPORT void X509_SIG_get0(const X509_SIG *sig,
|
||||
const X509_ALGOR **out_alg,
|
||||
const ASN1_OCTET_STRING **out_digest);
|
||||
|
||||
// X509_SIG_getm behaves like |X509_SIG_get0| but returns mutable pointers.
|
||||
OPENSSL_EXPORT void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **out_alg,
|
||||
ASN1_OCTET_STRING **out_digest);
|
||||
|
||||
OPENSSL_EXPORT void X509_CRL_set_default_method(const X509_CRL_METHOD *meth);
|
||||
OPENSSL_EXPORT X509_CRL_METHOD *X509_CRL_METHOD_new(
|
||||
int (*crl_init)(X509_CRL *crl), int (*crl_free)(X509_CRL *crl),
|
||||
@@ -817,7 +885,7 @@ DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC)
|
||||
#ifndef OPENSSL_NO_EVP
|
||||
OPENSSL_EXPORT X509_INFO *X509_INFO_new(void);
|
||||
OPENSSL_EXPORT void X509_INFO_free(X509_INFO *a);
|
||||
OPENSSL_EXPORT char *X509_NAME_oneline(X509_NAME *a, char *buf, int size);
|
||||
OPENSSL_EXPORT char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size);
|
||||
|
||||
OPENSSL_EXPORT int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data,
|
||||
unsigned char *md, unsigned int *len);
|
||||
@@ -844,15 +912,9 @@ OPENSSL_EXPORT int X509_set_version(X509 *x, long version);
|
||||
OPENSSL_EXPORT int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial);
|
||||
OPENSSL_EXPORT ASN1_INTEGER *X509_get_serialNumber(X509 *x);
|
||||
OPENSSL_EXPORT int X509_set_issuer_name(X509 *x, X509_NAME *name);
|
||||
OPENSSL_EXPORT X509_NAME *X509_get_issuer_name(X509 *a);
|
||||
OPENSSL_EXPORT X509_NAME *X509_get_issuer_name(const X509 *a);
|
||||
OPENSSL_EXPORT int X509_set_subject_name(X509 *x, X509_NAME *name);
|
||||
OPENSSL_EXPORT X509_NAME *X509_get_subject_name(X509 *a);
|
||||
OPENSSL_EXPORT int X509_set_notBefore(X509 *x, const ASN1_TIME *tm);
|
||||
OPENSSL_EXPORT const ASN1_TIME *X509_get0_notBefore(const X509 *x);
|
||||
OPENSSL_EXPORT ASN1_TIME *X509_getm_notBefore(X509 *x);
|
||||
OPENSSL_EXPORT int X509_set_notAfter(X509 *x, const ASN1_TIME *tm);
|
||||
OPENSSL_EXPORT const ASN1_TIME *X509_get0_notAfter(const X509 *x);
|
||||
OPENSSL_EXPORT ASN1_TIME *X509_getm_notAfter(X509 *x);
|
||||
OPENSSL_EXPORT X509_NAME *X509_get_subject_name(const X509 *a);
|
||||
OPENSSL_EXPORT int X509_set_pubkey(X509 *x, EVP_PKEY *pkey);
|
||||
OPENSSL_EXPORT EVP_PKEY *X509_get_pubkey(X509 *x);
|
||||
OPENSSL_EXPORT ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x);
|
||||
@@ -900,8 +962,6 @@ OPENSSL_EXPORT int X509_REQ_add1_attr_by_txt(X509_REQ *req,
|
||||
|
||||
OPENSSL_EXPORT int X509_CRL_set_version(X509_CRL *x, long version);
|
||||
OPENSSL_EXPORT int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name);
|
||||
OPENSSL_EXPORT int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm);
|
||||
OPENSSL_EXPORT int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm);
|
||||
OPENSSL_EXPORT int X509_CRL_sort(X509_CRL *crl);
|
||||
OPENSSL_EXPORT int X509_CRL_up_ref(X509_CRL *crl);
|
||||
|
||||
@@ -959,12 +1019,12 @@ OPENSSL_EXPORT int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag,
|
||||
OPENSSL_EXPORT int X509_print_fp(FILE *bp, X509 *x);
|
||||
OPENSSL_EXPORT int X509_CRL_print_fp(FILE *bp, X509_CRL *x);
|
||||
OPENSSL_EXPORT int X509_REQ_print_fp(FILE *bp, X509_REQ *req);
|
||||
OPENSSL_EXPORT int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent,
|
||||
unsigned long flags);
|
||||
OPENSSL_EXPORT int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm,
|
||||
int indent, unsigned long flags);
|
||||
#endif
|
||||
|
||||
OPENSSL_EXPORT int X509_NAME_print(BIO *bp, X509_NAME *name, int obase);
|
||||
OPENSSL_EXPORT int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent,
|
||||
OPENSSL_EXPORT int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase);
|
||||
OPENSSL_EXPORT int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
|
||||
unsigned long flags);
|
||||
OPENSSL_EXPORT int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflag,
|
||||
unsigned long cflag);
|
||||
@@ -976,21 +1036,22 @@ OPENSSL_EXPORT int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag,
|
||||
unsigned long cflag);
|
||||
OPENSSL_EXPORT int X509_REQ_print(BIO *bp, X509_REQ *req);
|
||||
|
||||
OPENSSL_EXPORT int X509_NAME_entry_count(X509_NAME *name);
|
||||
OPENSSL_EXPORT int X509_NAME_get_text_by_NID(X509_NAME *name, int nid,
|
||||
OPENSSL_EXPORT int X509_NAME_entry_count(const X509_NAME *name);
|
||||
OPENSSL_EXPORT int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid,
|
||||
char *buf, int len);
|
||||
OPENSSL_EXPORT int X509_NAME_get_text_by_OBJ(X509_NAME *name,
|
||||
OPENSSL_EXPORT int X509_NAME_get_text_by_OBJ(const X509_NAME *name,
|
||||
const ASN1_OBJECT *obj, char *buf,
|
||||
int len);
|
||||
|
||||
// NOTE: you should be passsing -1, not 0 as lastpos. The functions that use
|
||||
// lastpos, search after that position on.
|
||||
OPENSSL_EXPORT int X509_NAME_get_index_by_NID(X509_NAME *name, int nid,
|
||||
OPENSSL_EXPORT int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT int X509_NAME_get_index_by_OBJ(X509_NAME *name,
|
||||
OPENSSL_EXPORT int X509_NAME_get_index_by_OBJ(const X509_NAME *name,
|
||||
const ASN1_OBJECT *obj,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc);
|
||||
OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name,
|
||||
int loc);
|
||||
OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name,
|
||||
int loc);
|
||||
OPENSSL_EXPORT int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne,
|
||||
@@ -1021,8 +1082,9 @@ OPENSSL_EXPORT int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne,
|
||||
OPENSSL_EXPORT int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type,
|
||||
const unsigned char *bytes,
|
||||
int len);
|
||||
OPENSSL_EXPORT ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne);
|
||||
OPENSSL_EXPORT ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne);
|
||||
OPENSSL_EXPORT ASN1_OBJECT *X509_NAME_ENTRY_get_object(
|
||||
const X509_NAME_ENTRY *ne);
|
||||
OPENSSL_EXPORT ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne);
|
||||
|
||||
OPENSSL_EXPORT int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) * x);
|
||||
OPENSSL_EXPORT int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) * x,
|
||||
@@ -1040,59 +1102,63 @@ OPENSSL_EXPORT X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) * x,
|
||||
OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *
|
||||
X509v3_add_ext(STACK_OF(X509_EXTENSION) * *x, X509_EXTENSION *ex, int loc);
|
||||
|
||||
OPENSSL_EXPORT int X509_get_ext_count(X509 *x);
|
||||
OPENSSL_EXPORT int X509_get_ext_by_NID(X509 *x, int nid, int lastpos);
|
||||
OPENSSL_EXPORT int X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos);
|
||||
OPENSSL_EXPORT int X509_get_ext_by_critical(X509 *x, int crit, int lastpos);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_get_ext(X509 *x, int loc);
|
||||
OPENSSL_EXPORT int X509_get_ext_count(const X509 *x);
|
||||
OPENSSL_EXPORT int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos);
|
||||
OPENSSL_EXPORT int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT int X509_get_ext_by_critical(const X509 *x, int crit,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_get_ext(const X509 *x, int loc);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
|
||||
OPENSSL_EXPORT int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
|
||||
OPENSSL_EXPORT void *X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx);
|
||||
OPENSSL_EXPORT void *X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx);
|
||||
OPENSSL_EXPORT int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
|
||||
unsigned long flags);
|
||||
|
||||
OPENSSL_EXPORT int X509_CRL_get_ext_count(X509_CRL *x);
|
||||
OPENSSL_EXPORT int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos);
|
||||
OPENSSL_EXPORT int X509_CRL_get_ext_by_OBJ(X509_CRL *x, ASN1_OBJECT *obj,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit,
|
||||
OPENSSL_EXPORT int X509_CRL_get_ext_count(const X509_CRL *x);
|
||||
OPENSSL_EXPORT int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos);
|
||||
OPENSSL_EXPORT int X509_CRL_get_ext_by_OBJ(const X509_CRL *x,
|
||||
const ASN1_OBJECT *obj, int lastpos);
|
||||
OPENSSL_EXPORT int X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_CRL_get_ext(const X509_CRL *x, int loc);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc);
|
||||
OPENSSL_EXPORT int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc);
|
||||
OPENSSL_EXPORT void *X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit,
|
||||
OPENSSL_EXPORT void *X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit,
|
||||
int *idx);
|
||||
OPENSSL_EXPORT int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value,
|
||||
int crit, unsigned long flags);
|
||||
|
||||
OPENSSL_EXPORT int X509_REVOKED_get_ext_count(X509_REVOKED *x);
|
||||
OPENSSL_EXPORT int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid,
|
||||
OPENSSL_EXPORT int X509_REVOKED_get_ext_count(const X509_REVOKED *x);
|
||||
OPENSSL_EXPORT int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,
|
||||
ASN1_OBJECT *obj, int lastpos);
|
||||
OPENSSL_EXPORT int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc);
|
||||
OPENSSL_EXPORT int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x,
|
||||
const ASN1_OBJECT *obj,
|
||||
int lastpos);
|
||||
OPENSSL_EXPORT int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x,
|
||||
int crit, int lastpos);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x,
|
||||
int loc);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x,
|
||||
int loc);
|
||||
OPENSSL_EXPORT int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex,
|
||||
int loc);
|
||||
OPENSSL_EXPORT void *X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid,
|
||||
OPENSSL_EXPORT void *X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid,
|
||||
int *crit, int *idx);
|
||||
OPENSSL_EXPORT int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid,
|
||||
void *value, int crit,
|
||||
unsigned long flags);
|
||||
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_EXTENSION_create_by_NID(
|
||||
X509_EXTENSION **ex, int nid, int crit, ASN1_OCTET_STRING *data);
|
||||
X509_EXTENSION **ex, int nid, int crit, const ASN1_OCTET_STRING *data);
|
||||
OPENSSL_EXPORT X509_EXTENSION *X509_EXTENSION_create_by_OBJ(
|
||||
X509_EXTENSION **ex, const ASN1_OBJECT *obj, int crit,
|
||||
ASN1_OCTET_STRING *data);
|
||||
const ASN1_OCTET_STRING *data);
|
||||
OPENSSL_EXPORT int X509_EXTENSION_set_object(X509_EXTENSION *ex,
|
||||
const ASN1_OBJECT *obj);
|
||||
OPENSSL_EXPORT int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
|
||||
OPENSSL_EXPORT int X509_EXTENSION_set_data(X509_EXTENSION *ex,
|
||||
ASN1_OCTET_STRING *data);
|
||||
const ASN1_OCTET_STRING *data);
|
||||
OPENSSL_EXPORT ASN1_OBJECT *X509_EXTENSION_get_object(X509_EXTENSION *ex);
|
||||
OPENSSL_EXPORT ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne);
|
||||
OPENSSL_EXPORT int X509_EXTENSION_get_critical(X509_EXTENSION *ex);
|
||||
@@ -1179,9 +1245,9 @@ OPENSSL_EXPORT int X509_TRUST_add(int id, int flags,
|
||||
int (*ck)(X509_TRUST *, X509 *, int),
|
||||
char *name, int arg1, void *arg2);
|
||||
OPENSSL_EXPORT void X509_TRUST_cleanup(void);
|
||||
OPENSSL_EXPORT int X509_TRUST_get_flags(X509_TRUST *xp);
|
||||
OPENSSL_EXPORT char *X509_TRUST_get0_name(X509_TRUST *xp);
|
||||
OPENSSL_EXPORT int X509_TRUST_get_trust(X509_TRUST *xp);
|
||||
OPENSSL_EXPORT int X509_TRUST_get_flags(const X509_TRUST *xp);
|
||||
OPENSSL_EXPORT char *X509_TRUST_get0_name(const X509_TRUST *xp);
|
||||
OPENSSL_EXPORT int X509_TRUST_get_trust(const X509_TRUST *xp);
|
||||
|
||||
|
||||
typedef struct rsa_pss_params_st {
|
||||
|
||||
@@ -162,11 +162,6 @@ ASN1_INTEGER *pathlen;
|
||||
};
|
||||
|
||||
|
||||
typedef struct PKEY_USAGE_PERIOD_st {
|
||||
ASN1_GENERALIZEDTIME *notBefore;
|
||||
ASN1_GENERALIZEDTIME *notAfter;
|
||||
} PKEY_USAGE_PERIOD;
|
||||
|
||||
typedef struct otherName_st {
|
||||
ASN1_OBJECT *type_id;
|
||||
ASN1_TYPE *value;
|
||||
@@ -272,21 +267,6 @@ GENERAL_NAMES *issuer;
|
||||
ASN1_INTEGER *serial;
|
||||
};
|
||||
|
||||
/* Strong extranet structures */
|
||||
|
||||
typedef struct SXNET_ID_st {
|
||||
ASN1_INTEGER *zone;
|
||||
ASN1_OCTET_STRING *user;
|
||||
} SXNETID;
|
||||
|
||||
DEFINE_STACK_OF(SXNETID)
|
||||
DECLARE_ASN1_SET_OF(SXNETID)
|
||||
|
||||
typedef struct SXNET_st {
|
||||
ASN1_INTEGER *version;
|
||||
STACK_OF(SXNETID) *ids;
|
||||
} SXNET;
|
||||
|
||||
typedef struct NOTICEREF_st {
|
||||
ASN1_STRING *organization;
|
||||
STACK_OF(ASN1_INTEGER) *noticenos;
|
||||
@@ -517,21 +497,8 @@ DEFINE_STACK_OF(X509_PURPOSE)
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS)
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(SXNET)
|
||||
DECLARE_ASN1_FUNCTIONS(SXNETID)
|
||||
|
||||
int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen);
|
||||
int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen);
|
||||
int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen);
|
||||
|
||||
ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone);
|
||||
ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone);
|
||||
ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID)
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD)
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(GENERAL_NAME)
|
||||
OPENSSL_EXPORT GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a);
|
||||
OPENSSL_EXPORT int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b);
|
||||
@@ -558,17 +525,17 @@ DECLARE_ASN1_FUNCTIONS(OTHERNAME)
|
||||
DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME)
|
||||
OPENSSL_EXPORT int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b);
|
||||
OPENSSL_EXPORT void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value);
|
||||
OPENSSL_EXPORT void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype);
|
||||
OPENSSL_EXPORT void *GENERAL_NAME_get0_value(const GENERAL_NAME *a, int *ptype);
|
||||
OPENSSL_EXPORT int GENERAL_NAME_set0_othername(GENERAL_NAME *gen,
|
||||
ASN1_OBJECT *oid, ASN1_TYPE *value);
|
||||
OPENSSL_EXPORT int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen,
|
||||
OPENSSL_EXPORT int GENERAL_NAME_get0_otherName(const GENERAL_NAME *gen,
|
||||
ASN1_OBJECT **poid, ASN1_TYPE **pvalue);
|
||||
|
||||
OPENSSL_EXPORT char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5);
|
||||
OPENSSL_EXPORT char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, const ASN1_OCTET_STRING *ia5);
|
||||
OPENSSL_EXPORT ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE)
|
||||
OPENSSL_EXPORT int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a);
|
||||
OPENSSL_EXPORT int i2a_ACCESS_DESCRIPTION(BIO *bp, const ACCESS_DESCRIPTION* a);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES)
|
||||
DECLARE_ASN1_FUNCTIONS(POLICYINFO)
|
||||
@@ -691,11 +658,11 @@ OPENSSL_EXPORT int X509_PURPOSE_get_by_id(int id);
|
||||
OPENSSL_EXPORT int X509_PURPOSE_add(int id, int trust, int flags,
|
||||
int (*ck)(const X509_PURPOSE *, const X509 *, int),
|
||||
char *name, char *sname, void *arg);
|
||||
OPENSSL_EXPORT char *X509_PURPOSE_get0_name(X509_PURPOSE *xp);
|
||||
OPENSSL_EXPORT char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp);
|
||||
OPENSSL_EXPORT int X509_PURPOSE_get_trust(X509_PURPOSE *xp);
|
||||
OPENSSL_EXPORT char *X509_PURPOSE_get0_name(const X509_PURPOSE *xp);
|
||||
OPENSSL_EXPORT char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp);
|
||||
OPENSSL_EXPORT int X509_PURPOSE_get_trust(const X509_PURPOSE *xp);
|
||||
OPENSSL_EXPORT void X509_PURPOSE_cleanup(void);
|
||||
OPENSSL_EXPORT int X509_PURPOSE_get_id(X509_PURPOSE *);
|
||||
OPENSSL_EXPORT int X509_PURPOSE_get_id(const X509_PURPOSE *);
|
||||
|
||||
OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x);
|
||||
OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x);
|
||||
|
||||
@@ -956,6 +956,15 @@
|
||||
%xdefine _EVP_EncryptInit _ %+ BORINGSSL_PREFIX %+ _EVP_EncryptInit
|
||||
%xdefine _EVP_EncryptInit_ex _ %+ BORINGSSL_PREFIX %+ _EVP_EncryptInit_ex
|
||||
%xdefine _EVP_EncryptUpdate _ %+ BORINGSSL_PREFIX %+ _EVP_EncryptUpdate
|
||||
%xdefine _EVP_HPKE_CTX_cleanup _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_cleanup
|
||||
%xdefine _EVP_HPKE_CTX_export _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_export
|
||||
%xdefine _EVP_HPKE_CTX_init _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_init
|
||||
%xdefine _EVP_HPKE_CTX_max_overhead _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_max_overhead
|
||||
%xdefine _EVP_HPKE_CTX_open _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_open
|
||||
%xdefine _EVP_HPKE_CTX_seal _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_seal
|
||||
%xdefine _EVP_HPKE_CTX_setup_base_r_x25519 _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_setup_base_r_x25519
|
||||
%xdefine _EVP_HPKE_CTX_setup_base_s_x25519 _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_setup_base_s_x25519
|
||||
%xdefine _EVP_HPKE_CTX_setup_base_s_x25519_for_test _ %+ BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_setup_base_s_x25519_for_test
|
||||
%xdefine _EVP_MD_CTX_block_size _ %+ BORINGSSL_PREFIX %+ _EVP_MD_CTX_block_size
|
||||
%xdefine _EVP_MD_CTX_cleanup _ %+ BORINGSSL_PREFIX %+ _EVP_MD_CTX_cleanup
|
||||
%xdefine _EVP_MD_CTX_copy _ %+ BORINGSSL_PREFIX %+ _EVP_MD_CTX_copy
|
||||
@@ -1420,9 +1429,6 @@
|
||||
%xdefine _PKCS8_parse_encrypted_private_key _ %+ BORINGSSL_PREFIX %+ _PKCS8_parse_encrypted_private_key
|
||||
%xdefine _PKCS8_pkey_get0 _ %+ BORINGSSL_PREFIX %+ _PKCS8_pkey_get0
|
||||
%xdefine _PKCS8_pkey_set0 _ %+ BORINGSSL_PREFIX %+ _PKCS8_pkey_set0
|
||||
%xdefine _PKEY_USAGE_PERIOD_free _ %+ BORINGSSL_PREFIX %+ _PKEY_USAGE_PERIOD_free
|
||||
%xdefine _PKEY_USAGE_PERIOD_it _ %+ BORINGSSL_PREFIX %+ _PKEY_USAGE_PERIOD_it
|
||||
%xdefine _PKEY_USAGE_PERIOD_new _ %+ BORINGSSL_PREFIX %+ _PKEY_USAGE_PERIOD_new
|
||||
%xdefine _PMBTOKEN_PRETOKEN_free _ %+ BORINGSSL_PREFIX %+ _PMBTOKEN_PRETOKEN_free
|
||||
%xdefine _POLICYINFO_free _ %+ BORINGSSL_PREFIX %+ _POLICYINFO_free
|
||||
%xdefine _POLICYINFO_it _ %+ BORINGSSL_PREFIX %+ _POLICYINFO_it
|
||||
@@ -1825,6 +1831,7 @@
|
||||
%xdefine _SSL_get0_ocsp_response _ %+ BORINGSSL_PREFIX %+ _SSL_get0_ocsp_response
|
||||
%xdefine _SSL_get0_param _ %+ BORINGSSL_PREFIX %+ _SSL_get0_param
|
||||
%xdefine _SSL_get0_peer_certificates _ %+ BORINGSSL_PREFIX %+ _SSL_get0_peer_certificates
|
||||
%xdefine _SSL_get0_peer_delegation_algorithms _ %+ BORINGSSL_PREFIX %+ _SSL_get0_peer_delegation_algorithms
|
||||
%xdefine _SSL_get0_peer_verify_algorithms _ %+ BORINGSSL_PREFIX %+ _SSL_get0_peer_verify_algorithms
|
||||
%xdefine _SSL_get0_server_requested_CAs _ %+ BORINGSSL_PREFIX %+ _SSL_get0_server_requested_CAs
|
||||
%xdefine _SSL_get0_session_id_context _ %+ BORINGSSL_PREFIX %+ _SSL_get0_session_id_context
|
||||
@@ -2038,18 +2045,6 @@
|
||||
%xdefine _SSLv23_client_method _ %+ BORINGSSL_PREFIX %+ _SSLv23_client_method
|
||||
%xdefine _SSLv23_method _ %+ BORINGSSL_PREFIX %+ _SSLv23_method
|
||||
%xdefine _SSLv23_server_method _ %+ BORINGSSL_PREFIX %+ _SSLv23_server_method
|
||||
%xdefine _SXNETID_free _ %+ BORINGSSL_PREFIX %+ _SXNETID_free
|
||||
%xdefine _SXNETID_it _ %+ BORINGSSL_PREFIX %+ _SXNETID_it
|
||||
%xdefine _SXNETID_new _ %+ BORINGSSL_PREFIX %+ _SXNETID_new
|
||||
%xdefine _SXNET_add_id_INTEGER _ %+ BORINGSSL_PREFIX %+ _SXNET_add_id_INTEGER
|
||||
%xdefine _SXNET_add_id_asc _ %+ BORINGSSL_PREFIX %+ _SXNET_add_id_asc
|
||||
%xdefine _SXNET_add_id_ulong _ %+ BORINGSSL_PREFIX %+ _SXNET_add_id_ulong
|
||||
%xdefine _SXNET_free _ %+ BORINGSSL_PREFIX %+ _SXNET_free
|
||||
%xdefine _SXNET_get_id_INTEGER _ %+ BORINGSSL_PREFIX %+ _SXNET_get_id_INTEGER
|
||||
%xdefine _SXNET_get_id_asc _ %+ BORINGSSL_PREFIX %+ _SXNET_get_id_asc
|
||||
%xdefine _SXNET_get_id_ulong _ %+ BORINGSSL_PREFIX %+ _SXNET_get_id_ulong
|
||||
%xdefine _SXNET_it _ %+ BORINGSSL_PREFIX %+ _SXNET_it
|
||||
%xdefine _SXNET_new _ %+ BORINGSSL_PREFIX %+ _SXNET_new
|
||||
%xdefine _TLS_client_method _ %+ BORINGSSL_PREFIX %+ _TLS_client_method
|
||||
%xdefine _TLS_method _ %+ BORINGSSL_PREFIX %+ _TLS_method
|
||||
%xdefine _TLS_server_method _ %+ BORINGSSL_PREFIX %+ _TLS_server_method
|
||||
@@ -2200,11 +2195,11 @@
|
||||
%xdefine _X509_CRL_new _ %+ BORINGSSL_PREFIX %+ _X509_CRL_new
|
||||
%xdefine _X509_CRL_print _ %+ BORINGSSL_PREFIX %+ _X509_CRL_print
|
||||
%xdefine _X509_CRL_print_fp _ %+ BORINGSSL_PREFIX %+ _X509_CRL_print_fp
|
||||
%xdefine _X509_CRL_set1_lastUpdate _ %+ BORINGSSL_PREFIX %+ _X509_CRL_set1_lastUpdate
|
||||
%xdefine _X509_CRL_set1_nextUpdate _ %+ BORINGSSL_PREFIX %+ _X509_CRL_set1_nextUpdate
|
||||
%xdefine _X509_CRL_set_default_method _ %+ BORINGSSL_PREFIX %+ _X509_CRL_set_default_method
|
||||
%xdefine _X509_CRL_set_issuer_name _ %+ BORINGSSL_PREFIX %+ _X509_CRL_set_issuer_name
|
||||
%xdefine _X509_CRL_set_lastUpdate _ %+ BORINGSSL_PREFIX %+ _X509_CRL_set_lastUpdate
|
||||
%xdefine _X509_CRL_set_meth_data _ %+ BORINGSSL_PREFIX %+ _X509_CRL_set_meth_data
|
||||
%xdefine _X509_CRL_set_nextUpdate _ %+ BORINGSSL_PREFIX %+ _X509_CRL_set_nextUpdate
|
||||
%xdefine _X509_CRL_set_version _ %+ BORINGSSL_PREFIX %+ _X509_CRL_set_version
|
||||
%xdefine _X509_CRL_sign _ %+ BORINGSSL_PREFIX %+ _X509_CRL_sign
|
||||
%xdefine _X509_CRL_sign_ctx _ %+ BORINGSSL_PREFIX %+ _X509_CRL_sign_ctx
|
||||
@@ -2362,6 +2357,8 @@
|
||||
%xdefine _X509_REVOKED_set_revocationDate _ %+ BORINGSSL_PREFIX %+ _X509_REVOKED_set_revocationDate
|
||||
%xdefine _X509_REVOKED_set_serialNumber _ %+ BORINGSSL_PREFIX %+ _X509_REVOKED_set_serialNumber
|
||||
%xdefine _X509_SIG_free _ %+ BORINGSSL_PREFIX %+ _X509_SIG_free
|
||||
%xdefine _X509_SIG_get0 _ %+ BORINGSSL_PREFIX %+ _X509_SIG_get0
|
||||
%xdefine _X509_SIG_getm _ %+ BORINGSSL_PREFIX %+ _X509_SIG_getm
|
||||
%xdefine _X509_SIG_it _ %+ BORINGSSL_PREFIX %+ _X509_SIG_it
|
||||
%xdefine _X509_SIG_new _ %+ BORINGSSL_PREFIX %+ _X509_SIG_new
|
||||
%xdefine _X509_STORE_CTX_cleanup _ %+ BORINGSSL_PREFIX %+ _X509_STORE_CTX_cleanup
|
||||
@@ -2516,8 +2513,10 @@
|
||||
%xdefine _X509_get0_notAfter _ %+ BORINGSSL_PREFIX %+ _X509_get0_notAfter
|
||||
%xdefine _X509_get0_notBefore _ %+ BORINGSSL_PREFIX %+ _X509_get0_notBefore
|
||||
%xdefine _X509_get0_pubkey_bitstr _ %+ BORINGSSL_PREFIX %+ _X509_get0_pubkey_bitstr
|
||||
%xdefine _X509_get0_serialNumber _ %+ BORINGSSL_PREFIX %+ _X509_get0_serialNumber
|
||||
%xdefine _X509_get0_signature _ %+ BORINGSSL_PREFIX %+ _X509_get0_signature
|
||||
%xdefine _X509_get0_tbs_sigalg _ %+ BORINGSSL_PREFIX %+ _X509_get0_tbs_sigalg
|
||||
%xdefine _X509_get0_uids _ %+ BORINGSSL_PREFIX %+ _X509_get0_uids
|
||||
%xdefine _X509_get1_email _ %+ BORINGSSL_PREFIX %+ _X509_get1_email
|
||||
%xdefine _X509_get1_ocsp _ %+ BORINGSSL_PREFIX %+ _X509_get1_ocsp
|
||||
%xdefine _X509_get_X509_PUBKEY _ %+ BORINGSSL_PREFIX %+ _X509_get_X509_PUBKEY
|
||||
@@ -2581,6 +2580,8 @@
|
||||
%xdefine _X509_print_fp _ %+ BORINGSSL_PREFIX %+ _X509_print_fp
|
||||
%xdefine _X509_pubkey_digest _ %+ BORINGSSL_PREFIX %+ _X509_pubkey_digest
|
||||
%xdefine _X509_reject_clear _ %+ BORINGSSL_PREFIX %+ _X509_reject_clear
|
||||
%xdefine _X509_set1_notAfter _ %+ BORINGSSL_PREFIX %+ _X509_set1_notAfter
|
||||
%xdefine _X509_set1_notBefore _ %+ BORINGSSL_PREFIX %+ _X509_set1_notBefore
|
||||
%xdefine _X509_set_ex_data _ %+ BORINGSSL_PREFIX %+ _X509_set_ex_data
|
||||
%xdefine _X509_set_issuer_name _ %+ BORINGSSL_PREFIX %+ _X509_set_issuer_name
|
||||
%xdefine _X509_set_notAfter _ %+ BORINGSSL_PREFIX %+ _X509_set_notAfter
|
||||
@@ -2841,7 +2842,6 @@
|
||||
%xdefine _d2i_PKCS8_PRIV_KEY_INFO_fp _ %+ BORINGSSL_PREFIX %+ _d2i_PKCS8_PRIV_KEY_INFO_fp
|
||||
%xdefine _d2i_PKCS8_bio _ %+ BORINGSSL_PREFIX %+ _d2i_PKCS8_bio
|
||||
%xdefine _d2i_PKCS8_fp _ %+ BORINGSSL_PREFIX %+ _d2i_PKCS8_fp
|
||||
%xdefine _d2i_PKEY_USAGE_PERIOD _ %+ BORINGSSL_PREFIX %+ _d2i_PKEY_USAGE_PERIOD
|
||||
%xdefine _d2i_POLICYINFO _ %+ BORINGSSL_PREFIX %+ _d2i_POLICYINFO
|
||||
%xdefine _d2i_POLICYQUALINFO _ %+ BORINGSSL_PREFIX %+ _d2i_POLICYQUALINFO
|
||||
%xdefine _d2i_PROXY_CERT_INFO_EXTENSION _ %+ BORINGSSL_PREFIX %+ _d2i_PROXY_CERT_INFO_EXTENSION
|
||||
@@ -2865,8 +2865,6 @@
|
||||
%xdefine _d2i_RSA_PUBKEY_fp _ %+ BORINGSSL_PREFIX %+ _d2i_RSA_PUBKEY_fp
|
||||
%xdefine _d2i_SSL_SESSION _ %+ BORINGSSL_PREFIX %+ _d2i_SSL_SESSION
|
||||
%xdefine _d2i_SSL_SESSION_bio _ %+ BORINGSSL_PREFIX %+ _d2i_SSL_SESSION_bio
|
||||
%xdefine _d2i_SXNET _ %+ BORINGSSL_PREFIX %+ _d2i_SXNET
|
||||
%xdefine _d2i_SXNETID _ %+ BORINGSSL_PREFIX %+ _d2i_SXNETID
|
||||
%xdefine _d2i_USERNOTICE _ %+ BORINGSSL_PREFIX %+ _d2i_USERNOTICE
|
||||
%xdefine _d2i_X509 _ %+ BORINGSSL_PREFIX %+ _d2i_X509
|
||||
%xdefine _d2i_X509_ALGOR _ %+ BORINGSSL_PREFIX %+ _d2i_X509_ALGOR
|
||||
@@ -2894,6 +2892,7 @@
|
||||
%xdefine _d2i_X509_bio _ %+ BORINGSSL_PREFIX %+ _d2i_X509_bio
|
||||
%xdefine _d2i_X509_fp _ %+ BORINGSSL_PREFIX %+ _d2i_X509_fp
|
||||
%xdefine _dsa_asn1_meth _ %+ BORINGSSL_PREFIX %+ _dsa_asn1_meth
|
||||
%xdefine _dsa_check_parameters _ %+ BORINGSSL_PREFIX %+ _dsa_check_parameters
|
||||
%xdefine _ec_GFp_mont_add _ %+ BORINGSSL_PREFIX %+ _ec_GFp_mont_add
|
||||
%xdefine _ec_GFp_mont_dbl _ %+ BORINGSSL_PREFIX %+ _ec_GFp_mont_dbl
|
||||
%xdefine _ec_GFp_mont_felem_from_bytes _ %+ BORINGSSL_PREFIX %+ _ec_GFp_mont_felem_from_bytes
|
||||
@@ -3093,7 +3092,6 @@
|
||||
%xdefine _i2d_PKCS8_PRIV_KEY_INFO_fp _ %+ BORINGSSL_PREFIX %+ _i2d_PKCS8_PRIV_KEY_INFO_fp
|
||||
%xdefine _i2d_PKCS8_bio _ %+ BORINGSSL_PREFIX %+ _i2d_PKCS8_bio
|
||||
%xdefine _i2d_PKCS8_fp _ %+ BORINGSSL_PREFIX %+ _i2d_PKCS8_fp
|
||||
%xdefine _i2d_PKEY_USAGE_PERIOD _ %+ BORINGSSL_PREFIX %+ _i2d_PKEY_USAGE_PERIOD
|
||||
%xdefine _i2d_POLICYINFO _ %+ BORINGSSL_PREFIX %+ _i2d_POLICYINFO
|
||||
%xdefine _i2d_POLICYQUALINFO _ %+ BORINGSSL_PREFIX %+ _i2d_POLICYQUALINFO
|
||||
%xdefine _i2d_PROXY_CERT_INFO_EXTENSION _ %+ BORINGSSL_PREFIX %+ _i2d_PROXY_CERT_INFO_EXTENSION
|
||||
@@ -3117,8 +3115,6 @@
|
||||
%xdefine _i2d_RSA_PUBKEY_fp _ %+ BORINGSSL_PREFIX %+ _i2d_RSA_PUBKEY_fp
|
||||
%xdefine _i2d_SSL_SESSION _ %+ BORINGSSL_PREFIX %+ _i2d_SSL_SESSION
|
||||
%xdefine _i2d_SSL_SESSION_bio _ %+ BORINGSSL_PREFIX %+ _i2d_SSL_SESSION_bio
|
||||
%xdefine _i2d_SXNET _ %+ BORINGSSL_PREFIX %+ _i2d_SXNET
|
||||
%xdefine _i2d_SXNETID _ %+ BORINGSSL_PREFIX %+ _i2d_SXNETID
|
||||
%xdefine _i2d_USERNOTICE _ %+ BORINGSSL_PREFIX %+ _i2d_USERNOTICE
|
||||
%xdefine _i2d_X509 _ %+ BORINGSSL_PREFIX %+ _i2d_X509
|
||||
%xdefine _i2d_X509_ALGOR _ %+ BORINGSSL_PREFIX %+ _i2d_X509_ALGOR
|
||||
@@ -3202,6 +3198,7 @@
|
||||
%xdefine _poly_Rq_mul _ %+ BORINGSSL_PREFIX %+ _poly_Rq_mul
|
||||
%xdefine _rand_fork_unsafe_buffering_enabled _ %+ BORINGSSL_PREFIX %+ _rand_fork_unsafe_buffering_enabled
|
||||
%xdefine _rsa_asn1_meth _ %+ BORINGSSL_PREFIX %+ _rsa_asn1_meth
|
||||
%xdefine _rsa_check_public_key _ %+ BORINGSSL_PREFIX %+ _rsa_check_public_key
|
||||
%xdefine _rsa_default_decrypt _ %+ BORINGSSL_PREFIX %+ _rsa_default_decrypt
|
||||
%xdefine _rsa_default_private_transform _ %+ BORINGSSL_PREFIX %+ _rsa_default_private_transform
|
||||
%xdefine _rsa_default_sign_raw _ %+ BORINGSSL_PREFIX %+ _rsa_default_sign_raw
|
||||
@@ -3302,12 +3299,10 @@
|
||||
%xdefine _v3_ocsp_accresp _ %+ BORINGSSL_PREFIX %+ _v3_ocsp_accresp
|
||||
%xdefine _v3_ocsp_nocheck _ %+ BORINGSSL_PREFIX %+ _v3_ocsp_nocheck
|
||||
%xdefine _v3_pci _ %+ BORINGSSL_PREFIX %+ _v3_pci
|
||||
%xdefine _v3_pkey_usage_period _ %+ BORINGSSL_PREFIX %+ _v3_pkey_usage_period
|
||||
%xdefine _v3_policy_constraints _ %+ BORINGSSL_PREFIX %+ _v3_policy_constraints
|
||||
%xdefine _v3_policy_mappings _ %+ BORINGSSL_PREFIX %+ _v3_policy_mappings
|
||||
%xdefine _v3_sinfo _ %+ BORINGSSL_PREFIX %+ _v3_sinfo
|
||||
%xdefine _v3_skey_id _ %+ BORINGSSL_PREFIX %+ _v3_skey_id
|
||||
%xdefine _v3_sxnet _ %+ BORINGSSL_PREFIX %+ _v3_sxnet
|
||||
%xdefine _vpaes_cbc_encrypt _ %+ BORINGSSL_PREFIX %+ _vpaes_cbc_encrypt
|
||||
%xdefine _vpaes_ctr32_encrypt_blocks _ %+ BORINGSSL_PREFIX %+ _vpaes_ctr32_encrypt_blocks
|
||||
%xdefine _vpaes_decrypt _ %+ BORINGSSL_PREFIX %+ _vpaes_decrypt
|
||||
@@ -4280,6 +4275,15 @@
|
||||
%xdefine EVP_EncryptInit BORINGSSL_PREFIX %+ _EVP_EncryptInit
|
||||
%xdefine EVP_EncryptInit_ex BORINGSSL_PREFIX %+ _EVP_EncryptInit_ex
|
||||
%xdefine EVP_EncryptUpdate BORINGSSL_PREFIX %+ _EVP_EncryptUpdate
|
||||
%xdefine EVP_HPKE_CTX_cleanup BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_cleanup
|
||||
%xdefine EVP_HPKE_CTX_export BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_export
|
||||
%xdefine EVP_HPKE_CTX_init BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_init
|
||||
%xdefine EVP_HPKE_CTX_max_overhead BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_max_overhead
|
||||
%xdefine EVP_HPKE_CTX_open BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_open
|
||||
%xdefine EVP_HPKE_CTX_seal BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_seal
|
||||
%xdefine EVP_HPKE_CTX_setup_base_r_x25519 BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_setup_base_r_x25519
|
||||
%xdefine EVP_HPKE_CTX_setup_base_s_x25519 BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_setup_base_s_x25519
|
||||
%xdefine EVP_HPKE_CTX_setup_base_s_x25519_for_test BORINGSSL_PREFIX %+ _EVP_HPKE_CTX_setup_base_s_x25519_for_test
|
||||
%xdefine EVP_MD_CTX_block_size BORINGSSL_PREFIX %+ _EVP_MD_CTX_block_size
|
||||
%xdefine EVP_MD_CTX_cleanup BORINGSSL_PREFIX %+ _EVP_MD_CTX_cleanup
|
||||
%xdefine EVP_MD_CTX_copy BORINGSSL_PREFIX %+ _EVP_MD_CTX_copy
|
||||
@@ -4744,9 +4748,6 @@
|
||||
%xdefine PKCS8_parse_encrypted_private_key BORINGSSL_PREFIX %+ _PKCS8_parse_encrypted_private_key
|
||||
%xdefine PKCS8_pkey_get0 BORINGSSL_PREFIX %+ _PKCS8_pkey_get0
|
||||
%xdefine PKCS8_pkey_set0 BORINGSSL_PREFIX %+ _PKCS8_pkey_set0
|
||||
%xdefine PKEY_USAGE_PERIOD_free BORINGSSL_PREFIX %+ _PKEY_USAGE_PERIOD_free
|
||||
%xdefine PKEY_USAGE_PERIOD_it BORINGSSL_PREFIX %+ _PKEY_USAGE_PERIOD_it
|
||||
%xdefine PKEY_USAGE_PERIOD_new BORINGSSL_PREFIX %+ _PKEY_USAGE_PERIOD_new
|
||||
%xdefine PMBTOKEN_PRETOKEN_free BORINGSSL_PREFIX %+ _PMBTOKEN_PRETOKEN_free
|
||||
%xdefine POLICYINFO_free BORINGSSL_PREFIX %+ _POLICYINFO_free
|
||||
%xdefine POLICYINFO_it BORINGSSL_PREFIX %+ _POLICYINFO_it
|
||||
@@ -5149,6 +5150,7 @@
|
||||
%xdefine SSL_get0_ocsp_response BORINGSSL_PREFIX %+ _SSL_get0_ocsp_response
|
||||
%xdefine SSL_get0_param BORINGSSL_PREFIX %+ _SSL_get0_param
|
||||
%xdefine SSL_get0_peer_certificates BORINGSSL_PREFIX %+ _SSL_get0_peer_certificates
|
||||
%xdefine SSL_get0_peer_delegation_algorithms BORINGSSL_PREFIX %+ _SSL_get0_peer_delegation_algorithms
|
||||
%xdefine SSL_get0_peer_verify_algorithms BORINGSSL_PREFIX %+ _SSL_get0_peer_verify_algorithms
|
||||
%xdefine SSL_get0_server_requested_CAs BORINGSSL_PREFIX %+ _SSL_get0_server_requested_CAs
|
||||
%xdefine SSL_get0_session_id_context BORINGSSL_PREFIX %+ _SSL_get0_session_id_context
|
||||
@@ -5362,18 +5364,6 @@
|
||||
%xdefine SSLv23_client_method BORINGSSL_PREFIX %+ _SSLv23_client_method
|
||||
%xdefine SSLv23_method BORINGSSL_PREFIX %+ _SSLv23_method
|
||||
%xdefine SSLv23_server_method BORINGSSL_PREFIX %+ _SSLv23_server_method
|
||||
%xdefine SXNETID_free BORINGSSL_PREFIX %+ _SXNETID_free
|
||||
%xdefine SXNETID_it BORINGSSL_PREFIX %+ _SXNETID_it
|
||||
%xdefine SXNETID_new BORINGSSL_PREFIX %+ _SXNETID_new
|
||||
%xdefine SXNET_add_id_INTEGER BORINGSSL_PREFIX %+ _SXNET_add_id_INTEGER
|
||||
%xdefine SXNET_add_id_asc BORINGSSL_PREFIX %+ _SXNET_add_id_asc
|
||||
%xdefine SXNET_add_id_ulong BORINGSSL_PREFIX %+ _SXNET_add_id_ulong
|
||||
%xdefine SXNET_free BORINGSSL_PREFIX %+ _SXNET_free
|
||||
%xdefine SXNET_get_id_INTEGER BORINGSSL_PREFIX %+ _SXNET_get_id_INTEGER
|
||||
%xdefine SXNET_get_id_asc BORINGSSL_PREFIX %+ _SXNET_get_id_asc
|
||||
%xdefine SXNET_get_id_ulong BORINGSSL_PREFIX %+ _SXNET_get_id_ulong
|
||||
%xdefine SXNET_it BORINGSSL_PREFIX %+ _SXNET_it
|
||||
%xdefine SXNET_new BORINGSSL_PREFIX %+ _SXNET_new
|
||||
%xdefine TLS_client_method BORINGSSL_PREFIX %+ _TLS_client_method
|
||||
%xdefine TLS_method BORINGSSL_PREFIX %+ _TLS_method
|
||||
%xdefine TLS_server_method BORINGSSL_PREFIX %+ _TLS_server_method
|
||||
@@ -5524,11 +5514,11 @@
|
||||
%xdefine X509_CRL_new BORINGSSL_PREFIX %+ _X509_CRL_new
|
||||
%xdefine X509_CRL_print BORINGSSL_PREFIX %+ _X509_CRL_print
|
||||
%xdefine X509_CRL_print_fp BORINGSSL_PREFIX %+ _X509_CRL_print_fp
|
||||
%xdefine X509_CRL_set1_lastUpdate BORINGSSL_PREFIX %+ _X509_CRL_set1_lastUpdate
|
||||
%xdefine X509_CRL_set1_nextUpdate BORINGSSL_PREFIX %+ _X509_CRL_set1_nextUpdate
|
||||
%xdefine X509_CRL_set_default_method BORINGSSL_PREFIX %+ _X509_CRL_set_default_method
|
||||
%xdefine X509_CRL_set_issuer_name BORINGSSL_PREFIX %+ _X509_CRL_set_issuer_name
|
||||
%xdefine X509_CRL_set_lastUpdate BORINGSSL_PREFIX %+ _X509_CRL_set_lastUpdate
|
||||
%xdefine X509_CRL_set_meth_data BORINGSSL_PREFIX %+ _X509_CRL_set_meth_data
|
||||
%xdefine X509_CRL_set_nextUpdate BORINGSSL_PREFIX %+ _X509_CRL_set_nextUpdate
|
||||
%xdefine X509_CRL_set_version BORINGSSL_PREFIX %+ _X509_CRL_set_version
|
||||
%xdefine X509_CRL_sign BORINGSSL_PREFIX %+ _X509_CRL_sign
|
||||
%xdefine X509_CRL_sign_ctx BORINGSSL_PREFIX %+ _X509_CRL_sign_ctx
|
||||
@@ -5686,6 +5676,8 @@
|
||||
%xdefine X509_REVOKED_set_revocationDate BORINGSSL_PREFIX %+ _X509_REVOKED_set_revocationDate
|
||||
%xdefine X509_REVOKED_set_serialNumber BORINGSSL_PREFIX %+ _X509_REVOKED_set_serialNumber
|
||||
%xdefine X509_SIG_free BORINGSSL_PREFIX %+ _X509_SIG_free
|
||||
%xdefine X509_SIG_get0 BORINGSSL_PREFIX %+ _X509_SIG_get0
|
||||
%xdefine X509_SIG_getm BORINGSSL_PREFIX %+ _X509_SIG_getm
|
||||
%xdefine X509_SIG_it BORINGSSL_PREFIX %+ _X509_SIG_it
|
||||
%xdefine X509_SIG_new BORINGSSL_PREFIX %+ _X509_SIG_new
|
||||
%xdefine X509_STORE_CTX_cleanup BORINGSSL_PREFIX %+ _X509_STORE_CTX_cleanup
|
||||
@@ -5840,8 +5832,10 @@
|
||||
%xdefine X509_get0_notAfter BORINGSSL_PREFIX %+ _X509_get0_notAfter
|
||||
%xdefine X509_get0_notBefore BORINGSSL_PREFIX %+ _X509_get0_notBefore
|
||||
%xdefine X509_get0_pubkey_bitstr BORINGSSL_PREFIX %+ _X509_get0_pubkey_bitstr
|
||||
%xdefine X509_get0_serialNumber BORINGSSL_PREFIX %+ _X509_get0_serialNumber
|
||||
%xdefine X509_get0_signature BORINGSSL_PREFIX %+ _X509_get0_signature
|
||||
%xdefine X509_get0_tbs_sigalg BORINGSSL_PREFIX %+ _X509_get0_tbs_sigalg
|
||||
%xdefine X509_get0_uids BORINGSSL_PREFIX %+ _X509_get0_uids
|
||||
%xdefine X509_get1_email BORINGSSL_PREFIX %+ _X509_get1_email
|
||||
%xdefine X509_get1_ocsp BORINGSSL_PREFIX %+ _X509_get1_ocsp
|
||||
%xdefine X509_get_X509_PUBKEY BORINGSSL_PREFIX %+ _X509_get_X509_PUBKEY
|
||||
@@ -5905,6 +5899,8 @@
|
||||
%xdefine X509_print_fp BORINGSSL_PREFIX %+ _X509_print_fp
|
||||
%xdefine X509_pubkey_digest BORINGSSL_PREFIX %+ _X509_pubkey_digest
|
||||
%xdefine X509_reject_clear BORINGSSL_PREFIX %+ _X509_reject_clear
|
||||
%xdefine X509_set1_notAfter BORINGSSL_PREFIX %+ _X509_set1_notAfter
|
||||
%xdefine X509_set1_notBefore BORINGSSL_PREFIX %+ _X509_set1_notBefore
|
||||
%xdefine X509_set_ex_data BORINGSSL_PREFIX %+ _X509_set_ex_data
|
||||
%xdefine X509_set_issuer_name BORINGSSL_PREFIX %+ _X509_set_issuer_name
|
||||
%xdefine X509_set_notAfter BORINGSSL_PREFIX %+ _X509_set_notAfter
|
||||
@@ -6165,7 +6161,6 @@
|
||||
%xdefine d2i_PKCS8_PRIV_KEY_INFO_fp BORINGSSL_PREFIX %+ _d2i_PKCS8_PRIV_KEY_INFO_fp
|
||||
%xdefine d2i_PKCS8_bio BORINGSSL_PREFIX %+ _d2i_PKCS8_bio
|
||||
%xdefine d2i_PKCS8_fp BORINGSSL_PREFIX %+ _d2i_PKCS8_fp
|
||||
%xdefine d2i_PKEY_USAGE_PERIOD BORINGSSL_PREFIX %+ _d2i_PKEY_USAGE_PERIOD
|
||||
%xdefine d2i_POLICYINFO BORINGSSL_PREFIX %+ _d2i_POLICYINFO
|
||||
%xdefine d2i_POLICYQUALINFO BORINGSSL_PREFIX %+ _d2i_POLICYQUALINFO
|
||||
%xdefine d2i_PROXY_CERT_INFO_EXTENSION BORINGSSL_PREFIX %+ _d2i_PROXY_CERT_INFO_EXTENSION
|
||||
@@ -6189,8 +6184,6 @@
|
||||
%xdefine d2i_RSA_PUBKEY_fp BORINGSSL_PREFIX %+ _d2i_RSA_PUBKEY_fp
|
||||
%xdefine d2i_SSL_SESSION BORINGSSL_PREFIX %+ _d2i_SSL_SESSION
|
||||
%xdefine d2i_SSL_SESSION_bio BORINGSSL_PREFIX %+ _d2i_SSL_SESSION_bio
|
||||
%xdefine d2i_SXNET BORINGSSL_PREFIX %+ _d2i_SXNET
|
||||
%xdefine d2i_SXNETID BORINGSSL_PREFIX %+ _d2i_SXNETID
|
||||
%xdefine d2i_USERNOTICE BORINGSSL_PREFIX %+ _d2i_USERNOTICE
|
||||
%xdefine d2i_X509 BORINGSSL_PREFIX %+ _d2i_X509
|
||||
%xdefine d2i_X509_ALGOR BORINGSSL_PREFIX %+ _d2i_X509_ALGOR
|
||||
@@ -6218,6 +6211,7 @@
|
||||
%xdefine d2i_X509_bio BORINGSSL_PREFIX %+ _d2i_X509_bio
|
||||
%xdefine d2i_X509_fp BORINGSSL_PREFIX %+ _d2i_X509_fp
|
||||
%xdefine dsa_asn1_meth BORINGSSL_PREFIX %+ _dsa_asn1_meth
|
||||
%xdefine dsa_check_parameters BORINGSSL_PREFIX %+ _dsa_check_parameters
|
||||
%xdefine ec_GFp_mont_add BORINGSSL_PREFIX %+ _ec_GFp_mont_add
|
||||
%xdefine ec_GFp_mont_dbl BORINGSSL_PREFIX %+ _ec_GFp_mont_dbl
|
||||
%xdefine ec_GFp_mont_felem_from_bytes BORINGSSL_PREFIX %+ _ec_GFp_mont_felem_from_bytes
|
||||
@@ -6417,7 +6411,6 @@
|
||||
%xdefine i2d_PKCS8_PRIV_KEY_INFO_fp BORINGSSL_PREFIX %+ _i2d_PKCS8_PRIV_KEY_INFO_fp
|
||||
%xdefine i2d_PKCS8_bio BORINGSSL_PREFIX %+ _i2d_PKCS8_bio
|
||||
%xdefine i2d_PKCS8_fp BORINGSSL_PREFIX %+ _i2d_PKCS8_fp
|
||||
%xdefine i2d_PKEY_USAGE_PERIOD BORINGSSL_PREFIX %+ _i2d_PKEY_USAGE_PERIOD
|
||||
%xdefine i2d_POLICYINFO BORINGSSL_PREFIX %+ _i2d_POLICYINFO
|
||||
%xdefine i2d_POLICYQUALINFO BORINGSSL_PREFIX %+ _i2d_POLICYQUALINFO
|
||||
%xdefine i2d_PROXY_CERT_INFO_EXTENSION BORINGSSL_PREFIX %+ _i2d_PROXY_CERT_INFO_EXTENSION
|
||||
@@ -6441,8 +6434,6 @@
|
||||
%xdefine i2d_RSA_PUBKEY_fp BORINGSSL_PREFIX %+ _i2d_RSA_PUBKEY_fp
|
||||
%xdefine i2d_SSL_SESSION BORINGSSL_PREFIX %+ _i2d_SSL_SESSION
|
||||
%xdefine i2d_SSL_SESSION_bio BORINGSSL_PREFIX %+ _i2d_SSL_SESSION_bio
|
||||
%xdefine i2d_SXNET BORINGSSL_PREFIX %+ _i2d_SXNET
|
||||
%xdefine i2d_SXNETID BORINGSSL_PREFIX %+ _i2d_SXNETID
|
||||
%xdefine i2d_USERNOTICE BORINGSSL_PREFIX %+ _i2d_USERNOTICE
|
||||
%xdefine i2d_X509 BORINGSSL_PREFIX %+ _i2d_X509
|
||||
%xdefine i2d_X509_ALGOR BORINGSSL_PREFIX %+ _i2d_X509_ALGOR
|
||||
@@ -6526,6 +6517,7 @@
|
||||
%xdefine poly_Rq_mul BORINGSSL_PREFIX %+ _poly_Rq_mul
|
||||
%xdefine rand_fork_unsafe_buffering_enabled BORINGSSL_PREFIX %+ _rand_fork_unsafe_buffering_enabled
|
||||
%xdefine rsa_asn1_meth BORINGSSL_PREFIX %+ _rsa_asn1_meth
|
||||
%xdefine rsa_check_public_key BORINGSSL_PREFIX %+ _rsa_check_public_key
|
||||
%xdefine rsa_default_decrypt BORINGSSL_PREFIX %+ _rsa_default_decrypt
|
||||
%xdefine rsa_default_private_transform BORINGSSL_PREFIX %+ _rsa_default_private_transform
|
||||
%xdefine rsa_default_sign_raw BORINGSSL_PREFIX %+ _rsa_default_sign_raw
|
||||
@@ -6626,12 +6618,10 @@
|
||||
%xdefine v3_ocsp_accresp BORINGSSL_PREFIX %+ _v3_ocsp_accresp
|
||||
%xdefine v3_ocsp_nocheck BORINGSSL_PREFIX %+ _v3_ocsp_nocheck
|
||||
%xdefine v3_pci BORINGSSL_PREFIX %+ _v3_pci
|
||||
%xdefine v3_pkey_usage_period BORINGSSL_PREFIX %+ _v3_pkey_usage_period
|
||||
%xdefine v3_policy_constraints BORINGSSL_PREFIX %+ _v3_policy_constraints
|
||||
%xdefine v3_policy_mappings BORINGSSL_PREFIX %+ _v3_policy_mappings
|
||||
%xdefine v3_sinfo BORINGSSL_PREFIX %+ _v3_sinfo
|
||||
%xdefine v3_skey_id BORINGSSL_PREFIX %+ _v3_skey_id
|
||||
%xdefine v3_sxnet BORINGSSL_PREFIX %+ _v3_sxnet
|
||||
%xdefine vpaes_cbc_encrypt BORINGSSL_PREFIX %+ _vpaes_cbc_encrypt
|
||||
%xdefine vpaes_ctr32_encrypt_blocks BORINGSSL_PREFIX %+ _vpaes_ctr32_encrypt_blocks
|
||||
%xdefine vpaes_decrypt BORINGSSL_PREFIX %+ _vpaes_decrypt
|
||||
|
||||
@@ -1650,6 +1650,10 @@ struct SSL_HANDSHAKE {
|
||||
// advertise this extension to the client.
|
||||
Array<uint16_t> peer_supported_group_list;
|
||||
|
||||
// peer_delegated_credential_sigalgs are the signature algorithms the peer
|
||||
// supports with delegated credentials.
|
||||
Array<uint16_t> peer_delegated_credential_sigalgs;
|
||||
|
||||
// peer_key is the peer's ECDH key for a TLS 1.2 client.
|
||||
Array<uint8_t> peer_key;
|
||||
|
||||
|
||||
@@ -821,16 +821,13 @@ static bool ssl_can_serve_dc(const SSL_HANDSHAKE *hs) {
|
||||
}
|
||||
|
||||
// Check that the DC signature algorithm is supported by the peer.
|
||||
Span<const uint16_t> peer_sigalgs = tls1_get_peer_verify_algorithms(hs);
|
||||
bool sigalg_found = false;
|
||||
Span<const uint16_t> peer_sigalgs = hs->peer_delegated_credential_sigalgs;
|
||||
for (uint16_t peer_sigalg : peer_sigalgs) {
|
||||
if (dc->expected_cert_verify_algorithm == peer_sigalg) {
|
||||
sigalg_found = true;
|
||||
break;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return sigalg_found;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ssl_signing_with_dc(const SSL_HANDSHAKE *hs) {
|
||||
|
||||
@@ -2360,6 +2360,16 @@ size_t SSL_get0_peer_verify_algorithms(const SSL *ssl,
|
||||
return sigalgs.size();
|
||||
}
|
||||
|
||||
size_t SSL_get0_peer_delegation_algorithms(const SSL *ssl,
|
||||
const uint16_t **out_sigalgs){
|
||||
Span<const uint16_t> sigalgs;
|
||||
if (ssl->s3->hs != nullptr) {
|
||||
sigalgs = ssl->s3->hs->peer_delegated_credential_sigalgs;
|
||||
}
|
||||
*out_sigalgs = sigalgs.data();
|
||||
return sigalgs.size();
|
||||
}
|
||||
|
||||
EVP_PKEY *SSL_get_privatekey(const SSL *ssl) {
|
||||
if (!ssl->config) {
|
||||
assert(ssl->config);
|
||||
|
||||
@@ -1245,6 +1245,12 @@ static bool ext_sct_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) {
|
||||
|
||||
static bool ext_alpn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) {
|
||||
SSL *const ssl = hs->ssl;
|
||||
if (hs->config->alpn_client_proto_list.empty() && ssl->quic_method) {
|
||||
// ALPN MUST be used with QUIC.
|
||||
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_ALPN);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (hs->config->alpn_client_proto_list.empty() ||
|
||||
ssl->s3->initial_handshake_complete) {
|
||||
return true;
|
||||
@@ -1267,6 +1273,12 @@ static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert,
|
||||
CBS *contents) {
|
||||
SSL *const ssl = hs->ssl;
|
||||
if (contents == NULL) {
|
||||
if (ssl->quic_method) {
|
||||
// ALPN is required when QUIC is used.
|
||||
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_ALPN);
|
||||
*out_alert = SSL_AD_NO_APPLICATION_PROTOCOL;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1342,6 +1354,12 @@ bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert,
|
||||
!ssl_client_hello_get_extension(
|
||||
client_hello, &contents,
|
||||
TLSEXT_TYPE_application_layer_protocol_negotiation)) {
|
||||
if (ssl->quic_method) {
|
||||
// ALPN is required when QUIC is used.
|
||||
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_ALPN);
|
||||
*out_alert = SSL_AD_NO_APPLICATION_PROTOCOL;
|
||||
return false;
|
||||
}
|
||||
// Ignore ALPN if not configured or no extension was supplied.
|
||||
return true;
|
||||
}
|
||||
@@ -1388,6 +1406,11 @@ bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert,
|
||||
*out_alert = SSL_AD_INTERNAL_ERROR;
|
||||
return false;
|
||||
}
|
||||
} else if (ssl->quic_method) {
|
||||
// ALPN is required when QUIC is used.
|
||||
OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_ALPN);
|
||||
*out_alert = SSL_AD_NO_APPLICATION_PROTOCOL;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2650,20 +2673,22 @@ static bool ext_delegated_credential_add_clienthello(SSL_HANDSHAKE *hs,
|
||||
static bool ext_delegated_credential_parse_clienthello(SSL_HANDSHAKE *hs,
|
||||
uint8_t *out_alert,
|
||||
CBS *contents) {
|
||||
assert(TLSEXT_TYPE_delegated_credential == 0xff02);
|
||||
// TODO: Check that the extension is empty.
|
||||
//
|
||||
// As of draft-03, the client sends an empty extension in order indicate
|
||||
// support for delegated credentials. This could change, however, since the
|
||||
// spec is not yet finalized. This assertion is here to remind us to enforce
|
||||
// this check once the extension ID is assigned.
|
||||
|
||||
if (contents == nullptr || ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) {
|
||||
// Don't use delegated credentials unless we're negotiating TLS 1.3 or
|
||||
// higher.
|
||||
return true;
|
||||
}
|
||||
|
||||
// The contents of the extension are the signature algorithms the client will
|
||||
// accept for a delegated credential.
|
||||
CBS sigalg_list;
|
||||
if (!CBS_get_u16_length_prefixed(contents, &sigalg_list) ||
|
||||
CBS_len(&sigalg_list) == 0 ||
|
||||
CBS_len(contents) != 0 ||
|
||||
!parse_u16_array(&sigalg_list, &hs->peer_delegated_credential_sigalgs)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
hs->delegated_credential_requested = true;
|
||||
return true;
|
||||
}
|
||||
@@ -3047,7 +3072,7 @@ bool ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out,
|
||||
last_was_empty = false;
|
||||
}
|
||||
|
||||
if (!SSL_is_dtls(ssl)) {
|
||||
if (!SSL_is_dtls(ssl) && !ssl->quic_method) {
|
||||
size_t psk_extension_len = ext_pre_shared_key_clienthello_length(hs);
|
||||
header_len += 2 + CBB_len(&extensions) + psk_extension_len;
|
||||
size_t padding_len = 0;
|
||||
|
||||
@@ -196,6 +196,11 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) {
|
||||
return ssl_hs_error;
|
||||
}
|
||||
|
||||
if (ssl->quic_method != nullptr && client_hello.session_id_len > 0) {
|
||||
OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_COMPATIBILITY_MODE);
|
||||
ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER);
|
||||
return ssl_hs_error;
|
||||
}
|
||||
OPENSSL_memcpy(hs->session_id, client_hello.session_id,
|
||||
client_hello.session_id_len);
|
||||
hs->session_id_len = client_hello.session_id_len;
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
diff --git a/Sources/CNIOBoringSSL/include/CNIOBoringSSL_arm_arch.h b/Sources/CNIOBoringSSL/include/CNIOBoringSSL_arm_arch.h
|
||||
index faa2655..0e76796 100644
|
||||
index 1f16799..0c7f117 100644
|
||||
--- a/Sources/CNIOBoringSSL/include/CNIOBoringSSL_arm_arch.h
|
||||
+++ b/Sources/CNIOBoringSSL/include/CNIOBoringSSL_arm_arch.h
|
||||
@@ -49,7 +49,7 @@
|
||||
* This product includes cryptographic software written by Eric Young
|
||||
@@ -50,6 +50,7 @@
|
||||
* (eay@cryptsoft.com). This product includes software written by Tim
|
||||
* Hudson (tjh@cryptsoft.com). */
|
||||
-
|
||||
|
||||
+#if __arm__ || __arm64__ || __aarch64__
|
||||
#ifndef OPENSSL_HEADER_ARM_ARCH_H
|
||||
#define OPENSSL_HEADER_ARM_ARCH_H
|
||||
|
||||
@@ -119,3 +119,4 @@
|
||||
|
||||
@@ -171,3 +172,4 @@
|
||||
#endif /* defined __ASSEMBLER__ */
|
||||
|
||||
#endif // OPENSSL_HEADER_ARM_ARCH_H
|
||||
+#endif // __arm__ || __arm64__ || __aarch64__
|
||||
Reference in new issue
Block a user