tls_transcript_hash.c File Reference

Transcript hash calculation. More...

#include <string.h>
#include "tls.h"
#include "tls_client.h"
#include "tls_key_material.h"
#include "tls_transcript_hash.h"
#include "tls13_key_material.h"
#include "ssl_misc.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   TLS_TRACE_LEVEL
 

Functions

error_t tlsInitTranscriptHash (TlsContext *context)
 Initialize handshake message hashing. More...
 
void tlsUpdateTranscriptHash (TlsContext *context, const void *data, size_t length)
 Update hash value with a handshake message. More...
 
error_t tlsFinalizeTranscriptHash (TlsContext *context, const HashAlgo *hash, const void *hashContext, const char_t *label, uint8_t *output)
 Finalize hash calculation from previous handshake messages. More...
 
void tlsFreeTranscriptHash (TlsContext *context)
 Release transcript hash context. More...
 
error_t tlsComputeVerifyData (TlsContext *context, TlsConnectionEnd entity, uint8_t *verifyData, size_t *verifyDataLen)
 Compute verify data from previous handshake messages. More...
 

Detailed Description

Transcript hash calculation.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneSSL Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file tls_transcript_hash.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   TLS_TRACE_LEVEL

Definition at line 30 of file tls_transcript_hash.c.

Function Documentation

◆ tlsComputeVerifyData()

error_t tlsComputeVerifyData ( TlsContext context,
TlsConnectionEnd  entity,
uint8_t *  verifyData,
size_t *  verifyDataLen 
)

Compute verify data from previous handshake messages.

Parameters
[in]contextPointer to the TLS context
[in]entitySpecifies whether the computation is performed at client or server side
[out]verifyDataPointer to the buffer where to store the verify data
[out]verifyDataLenLength of the verify data
Returns
Error code

Definition at line 383 of file tls_transcript_hash.c.

◆ tlsFinalizeTranscriptHash()

error_t tlsFinalizeTranscriptHash ( TlsContext context,
const HashAlgo hash,
const void *  hashContext,
const char_t label,
uint8_t *  output 
)

Finalize hash calculation from previous handshake messages.

Parameters
[in]contextPointer to the TLS context
[in]hashHash function used to digest the handshake messages
[in]hashContextPointer to the hash context
[in]labelNULL-terminated string
[out]outputBuffer where to store the resulting hash value
Returns
Error code

Definition at line 252 of file tls_transcript_hash.c.

◆ tlsFreeTranscriptHash()

void tlsFreeTranscriptHash ( TlsContext context)

Release transcript hash context.

Parameters
[in]contextPointer to the TLS context
Returns
Error code

Definition at line 340 of file tls_transcript_hash.c.

◆ tlsInitTranscriptHash()

error_t tlsInitTranscriptHash ( TlsContext context)

Initialize handshake message hashing.

Parameters
[in]contextPointer to the TLS context
Returns
Error code

Definition at line 52 of file tls_transcript_hash.c.

◆ tlsUpdateTranscriptHash()

void tlsUpdateTranscriptHash ( TlsContext context,
const void *  data,
size_t  length 
)

Update hash value with a handshake message.

Parameters
[in]contextPointer to the TLS context
[in]dataPointer to the handshake message being hashed
[in]lengthLength of the message

Definition at line 193 of file tls_transcript_hash.c.