Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select cipher suites (2.) #148

Merged
merged 3 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ typedef uint8_t dtls_cipher_index_t;
/** Index in cipher parameter table for NULL cipher */
#define DTLS_CIPHER_INDEX_NULL 0

/** Maximum number of cipher suites */
#define DTLS_MAX_CIPHER_SUITES 4

typedef enum { AES128=0
} dtls_crypto_alg;
Expand Down Expand Up @@ -128,6 +130,18 @@ typedef struct {

struct netq_t;

/**
* Set of user parameters used by the handshake.
*/
typedef struct dtls_user_parameters_t {
/**
* The list of cipher suites.
* The list must be terminated by TLS_NULL_WITH_NULL_NULL.
*/
dtls_cipher_t cipher_suites[DTLS_MAX_CIPHER_SUITES + 1];
unsigned int force_extended_master_secret:1; /** force extended master secret extension (RFC7627) */
} dtls_user_parameters_t;

typedef struct {
union {
struct random_t {
Expand All @@ -141,6 +155,7 @@ typedef struct {
dtls_hs_state_t hs_state; /**< handshake protocol status */

dtls_compression_t compression; /**< compression method */
dtls_user_parameters_t user_parameters; /**< user parameters */
dtls_cipher_index_t cipher_index; /**< internal index for cipher_suite_params, DTLS_CIPHER_INDEX_NULL for TLS_NULL_WITH_NULL_NULL */
unsigned int do_client_auth:1;
unsigned int extended_master_secret:1;
Expand Down
Loading