QSC Post Quantum Cryptographic Library 1.3.0.0 (C1)
A post quantum secure library written in Ansi C
Loading...
Searching...
No Matches
tlstypes.h File Reference

Public TLS type definitions. More...

#include "qsccommon.h"

Go to the source code of this file.

Typedefs

typedef enum qsc_tls_hash_algorithm qsc_tls_hash_algorithm
typedef enum qsc_tls_record_content_type qsc_tls_record_content_type
typedef enum qsc_tls_alert_description qsc_tls_alert_description
typedef enum qsc_tls_cipher_suite qsc_tls_cipher_suite
typedef enum qsc_tls_extension_type qsc_tls_extension_type
typedef enum qsc_tls_named_group qsc_tls_named_group
typedef enum qsc_tls_signature_scheme qsc_tls_signature_scheme
typedef enum qsc_tls_handshake_type qsc_tls_handshake_type
typedef enum qsc_tls_psk_key_exchange_mode qsc_tls_psk_key_exchange_mode
typedef enum qsc_tls_certificate_type qsc_tls_certificate_type
typedef enum qsc_tls_alert_level qsc_tls_alert_level

Enumerations

enum  qsc_tls_hash_algorithm { qsc_tls_hash_none = 0 , qsc_tls_hash_sha256 = 1 , qsc_tls_hash_sha384 = 2 , qsc_tls_hash_sha512 = 3 }
 Identifies the transcript and HKDF hash algorithm associated with a TLS cipher suite. More...
enum  qsc_tls_record_content_type {
  qsc_tls_record_content_invalid = 0 , qsc_tls_record_content_change_cipher_spec = 20 , qsc_tls_record_content_alert = 21 , qsc_tls_record_content_handshake = 22 ,
  qsc_tls_record_content_application_data = 23
}
 TLS record content-type codes. More...
enum  qsc_tls_alert_description {
  qsc_tls_alert_close_notify = 0 , qsc_tls_alert_unexpected_message = 10 , qsc_tls_alert_bad_record_mac = 20 , qsc_tls_alert_record_overflow = 22 ,
  qsc_tls_alert_handshake_failure = 40 , qsc_tls_alert_bad_certificate = 42 , qsc_tls_alert_unsupported_certificate = 43 , qsc_tls_alert_certificate_revoked = 44 ,
  qsc_tls_alert_certificate_expired = 45 , qsc_tls_alert_certificate_unknown = 46 , qsc_tls_alert_illegal_parameter = 47 , qsc_tls_alert_unknown_ca = 48 ,
  qsc_tls_alert_access_denied = 49 , qsc_tls_alert_decode_error = 50 , qsc_tls_alert_decrypt_error = 51 , qsc_tls_alert_protocol_version = 70 ,
  qsc_tls_alert_insufficient_security = 71 , qsc_tls_alert_internal_error = 80 , qsc_tls_alert_inappropriate_fallback = 86 , qsc_tls_alert_user_canceled = 90 ,
  qsc_tls_alert_missing_extension = 109 , qsc_tls_alert_unsupported_extension = 110 , qsc_tls_alert_unrecognized_name = 112 , qsc_tls_alert_bad_certificate_status_response = 113 ,
  qsc_tls_alert_unknown_psk_identity = 115 , qsc_tls_alert_certificate_required = 116 , qsc_tls_alert_no_application_protocol = 120
}
 TLS alert description codes carried in Alert protocol messages. More...
enum  qsc_tls_cipher_suite { qsc_tls_cipher_suite_none = 0 , qsc_tls_cipher_suite_tls_aes_128_gcm_sha256 = 0x1301 , qsc_tls_cipher_suite_tls_aes_256_gcm_sha384 = 0x1302 , qsc_tls_cipher_suite_tls_chacha20_poly1305_sha256 = 0x1303 }
 TLS 1.3 cipher-suite identifiers. More...
