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

59 add hmac support #93

Merged
merged 18 commits into from
Mar 31, 2022
Merged

59 add hmac support #93

merged 18 commits into from
Mar 31, 2022

Conversation

dccutrig
Copy link
Contributor

No description provided.

@dccutrig dccutrig linked an issue Mar 23, 2022 that may be closed by this pull request
@dccutrig dccutrig marked this pull request as ready for review March 24, 2022 12:54
@dccutrig dccutrig added the enhancement New feature or request label Mar 24, 2022
status = cryptography_if->cryptography_aead_encrypt(&p_new_enc_frame[index], // ciphertext output
(size_t)tf_payload_len, // length of data
(uint8_t*)(p_in_frame + TC_FRAME_HEADER_SIZE + segment_hdr_len), // plaintext input
(size_t)tf_payload_len, // in data length
NULL, // Using SA key reference, key is null
KEY_SIZE, // Length of key. TODO - why is this hard-coded?
ek_ring[sa_ptr->ekid].key_len, // Length of key derived from sa_ptr key_ref
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought we agreed in our weekly meetings that key length would be a function of the ECS/ACS algorithm enums being chosen -- EG, if ecs is CRYPTO_CIPHER_AES256_GCM, then that means we have a 32 byte key. (256/8 = 32). AES256 must have a 32 byte key, since we know that's the algorithm, we don't need to reference the ek_ring.

Copy link
Contributor

@IbraheemYSaleh IbraheemYSaleh Mar 25, 2022

Choose a reason for hiding this comment

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

<not duplicating my comments for all new key_len functions in this PR, this applies anywhere key_len is referenced>

Copy link
Contributor

@IbraheemYSaleh IbraheemYSaleh left a comment

Choose a reason for hiding this comment

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

Pretty good... Just a few changes required, see my comments.

@codecov-commenter
Copy link

Codecov Report

Merging #93 (2479ab3) into dev (f9b059a) will increase coverage by 1.07%.
The diff coverage is 95.45%.

@@            Coverage Diff             @@
##              dev      #93      +/-   ##
==========================================
+ Coverage   83.51%   84.59%   +1.07%     
==========================================
  Files          18       18              
  Lines        4229     4954     +725     
==========================================
+ Hits         3532     4191     +659     
- Misses        697      763      +66     
Impacted Files Coverage Δ
src/src_main/crypto_tm.c 4.95% <0.00%> (-0.05%) ⬇️
src/src_main/crypto_key_mgmt.c 32.73% <50.00%> (+0.20%) ⬆️
...gcrypt/cryptography_interface_libgcrypt.template.c 77.82% <63.38%> (-4.87%) ⬇️
src/src_main/crypto.c 96.12% <84.00%> (-0.92%) ⬇️
src/src_main/crypto_tc.c 89.18% <84.61%> (-2.49%) ⬇️
util/src_util/et_dt_validation.c 98.92% <100.00%> (+0.66%) ⬆️
util/src_util/ut_crypto.c 100.00% <100.00%> (ø)
util/src_util/ut_tc_process.c 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9b059a...2479ab3. Read the comment docs.

Copy link
Contributor

@IbraheemYSaleh IbraheemYSaleh left a comment

Choose a reason for hiding this comment

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

Very good 👍

@dccutrig dccutrig merged commit 56e3865 into dev Mar 31, 2022
@jlucas9 jlucas9 deleted the 59-add-hmac-support branch March 23, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add HMAC Support
3 participants