fully functioning wolfcrypt shim for Wireguard#1
Open
Conversation
dgarske
suggested changes
Oct 26, 2020
dgarske
left a comment
There was a problem hiding this comment.
Mostly formatting issues otherwise looks good. Please double check the negative poly at 159.
| if ((ret = wc_Poly1305_EncodeSizes(&aead->poly, ad_len, src_len)) < 0) | ||
| goto out; | ||
|
|
||
| if (sl <= -POLY1305_DIGEST_SIZE) { |
There was a problem hiding this comment.
Is the negative on -POLY1305_DIGEST_SIZE intentional? If so can you add comment explaining?
src/wolfcrypto_shim.h
Outdated
| } | ||
|
|
||
| #define curve25519(...) curve25519_wolfshim(__VA_ARGS__) | ||
| static inline bool curve25519(uint8_t mypublic[static CURVE25519_KEY_SIZE], const uint8_t secret[static CURVE25519_KEY_SIZE], const uint8_t basepoint[static CURVE25519_KEY_SIZE]) { |
src/wolfcrypto_shim.h
Outdated
| const u8 *ad, const size_t ad_len, | ||
| const u64 nonce, | ||
| const u8 key[CHACHA20POLY1305_KEY_SIZE]) { | ||
| word64 inIV[2] = { 0, cpu_to_le64(nonce) }; |
…ha20Poly1305_{Encrypt,Decrypt}.
…already for wireguard-tools); tweak compat.h to allow building on kernels >= 5.6.0.
…ncluded by include/linux/filter.h since kernel 5.8.
4ea28b7 to
77123b3
Compare
…ors for tstats->rx_packets and ->rx_bytes.
…): for kernel >= 6.2, use get_random_u32_below() rather than prandom_u32_max().
…ude/crypto/utils.h too.
…linux commit d457a0e329.
…nl_dumpit_info(), when kernel >= 6.6.0.
…c.c at >=d9f7629296 can be compiled in the wireguard module.
…formats (likely necessitated by gcc-13).
… for compatibility with kernel 6.13.
…vmalloc_node prototype on earlier kernels (e.g. 5.14).
ffebc79 to
34baab6
Compare
…r if wc_ChaCha20Poly1305_Final() returns nonzero. fixes new -Wunused-result.
…e[_sync] on kernel >= 6.15, per linux 326534e837 and 8fa7292fee.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.