diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-05-10 22:16:03 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.ru> | 2022-05-10 22:16:03 +0300 |
commit | 09c71d918d4d0b0ebf67e1ab41aa90ddf587a3f2 (patch) | |
tree | dd44d2cb68e2845c2d4c367b66893f3e043a6e8e /contrib/restricted/aws/s2n/tls/s2n_handshake_hashes.h | |
parent | 5eb4a8a2d487411924e1d1b27c454223dcf35005 (diff) | |
download | ydb-09c71d918d4d0b0ebf67e1ab41aa90ddf587a3f2.tar.gz |
Update contrib/restricted/aws/s2n to 1.3.12
ref:f8279d764b4c00974a63543a1364c91e2b81b7a6
Diffstat (limited to 'contrib/restricted/aws/s2n/tls/s2n_handshake_hashes.h')
-rw-r--r-- | contrib/restricted/aws/s2n/tls/s2n_handshake_hashes.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/contrib/restricted/aws/s2n/tls/s2n_handshake_hashes.h b/contrib/restricted/aws/s2n/tls/s2n_handshake_hashes.h new file mode 100644 index 0000000000..22d157deb4 --- /dev/null +++ b/contrib/restricted/aws/s2n/tls/s2n_handshake_hashes.h @@ -0,0 +1,44 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +#pragma once + +#include "api/s2n.h" + +#include "crypto/s2n_hash.h" +#include "crypto/s2n_tls13_keys.h" + +struct s2n_handshake_hashes { + struct s2n_hash_state md5; + struct s2n_hash_state sha1; + struct s2n_hash_state sha224; + struct s2n_hash_state sha256; + struct s2n_hash_state sha384; + struct s2n_hash_state sha512; + struct s2n_hash_state md5_sha1; + + /* TLS1.3 requires transcript hash digests to calculate secrets. + */ + uint8_t transcript_hash_digest[S2N_TLS13_SECRET_MAX_LEN]; + + /* To avoid allocating memory for hash objects, we reuse one temporary hash object. + * Do NOT rely on this hash state maintaining its value outside of the current context. + */ + struct s2n_hash_state hash_workspace; +}; + +S2N_RESULT s2n_handshake_hashes_new(struct s2n_handshake_hashes **hashes); +S2N_RESULT s2n_handshake_hashes_wipe(struct s2n_handshake_hashes *hashes); +S2N_CLEANUP_RESULT s2n_handshake_hashes_free(struct s2n_handshake_hashes **hashes); |