tls13_signature.c File Reference

RSA/DSA/ECDSA/EdDSA signature generation and verification. More...

#include "tls.h"
#include "tls_signature.h"
#include "tls_transcript_hash.h"
#include "tls_misc.h"
#include "tls13_signature.h"
#include "pkix/pem_import.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   TLS_TRACE_LEVEL
 

Functions

error_t tls13GenerateSignature (TlsContext *context, uint8_t *p, size_t *length)
 Digital signature generation (TLS 1.3) More...
 
error_t tls13GenerateRsaPssSignature (TlsContext *context, const uint8_t *message, size_t length, Tls13DigitalSignature *signature)
 RSA-PSS signature generation (TLS 1.3) More...
 
error_t tls13GenerateEcdsaSignature (TlsContext *context, const uint8_t *message, size_t length, Tls13DigitalSignature *signature)
 ECDSA signature generation (TLS 1.3) More...
 
error_t tls13GenerateEddsaSignature (TlsContext *context, const uint8_t *message, size_t length, Tls13DigitalSignature *signature)
 EdDSA signature generation (TLS 1.3) More...
 
error_t tls13VerifySignature (TlsContext *context, const uint8_t *p, size_t length)
 Digital signature verification (TLS 1.3) More...
 
error_t tls13VerifyRsaPssSignature (TlsContext *context, const uint8_t *message, size_t length, const Tls13DigitalSignature *signature)
 RSA-PSS signature verification (TLS 1.3) More...
 
error_t tls13VerifyEcdsaSignature (TlsContext *context, const uint8_t *message, size_t length, const Tls13DigitalSignature *signature)
 ECDSA signature verification (TLS 1.3) More...
 
error_t tls13VerifyEddsaSignature (TlsContext *context, const uint8_t *message, size_t length, const Tls13DigitalSignature *signature)
 EdDSA signature verification (TLS 1.3) More...
 

Detailed Description

RSA/DSA/ECDSA/EdDSA signature generation and verification.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2023 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
2.3.2

Definition in file tls13_signature.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   TLS_TRACE_LEVEL

Definition at line 32 of file tls13_signature.c.

Function Documentation

◆ tls13GenerateEcdsaSignature()

error_t tls13GenerateEcdsaSignature ( TlsContext context,
const uint8_t *  message,
size_t  length,
Tls13DigitalSignature signature 
)

ECDSA signature generation (TLS 1.3)

Parameters
[in]contextPointer to the TLS context
[in]messagePointer to the message to be signed
[in]lengthLength of the message, in bytes
[out]signatureBuffer where to store the digital signature
Returns
Error code

Definition at line 297 of file tls13_signature.c.

◆ tls13GenerateEddsaSignature()

error_t tls13GenerateEddsaSignature ( TlsContext context,
const uint8_t *  message,
size_t  length,
Tls13DigitalSignature signature 
)

EdDSA signature generation (TLS 1.3)

Parameters
[in]contextPointer to the TLS context
[in]messagePointer to the message to be signed
[in]lengthLength of the message, in bytes
[out]signatureBuffer where to store the digital signature
Returns
Error code

Definition at line 384 of file tls13_signature.c.

◆ tls13GenerateRsaPssSignature()

error_t tls13GenerateRsaPssSignature ( TlsContext context,
const uint8_t *  message,
size_t  length,
Tls13DigitalSignature signature 
)

RSA-PSS signature generation (TLS 1.3)

Parameters
[in]contextPointer to the TLS context
[in]messagePointer to the message to be signed
[in]lengthLength of the message, in bytes
[out]signatureBuffer where to store the digital signature
Returns
Error code

Definition at line 177 of file tls13_signature.c.

◆ tls13GenerateSignature()

error_t tls13GenerateSignature ( TlsContext context,
uint8_t *  p,
size_t *  length 
)

Digital signature generation (TLS 1.3)

Parameters
[in]contextPointer to the TLS context
[out]pBuffer where to store the digitally-signed element
[out]lengthLength of the digitally-signed element
Returns
Error code

Definition at line 55 of file tls13_signature.c.

◆ tls13VerifyEcdsaSignature()

error_t tls13VerifyEcdsaSignature ( TlsContext context,
const uint8_t *  message,
size_t  length,
const Tls13DigitalSignature signature 
)

ECDSA signature verification (TLS 1.3)

Parameters
[in]contextPointer to the TLS context
[in]messageMessage whose signature is to be verified
[in]lengthLength of the message, in bytes
[in]signaturePointer to the digital signature to be verified
Returns
Error code

Definition at line 681 of file tls13_signature.c.

◆ tls13VerifyEddsaSignature()

error_t tls13VerifyEddsaSignature ( TlsContext context,
const uint8_t *  message,
size_t  length,
const Tls13DigitalSignature signature 
)

EdDSA signature verification (TLS 1.3)

Parameters
[in]contextPointer to the TLS context
[in]messageMessage whose signature is to be verified
[in]lengthLength of the message, in bytes
[in]signaturePointer to the digital signature to be verified
Returns
Error code

Definition at line 767 of file tls13_signature.c.

◆ tls13VerifyRsaPssSignature()

error_t tls13VerifyRsaPssSignature ( TlsContext context,
const uint8_t *  message,
size_t  length,
const Tls13DigitalSignature signature 
)

RSA-PSS signature verification (TLS 1.3)

Parameters
[in]contextPointer to the TLS context
[in]messageMessage whose signature is to be verified
[in]lengthLength of the message, in bytes
[in]signaturePointer to the digital signature to be verified
Returns
Error code

Definition at line 578 of file tls13_signature.c.

◆ tls13VerifySignature()

error_t tls13VerifySignature ( TlsContext context,
const uint8_t *  p,
size_t  length 
)

Digital signature verification (TLS 1.3)

Parameters
[in]contextPointer to the TLS context
[in]pPointer to the digitally-signed element to be verified
[in]lengthLength of the digitally-signed element
Returns
Error code

Definition at line 451 of file tls13_signature.c.