tls_signature.h File Reference

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

#include "tls.h"

Go to the source code of this file.

Functions

error_t tlsSelectSignatureScheme (TlsContext *context, const TlsCertDesc *cert, const TlsSignHashAlgos *supportedSignAlgos)
 Select the algorithm to be used when generating digital signatures. More...
 
error_t tlsGenerateSignature (TlsContext *context, uint8_t *p, size_t *length)
 Digital signature generation(SSL 3.0, TLS 1.0 or TLS 1.1) More...
 
error_t tlsVerifySignature (TlsContext *context, const uint8_t *p, size_t length)
 Digital signature verification (SSL 3.0, TLS 1.0 and TLS 1.1) More...
 
error_t tls12GenerateSignature (TlsContext *context, uint8_t *p, size_t *length)
 Digital signature generation(TLS 1.2) More...
 
error_t tls12VerifySignature (TlsContext *context, const uint8_t *p, size_t length)
 Digital signature verification (TLS 1.2) More...
 
error_t tlsGenerateRsaSignature (const RsaPrivateKey *key, const uint8_t *digest, uint8_t *signature, size_t *signatureLen)
 Generate RSA signature (SSL 3.0, TLS 1.0 and TLS 1.1) More...
 
error_t tlsVerifyRsaSignature (const RsaPublicKey *key, const uint8_t *digest, const uint8_t *signature, size_t signatureLen)
 Verify RSA signature (SSL 3.0, TLS 1.0 and TLS 1.1) More...
 
error_t tlsGenerateDsaSignature (TlsContext *context, const uint8_t *digest, size_t digestLen, uint8_t *signature, size_t *signatureLen)
 Generate DSA signature. More...
 
error_t tlsVerifyDsaSignature (TlsContext *context, const uint8_t *digest, size_t digestLen, const uint8_t *signature, size_t signatureLen)
 Verify DSA signature. More...
 
error_t tlsGenerateEcdsaSignature (TlsContext *context, const uint8_t *digest, size_t digestLen, uint8_t *signature, size_t *signatureLen)
 Generate ECDSA signature. More...
 
error_t tlsVerifyEcdsaSignature (TlsContext *context, const uint8_t *digest, size_t digestLen, const uint8_t *signature, size_t signatureLen)
 Verify ECDSA signature. More...
 
error_t tlsGenerateEddsaSignature (TlsContext *context, const uint8_t *message, size_t messageLen, uint8_t *signature, size_t *signatureLen)
 Generate EdDSA signature. More...
 
error_t tlsVerifyEddsaSignature (TlsContext *context, const uint8_t *message, size_t messageLen, const uint8_t *signature, size_t signatureLen)
 Verify EdDSA signature. More...
 

Detailed Description

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

License

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

Copyright (C) 2010-2019 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.6

Definition in file tls_signature.h.

Function Documentation

◆ tls12GenerateSignature()

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

Digital signature generation(TLS 1.2)

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 580 of file tls_signature.c.

◆ tls12VerifySignature()

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

Digital signature verification (TLS 1.2)

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 761 of file tls_signature.c.

◆ tlsGenerateDsaSignature()

error_t tlsGenerateDsaSignature ( TlsContext context,
const uint8_t *  digest,
size_t  digestLen,
uint8_t *  signature,
size_t *  signatureLen 
)

Generate DSA signature.

Parameters
[in]contextPointer to the TLS context
[in]digestDigest of the message to be signed
[in]digestLenLength in octets of the digest
[out]signatureResulting signature
[out]signatureLenLength of the resulting signature
Returns
Error code

Definition at line 1188 of file tls_signature.c.

◆ tlsGenerateEcdsaSignature()

error_t tlsGenerateEcdsaSignature ( TlsContext context,
const uint8_t *  digest,
size_t  digestLen,
uint8_t *  signature,
size_t *  signatureLen 
)

Generate ECDSA signature.

Parameters
[in]contextPointer to the TLS context
[in]digestDigest of the message to be signed
[in]digestLenLength in octets of the digest
[out]signatureResulting signature
[out]signatureLenLength of the resulting signature
Returns
Error code

Definition at line 1291 of file tls_signature.c.

