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

Add CCM cipher suite variants (2.) #147

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ dtls_security_parameters_t *dtls_security_new(void)

memset(security, 0, sizeof(*security));

security->cipher = TLS_NULL_WITH_NULL_NULL;
security->cipher_index = DTLS_CIPHER_INDEX_NULL;
security->compression = TLS_COMPRESSION_NULL;

return security;
Expand Down
10 changes: 8 additions & 2 deletions crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
#define DTLS_MASTER_SECRET_LENGTH 48
#define DTLS_RANDOM_LENGTH 32

/** Type of index in cipher parameter table */
typedef uint8_t dtls_cipher_index_t;
/** Index in cipher parameter table for NULL cipher */
#define DTLS_CIPHER_INDEX_NULL 0


typedef enum { AES128=0
} dtls_crypto_alg;

Expand Down Expand Up @@ -105,7 +111,7 @@ typedef struct {
typedef struct {
dtls_compression_t compression; /**< compression method */

dtls_cipher_t cipher; /**< cipher type */
dtls_cipher_index_t cipher_index; /**< internal index for cipher_suite_params, DTLS_CIPHER_INDEX_NULL for TLS_NULL_WITH_NULL_NULL */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line length is > 80 chars, breaking coding style. This occurs in multiple places

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we break / split line for macros as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be my preference. @obgm ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That requires a lot of concentration to only fix the lines, which are altered with this PR.
Otherwise we get a couple of "format only changes", which I would prefer to have them done "once applying a formatter" (issue #143).
We will see ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, if I continue to try to fix the format only of the changed lines, that will eat up hour and hour. it requires also to spend a lot of time in the follow-up commits, though these are changing the same lines and cherrypick ends up in also a lot of conflicts.
My proposal: I go "fast over it". And the final "format" approach is then done with #143.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. Tidy up things with clang-format etc. at a later stage.

uint16_t epoch; /**< counter for cipher state changes*/
uint64_t rseq; /**< sequence number of last record sent */

Expand Down Expand Up @@ -135,7 +141,7 @@ typedef struct {
dtls_hs_state_t hs_state; /**< handshake protocol status */

dtls_compression_t compression; /**< compression method */
dtls_cipher_t cipher; /**< cipher type */
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;
union {
Expand Down
Loading