enum  qsc_tls_extension_type {
  qsc_tls_extension_server_name = 0 , qsc_tls_extension_pre_shared_key = 41 , qsc_tls_extension_early_data = 42 , qsc_tls_extension_supported_groups = 10 ,
  qsc_tls_extension_signature_algorithms = 13 , qsc_tls_extension_application_layer_protocol_negotiation = 16 , qsc_tls_extension_supported_versions = 43 , qsc_tls_extension_psk_key_exchange_modes = 45 ,
  qsc_tls_extension_signature_algorithms_cert = 50 , qsc_tls_extension_key_share = 51
}
 TLS extension type identifiers. More...
enum  qsc_tls_named_group {
  qsc_tls_group_none = 0 , qsc_tls_group_secp256r1 = 0x0017 , qsc_tls_group_secp384r1 = 0x0018 , qsc_tls_group_secp521r1 = 0x0019 ,
  qsc_tls_group_x25519 = 0x001D , qsc_tls_group_x448 = 0x001E , qsc_tls_group_mlkem512 = 0x0200 , qsc_tls_group_mlkem768 = 0x0201 ,
  qsc_tls_group_mlkem1024 = 0x0202 , qsc_tls_group_x25519_mlkem768 = 0x11EC , qsc_tls_group_secp256r1_mlkem768 = 0x11EB , qsc_tls_group_secp384r1_mlkem1024 = 0x11ED
}
 TLS named-group identifiers for classical, ML-KEM, and hybrid key exchange groups. More...
enum  qsc_tls_signature_scheme {
  qsc_tls_sig_none = 0 , qsc_tls_sig_ecdsa_secp256r1_sha256 = 0x0403 , qsc_tls_sig_ecdsa_secp384r1_sha384 = 0x0503 , qsc_tls_sig_ed25519 = 0x0807 ,
  qsc_tls_sig_mldsa44 = 0x0904 , qsc_tls_sig_mldsa65 = 0x0905 , qsc_tls_sig_mldsa87 = 0x0906
}
 TLS signature-scheme identifiers. More...
enum  qsc_tls_handshake_type {
  qsc_tls_handshake_type_hello_request = 0 , qsc_tls_handshake_type_client_hello = 1 , qsc_tls_handshake_type_server_hello = 2 , qsc_tls_handshake_type_new_session_ticket = 4 ,
  qsc_tls_handshake_type_end_of_early_data = 5 , qsc_tls_handshake_type_encrypted_extensions = 8 , qsc_tls_handshake_type_certificate = 11 , qsc_tls_handshake_type_certificate_request = 13 ,
  qsc_tls_handshake_type_certificate_verify = 15 , qsc_tls_handshake_type_finished = 20 , qsc_tls_handshake_type_key_update = 24 , qsc_tls_handshake_type_message_hash = 254
}
 TLS 1.3 handshake message type codes per RFC 8446 section B.3. More...
enum  qsc_tls_psk_key_exchange_mode { qsc_tls_psk_key_exchange_mode_psk_ke = 0 , qsc_tls_psk_key_exchange_mode_psk_dhe_ke = 1 }
 psk_key_exchange_modes values per RFC 8446 section 4.2.9. More...
enum  qsc_tls_certificate_type { qsc_tls_certificate_type_x509 = 0 , qsc_tls_certificate_type_raw_public_key = 2 }
 Certificate type values per RFC 7250 and RFC 8446. More...
enum  qsc_tls_alert_level { qsc_tls_alert_level_warning = 1 , qsc_tls_alert_level_fatal = 2 }
 TLS alert severity level per RFC 8446 section 6. In TLS 1.3 the level is advisory; all alerts except close_notify and user_canceled are effectively fatal. More...

Detailed Description

Public TLS type definitions.

Enumeration Type Documentation

◆ qsc_tls_alert_description

TLS alert description codes carried in Alert protocol messages.

Enumerator
qsc_tls_alert_close_notify 

The connection is being closed normally.

qsc_tls_alert_unexpected_message 

An unexpected protocol message was received.

qsc_tls_alert_bad_record_mac 

Record authentication failed.