◆ tlsGenerateEddsaSignature()

error_t tlsGenerateEddsaSignature ( TlsContext context,
const uint8_t *  message,
size_t  messageLen,
uint8_t *  signature,
size_t *  signatureLen 
)

Generate EdDSA signature.

Parameters
[in]contextPointer to the TLS context
[in]messagePointer to the message to be signed
[in]messageLenLength of the message, in bytes
[out]signatureResulting signature
[out]signatureLenLength of the resulting signature
Returns
Error code

Definition at line 1442 of file tls_signature.c.

◆ tlsGenerateRsaSignature()

error_t tlsGenerateRsaSignature ( const RsaPrivateKey key,
const uint8_t *  digest,
uint8_t *  signature,
size_t *  signatureLen 
)

Generate RSA signature (SSL 3.0, TLS 1.0 and TLS 1.1)

Parameters
[in]keySigner's RSA private key
[in]digestDigest of the message to be signed
[out]signatureResulting signature
[out]signatureLenLength of the resulting signature
Returns
Error code

Definition at line 934 of file tls_signature.c.

◆ tlsGenerateSignature()

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

Digital signature generation(SSL 3.0, TLS 1.0 or TLS 1.1)

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 359 of file tls_signature.c.

◆ tlsSelectSignatureScheme()

error_t tlsSelectSignatureScheme ( TlsContext context,
const TlsCertDesc cert,
const TlsSignHashAlgos supportedSignAlgos 
)

Select the algorithm to be used when generating digital signatures.

Parameters
[in]contextPointer to the TLS context
[in]certEnd entity certificate
[in]supportedSignAlgosList of supported signature/hash algorithm pairs
Returns
Error code

Definition at line 60 of file tls_signature.c.

◆ tlsVerifyDsaSignature()

error_t tlsVerifyDsaSignature ( TlsContext context,
const uint8_t *  digest,
size_t  digestLen,
const uint8_t *  signature,
size_t  signatureLen 
)

Verify DSA signature.

Parameters
[in]contextPointer to the TLS context
[in]digestDigest of the message whose signature is to be verified
[in]digestLenLength in octets of the digest
[in]signatureSignature to be verified
[in]signatureLenLength of the signature to be verified
Returns
Error code

Definition at line 1243 of file tls_signature.c.

◆ tlsVerifyEcdsaSignature()

error_t tlsVerifyEcdsaSignature ( TlsContext context,
const uint8_t *  digest,
size_t  digestLen,
const uint8_t *  signature,
size_t  signatureLen 
)

Verify ECDSA signature.

Parameters
[in]contextPointer to the TLS context
[in]digestDigest of the message whose signature is to be verified
[in]digestLenLength in octets of the digest
[in]signatureSignature to be verified
[in]signatureLenLength of the signature to be verified
Returns
Error code

Definition at line 1374 of file tls_signature.c.

◆ tlsVerifyEddsaSignature()

error_t tlsVerifyEddsaSignature ( TlsContext context,
const uint8_t *  message,
size_t  messageLen,
const uint8_t *  signature,
size_t  signatureLen 
)

Verify EdDSA signature.

Parameters
[in]contextPointer to the TLS context
[in]messageMessage whose signature is to be verified
[in]messageLenLength of the message, in bytes
[in]signatureSignature to be verified
[in]signatureLenLength of the signature to be verified
Returns
Error code

Definition at line 1561 of file tls_signature.c.

◆ tlsVerifyRsaSignature()

error_t tlsVerifyRsaSignature ( const RsaPublicKey key,
const uint8_t *  digest,
const uint8_t *  signature,
size_t  signatureLen 
)

Verify RSA signature (SSL 3.0, TLS 1.0 and TLS 1.1)

Parameters
[in]keySigner's RSA public key
[in]digestDigest of the message whose signature is to be verified
[in]signatureSignature to be verified
[in]signatureLenLength of the signature to be verified
Returns
Error code

Definition at line 1053 of file tls_signature.c.

◆ tlsVerifySignature()

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

Digital signature verification (SSL 3.0, TLS 1.0 and TLS 1.1)

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 478 of file tls_signature.c.