aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl/ssl/ssl_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssl/ssl/ssl_asn1.c')
-rw-r--r--crypto/openssl/ssl/ssl_asn1.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/crypto/openssl/ssl/ssl_asn1.c b/crypto/openssl/ssl/ssl_asn1.c
index 9964a8c1eeb3..13ab6490b9a7 100644
--- a/crypto/openssl/ssl/ssl_asn1.c
+++ b/crypto/openssl/ssl/ssl_asn1.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
* Copyright 2005 Nokia. All rights reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
@@ -88,7 +88,7 @@ IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(SSL_SESSION_ASN1)
/* Initialise OCTET STRING from buffer and length */
static void ssl_session_oinit(ASN1_OCTET_STRING **dest, ASN1_OCTET_STRING *os,
- const unsigned char *data, size_t len)
+ const unsigned char *data, size_t len)
{
os->data = (unsigned char *)data; /* justified cast: data is not modified */
os->length = (int)len;
@@ -98,7 +98,7 @@ static void ssl_session_oinit(ASN1_OCTET_STRING **dest, ASN1_OCTET_STRING *os,
/* Initialise OCTET STRING from string */
static void ssl_session_sinit(ASN1_OCTET_STRING **dest, ASN1_OCTET_STRING *os,
- const char *data)
+ const char *data)
{
if (data != NULL)
ssl_session_oinit(dest, os, (const unsigned char *)data, strlen(data));
@@ -160,13 +160,13 @@ int i2d_SSL_SESSION(const SSL_SESSION *in, unsigned char **pp)
#endif
ssl_session_oinit(&as.master_key, &master_key,
- in->master_key, in->master_key_length);
+ in->master_key, in->master_key_length);
ssl_session_oinit(&as.session_id, &session_id,
- in->session_id, in->session_id_length);
+ in->session_id, in->session_id_length);
ssl_session_oinit(&as.session_id_context, &sid_ctx,
- in->sid_ctx, in->sid_ctx_length);
+ in->sid_ctx, in->sid_ctx_length);
as.time = (int64_t)ossl_time_to_time_t(in->time);
as.timeout = (int64_t)ossl_time2seconds(in->timeout);
@@ -183,22 +183,22 @@ int i2d_SSL_SESSION(const SSL_SESSION *in, unsigned char **pp)
}
ssl_session_sinit(&as.tlsext_hostname, &tlsext_hostname,
- in->ext.hostname);
+ in->ext.hostname);
if (in->ext.tick) {
ssl_session_oinit(&as.tlsext_tick, &tlsext_tick,
- in->ext.tick, in->ext.ticklen);
+ in->ext.tick, in->ext.ticklen);
}
if (in->ext.tick_lifetime_hint > 0)
as.tlsext_tick_lifetime_hint = in->ext.tick_lifetime_hint;
as.tlsext_tick_age_add = in->ext.tick_age_add;
#ifndef OPENSSL_NO_PSK
ssl_session_sinit(&as.psk_identity_hint, &psk_identity_hint,
- in->psk_identity_hint);
+ in->psk_identity_hint);
ssl_session_sinit(&as.psk_identity, &psk_identity, in->psk_identity);
-#endif /* OPENSSL_NO_PSK */
+#endif /* OPENSSL_NO_PSK */
#ifndef OPENSSL_NO_SRP
ssl_session_sinit(&as.srp_username, &srp_username, in->srp_username);
-#endif /* OPENSSL_NO_SRP */
+#endif /* OPENSSL_NO_SRP */
as.flags = in->flags;
as.max_early_data = in->ext.max_early_data;
@@ -207,7 +207,7 @@ int i2d_SSL_SESSION(const SSL_SESSION *in, unsigned char **pp)
as.alpn_selected = NULL;
else
ssl_session_oinit(&as.alpn_selected, &alpn_selected,
- in->ext.alpn_selected, in->ext.alpn_selected_len);
+ in->ext.alpn_selected, in->ext.alpn_selected_len);
as.tlsext_max_fragment_len_mode = in->ext.max_fragment_len_mode;
@@ -215,7 +215,7 @@ int i2d_SSL_SESSION(const SSL_SESSION *in, unsigned char **pp)
as.ticket_appdata = NULL;
else
ssl_session_oinit(&as.ticket_appdata, &ticket_appdata,
- in->ticket_appdata, in->ticket_appdata_len);
+ in->ticket_appdata, in->ticket_appdata_len);
ret = i2d_SSL_SESSION_ASN1(&as, pp);
OPENSSL_free(peer_rpk.data);
@@ -241,7 +241,7 @@ static int ssl_session_strndup(char **pdst, ASN1_OCTET_STRING *src)
/* Copy an OCTET STRING, return error if it exceeds maximum length */
static int ssl_session_memcpy(unsigned char *dst, size_t *pdstlen,
- ASN1_OCTET_STRING *src, size_t maxlen)
+ ASN1_OCTET_STRING *src, size_t maxlen)
{
if (src == NULL || src->length == 0) {
*pdstlen = 0;
@@ -255,13 +255,13 @@ static int ssl_session_memcpy(unsigned char *dst, size_t *pdstlen,
}
SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
- long length)
+ long length)
{
return d2i_SSL_SESSION_ex(a, pp, length, NULL, NULL);
}
SSL_SESSION *d2i_SSL_SESSION_ex(SSL_SESSION **a, const unsigned char **pp,
- long length, OSSL_LIB_CTX *libctx,
- const char *propq)
+ long length, OSSL_LIB_CTX *libctx,
+ const char *propq)
{
long id;
size_t tmpl;
@@ -304,7 +304,7 @@ SSL_SESSION *d2i_SSL_SESSION_ex(SSL_SESSION **a, const unsigned char **pp,
}
id = 0x03000000L | ((unsigned long)as->cipher->data[0] << 8L)
- | (unsigned long)as->cipher->data[1];
+ | (unsigned long)as->cipher->data[1];
ret->cipher_id = id;
ret->cipher = ssl3_get_cipher_by_id(id);
@@ -312,11 +312,11 @@ SSL_SESSION *d2i_SSL_SESSION_ex(SSL_SESSION **a, const unsigned char **pp,
goto err;
if (!ssl_session_memcpy(ret->session_id, &ret->session_id_length,
- as->session_id, SSL3_MAX_SSL_SESSION_ID_LENGTH))
+ as->session_id, SSL3_MAX_SSL_SESSION_ID_LENGTH))
goto err;
if (!ssl_session_memcpy(ret->master_key, &tmpl,
- as->master_key, TLS13_MAX_RESUMPTION_PSK_LENGTH))
+ as->master_key, TLS13_MAX_RESUMPTION_PSK_LENGTH))
goto err;
ret->master_key_length = tmpl;
@@ -350,7 +350,7 @@ SSL_SESSION *d2i_SSL_SESSION_ex(SSL_SESSION **a, const unsigned char **pp,
}
if (!ssl_session_memcpy(ret->sid_ctx, &ret->sid_ctx_length,
- as->session_id_context, SSL_MAX_SID_CTX_LENGTH))
+ as->session_id_context, SSL_MAX_SID_CTX_LENGTH))
goto err;
/* NB: this defaults to zero which is X509_V_OK */
@@ -391,7 +391,7 @@ SSL_SESSION *d2i_SSL_SESSION_ex(SSL_SESSION **a, const unsigned char **pp,
#ifndef OPENSSL_NO_SRP
if (!ssl_session_strndup(&ret->srp_username, as->srp_username))
goto err;
-#endif /* OPENSSL_NO_SRP */
+#endif /* OPENSSL_NO_SRP */
/* Flags defaults to zero which is fine */
ret->flags = (int32_t)as->flags;
ret->ext.max_early_data = as->max_early_data;
@@ -425,7 +425,7 @@ SSL_SESSION *d2i_SSL_SESSION_ex(SSL_SESSION **a, const unsigned char **pp,
*pp = p;
return ret;
- err:
+err:
M_ASN1_free_of(as, SSL_SESSION_ASN1);
if ((a == NULL) || (*a != ret))
SSL_SESSION_free(ret);