qsc_tls_alert_record_overflow 

A record exceeded the permitted size.

qsc_tls_alert_handshake_failure 

The handshake could not be completed successfully.

qsc_tls_alert_bad_certificate 

The certificate was corrupt or unacceptable.

qsc_tls_alert_unsupported_certificate 

The certificate type is unsupported.

qsc_tls_alert_certificate_revoked 

The certificate has been revoked.

qsc_tls_alert_certificate_expired 

The certificate has expired.

qsc_tls_alert_certificate_unknown 

The certificate could not be validated for an unspecified reason.

qsc_tls_alert_illegal_parameter 

A field contained an invalid value.

qsc_tls_alert_unknown_ca 

The certificate issuer is not trusted.

qsc_tls_alert_access_denied 

Access was denied after successful authentication.

qsc_tls_alert_decode_error 

A message could not be decoded correctly.

qsc_tls_alert_decrypt_error 

A cryptographic operation failed.

qsc_tls_alert_protocol_version 

The negotiated protocol version is unsupported.

qsc_tls_alert_insufficient_security 

The peer requires stronger security parameters.

qsc_tls_alert_internal_error 

An internal implementation error occurred.

qsc_tls_alert_inappropriate_fallback 

An inappropriate version fallback was detected.

qsc_tls_alert_user_canceled 

The operation was canceled by the peer.

qsc_tls_alert_missing_extension 

A required extension was missing.

qsc_tls_alert_unsupported_extension 

An unsupported extension was received.

qsc_tls_alert_unrecognized_name 

The requested server name was not recognized.

qsc_tls_alert_bad_certificate_status_response 

The certificate status response was invalid.

qsc_tls_alert_unknown_psk_identity 

The offered PSK identity was not recognized.

qsc_tls_alert_certificate_required 

A certificate was required but not provided.

qsc_tls_alert_no_application_protocol 

No mutually supported application protocol was found.

◆ qsc_tls_alert_level

TLS alert severity level per RFC 8446 section 6. In TLS 1.3 the level is advisory; all alerts except close_notify and user_canceled are effectively fatal.

Enumerator
qsc_tls_alert_level_warning 

Warning-level alert.

qsc_tls_alert_level_fatal 

Fatal-level alert.

◆ qsc_tls_certificate_type

Certificate type values per RFC 7250 and RFC 8446.

Enumerator
qsc_tls_certificate_type_x509 

X.509 certificate.

qsc_tls_certificate_type_raw_public_key 

Raw public key.

◆ qsc_tls_cipher_suite

TLS 1.3 cipher-suite identifiers.

Enumerator
qsc_tls_cipher_suite_none 

No cipher suite selected.

qsc_tls_cipher_suite_tls_aes_128_gcm_sha256 

TLS_AES_128_GCM_SHA256.

qsc_tls_cipher_suite_tls_aes_256_gcm_sha384 

TLS_AES_256_GCM_SHA384.

qsc_tls_cipher_suite_tls_chacha20_poly1305_sha256 

TLS_CHACHA20_POLY1305_SHA256.

◆ qsc_tls_extension_type

TLS extension type identifiers.

Enumerator
qsc_tls_extension_server_name 

server_name extension.

qsc_tls_extension_pre_shared_key 

pre_shared_key extension.

qsc_tls_extension_early_data 

early_data extension.

qsc_tls_extension_supported_groups 

supported_groups extension.

qsc_tls_extension_signature_algorithms 

signature_algorithms extension.

qsc_tls_extension_application_layer_protocol_negotiation 

application_layer_protocol_negotiation extension.

qsc_tls_extension_supported_versions 

supported_versions extension.

qsc_tls_extension_psk_key_exchange_modes 

psk_key_exchange_modes extension.

qsc_tls_extension_signature_algorithms_cert 

signature_algorithms_cert extension.

qsc_tls_extension_key_share 

key_share extension.

◆ qsc_tls_handshake_type

TLS 1.3 handshake message type codes per RFC 8446 section B.3.

