Skip to content
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
2 changes: 1 addition & 1 deletion kernel-src/dkms.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME="wolfguard"
PACKAGE_VERSION="1.1.20260319"
PACKAGE_VERSION="1.1.20260409"
AUTOINSTALL=yes

BUILT_MODULE_NAME="wolfguard"
Expand Down
2 changes: 1 addition & 1 deletion kernel-src/version.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#ifndef WOLFGUARD_VERSION
#define WOLFGUARD_VERSION "1.1.20260319"
#define WOLFGUARD_VERSION "1.1.20260409"
#endif
10 changes: 5 additions & 5 deletions kernel-src/wolfcrypt_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static __always_inline bool wc_AesGcm_crypt_sg_inplace(struct scatterlist *src,
struct sg_mapping_iter miter;
int miter_needs_stop = 0;
unsigned int flags;
int sl;
ssize_t sl;
Aes *aes = NULL;
byte full_nonce[AES_IV_SIZE];

Expand Down Expand Up @@ -249,8 +249,8 @@ static __always_inline bool wc_AesGcm_crypt_sg_inplace(struct scatterlist *src,
sg_miter_start(&miter, src, sg_nents(src), flags);
miter_needs_stop = 1;

for (sl = src_len; sl > 0 && sg_miter_next(&miter); sl -= miter.length) {
size_t length = min_t(size_t, sl, miter.length);
for (sl = (ssize_t)src_len; sl > 0 && sg_miter_next(&miter); sl -= miter.length) {
size_t length = min_t(size_t, sl, (ssize_t)miter.length);

if (isDecrypt)
ret = wc_AesGcmDecryptUpdate(aes, miter.addr, miter.addr,
Expand All @@ -271,9 +271,9 @@ static __always_inline bool wc_AesGcm_crypt_sg_inplace(struct scatterlist *src,
*/
if (sl <= -WC_AES_BLOCK_SIZE) {
if (isDecrypt)
ret = wc_AesGcmDecryptFinal(aes, miter.addr + miter.length + sl, WC_AES_BLOCK_SIZE);
ret = wc_AesGcmDecryptFinal(aes, miter.addr + (ssize_t)miter.length + sl, WC_AES_BLOCK_SIZE);
else
ret = wc_AesGcmEncryptFinal(aes, miter.addr + miter.length + sl, WC_AES_BLOCK_SIZE);
ret = wc_AesGcmEncryptFinal(aes, miter.addr + (ssize_t)miter.length + sl, WC_AES_BLOCK_SIZE);
if (ret < 0) {
WC_DEBUG_PR_CODEPOINT();
goto out;
Expand Down
2 changes: 1 addition & 1 deletion user-src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static inline bool parse_endpoint(struct sockaddr *endpoint, const char *value)
#ifdef EAI_NODATA
ret == EAI_NODATA ||
#endif
(retries == 0) || (retries == 1)) {
(retries == 0)) {
free(mutable);
fprintf(stderr, "%s: `%s'\n", ret == EAI_SYSTEM ? strerror(errno) : gai_strerror(ret), value);
return false;
Expand Down
13 changes: 9 additions & 4 deletions user-src/show.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,20 @@ static size_t pretty_time(char *buf, const size_t len, unsigned long long left)

if (years)
offset += snprintf(buf + offset, len - offset, "%s%llu " TERMINAL_FG_CYAN "year%s" TERMINAL_RESET, offset ? ", " : "", years, years == 1 ? "" : "s");
if (days)
if (days && (offset < len))
offset += snprintf(buf + offset, len - offset, "%s%llu " TERMINAL_FG_CYAN "day%s" TERMINAL_RESET, offset ? ", " : "", days, days == 1 ? "" : "s");
if (hours)
if (hours && (offset < len))
offset += snprintf(buf + offset, len - offset, "%s%llu " TERMINAL_FG_CYAN "hour%s" TERMINAL_RESET, offset ? ", " : "", hours, hours == 1 ? "" : "s");
if (minutes)
if (minutes && (offset < len))
offset += snprintf(buf + offset, len - offset, "%s%llu " TERMINAL_FG_CYAN "minute%s" TERMINAL_RESET, offset ? ", " : "", minutes, minutes == 1 ? "" : "s");
if (seconds)
if (seconds && (offset < len))
offset += snprintf(buf + offset, len - offset, "%s%llu " TERMINAL_FG_CYAN "second%s" TERMINAL_RESET, offset ? ", " : "", seconds, seconds == 1 ? "" : "s");

if (offset >= len) {
buf[len-1] = '\0';
offset = len -1;
}

return offset;
}

Expand Down