-
Notifications
You must be signed in to change notification settings - Fork 1
fully functioning wolfcrypt shim for Wireguard #1
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
base: master
Are you sure you want to change the base?
Conversation
dgarske
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read-ability... 80 chars?
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) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent
…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.
No description provided.