Enumerator
qsc_tls_handshake_type_hello_request 

Legacy TLS 1.2 value, not used in TLS 1.3.

qsc_tls_handshake_type_client_hello 

ClientHello.

qsc_tls_handshake_type_server_hello 

ServerHello, including HelloRetryRequest with magic random.

qsc_tls_handshake_type_new_session_ticket 

NewSessionTicket.

qsc_tls_handshake_type_end_of_early_data 

EndOfEarlyData.

qsc_tls_handshake_type_encrypted_extensions 

EncryptedExtensions.

qsc_tls_handshake_type_certificate 

Certificate.

qsc_tls_handshake_type_certificate_request 

CertificateRequest.

qsc_tls_handshake_type_certificate_verify 

CertificateVerify.

qsc_tls_handshake_type_finished 

Finished.

qsc_tls_handshake_type_key_update 

KeyUpdate.

qsc_tls_handshake_type_message_hash 

Synthetic message_hash for the HelloRetryRequest transcript transform.

◆ qsc_tls_hash_algorithm

Identifies the transcript and HKDF hash algorithm associated with a TLS cipher suite.

Enumerator
qsc_tls_hash_none 

No hash algorithm selected.

qsc_tls_hash_sha256 

SHA-256 hash algorithm.

qsc_tls_hash_sha384 

SHA-384 hash algorithm.

qsc_tls_hash_sha512 

SHA-512 hash algorithm.

◆ qsc_tls_named_group

TLS named-group identifiers for classical, ML-KEM, and hybrid key exchange groups.

Enumerator
qsc_tls_group_none 

No group selected.

qsc_tls_group_secp256r1 

secp256r1 named group.

qsc_tls_group_secp384r1 

secp384r1 named group.

qsc_tls_group_secp521r1 

secp521r1 named group.

qsc_tls_group_x25519 

x25519 named group.

qsc_tls_group_x448 

x448 named group.

qsc_tls_group_mlkem512 

ML-KEM-512 named group.

qsc_tls_group_mlkem768 

ML-KEM-768 named group.

qsc_tls_group_mlkem1024 

ML-KEM-1024 named group.

qsc_tls_group_x25519_mlkem768 

Hybrid x25519 plus ML-KEM-768 named group.

qsc_tls_group_secp256r1_mlkem768 

Hybrid secp256r1 plus ML-KEM-768 named group.

qsc_tls_group_secp384r1_mlkem1024 

Hybrid secp384r1 plus ML-KEM-1024 named group.

◆ qsc_tls_psk_key_exchange_mode

psk_key_exchange_modes values per RFC 8446 section 4.2.9.

Enumerator
qsc_tls_psk_key_exchange_mode_psk_ke 

PSK-only key exchange.

qsc_tls_psk_key_exchange_mode_psk_dhe_ke 

PSK with (EC)DHE key exchange.

◆ qsc_tls_record_content_type

TLS record content-type codes.

Enumerator
qsc_tls_record_content_invalid 

Invalid or unset content type.

qsc_tls_record_content_change_cipher_spec 

ChangeCipherSpec record type.

qsc_tls_record_content_alert 

Alert record type.

qsc_tls_record_content_handshake 

Handshake record type.

qsc_tls_record_content_application_data 

ApplicationData record type.

◆ qsc_tls_signature_scheme

TLS signature-scheme identifiers.

Enumerator
qsc_tls_sig_none 

No signature scheme selected.

qsc_tls_sig_ecdsa_secp256r1_sha256 

ecdsa_secp256r1_sha256 signature scheme.

qsc_tls_sig_ecdsa_secp384r1_sha384 

ecdsa_secp384r1_sha384 signature scheme.

qsc_tls_sig_ed25519 

ed25519 signature scheme.

qsc_tls_sig_mldsa44 

ML-DSA-44 signature scheme.

qsc_tls_sig_mldsa65 

ML-DSA-65 signature scheme.

qsc_tls_sig_mldsa87 

ML-DSA-87 signature scheme.