aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/restricted/aws/s2n/tls/s2n_tls13_secrets.h
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.ru>2022-05-10 22:16:03 +0300
committerthegeorg <thegeorg@yandex-team.ru>2022-05-10 22:16:03 +0300
commit09c71d918d4d0b0ebf67e1ab41aa90ddf587a3f2 (patch)
treedd44d2cb68e2845c2d4c367b66893f3e043a6e8e /contrib/restricted/aws/s2n/tls/s2n_tls13_secrets.h
parent5eb4a8a2d487411924e1d1b27c454223dcf35005 (diff)
downloadydb-09c71d918d4d0b0ebf67e1ab41aa90ddf587a3f2.tar.gz
Update contrib/restricted/aws/s2n to 1.3.12
ref:f8279d764b4c00974a63543a1364c91e2b81b7a6
Diffstat (limited to 'contrib/restricted/aws/s2n/tls/s2n_tls13_secrets.h')
-rw-r--r--contrib/restricted/aws/s2n/tls/s2n_tls13_secrets.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/restricted/aws/s2n/tls/s2n_tls13_secrets.h b/contrib/restricted/aws/s2n/tls/s2n_tls13_secrets.h
new file mode 100644
index 0000000000..37c50a117c
--- /dev/null
+++ b/contrib/restricted/aws/s2n/tls/s2n_tls13_secrets.h
@@ -0,0 +1,55 @@
+/*
+ * 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 "tls/s2n_crypto_constants.h"
+#include "tls/s2n_quic_support.h"
+#include "utils/s2n_blob.h"
+#include "utils/s2n_result.h"
+
+/* tls/s2n_tls13_secrets should eventually replace crypto/s2n_tls13_keys.h */
+#include "crypto/s2n_tls13_keys.h"
+
+typedef enum {
+ S2N_NONE_SECRET = 0,
+ S2N_EARLY_SECRET,
+ S2N_HANDSHAKE_SECRET,
+ S2N_MASTER_SECRET
+} s2n_extract_secret_type_t;
+
+struct s2n_tls13_secrets {
+ uint8_t extract_secret[S2N_TLS13_SECRET_MAX_LEN];
+ s2n_extract_secret_type_t extract_secret_type;
+
+ uint8_t client_early_secret[S2N_TLS13_SECRET_MAX_LEN];
+ uint8_t client_handshake_secret[S2N_TLS13_SECRET_MAX_LEN];
+ uint8_t server_handshake_secret[S2N_TLS13_SECRET_MAX_LEN];
+
+ uint8_t client_app_secret[S2N_TLS13_SECRET_MAX_LEN];
+ uint8_t server_app_secret[S2N_TLS13_SECRET_MAX_LEN];
+ uint8_t resumption_master_secret[S2N_TLS13_SECRET_MAX_LEN];
+};
+
+S2N_RESULT s2n_tls13_empty_transcripts_init();
+
+S2N_RESULT s2n_tls13_secrets_update(struct s2n_connection *conn);
+S2N_RESULT s2n_tls13_secrets_get(struct s2n_connection *conn, s2n_extract_secret_type_t secret_type,
+ s2n_mode mode, struct s2n_blob *secret);
+S2N_RESULT s2n_tls13_secrets_clean(struct s2n_connection *conn);
+
+S2N_RESULT s2n_derive_binder_key(struct s2n_psk *psk, struct s2n_blob *output);
+S2N_RESULT s2n_derive_resumption_master_secret(struct s2n_connection *conn);
+