fix: crypto.lua -- assert(), wrong temp prefix, io.* direct #27
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-common#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problems
Header path outdated:
src/lib/src/daw/lua/common/crypto.luaassert()used for argument validation instead of returning nil, err.Violates DAW error handling standard. All three functions affected.
Hardcoded project name in temp file:
/tmp/steurjan_hash_must be
/tmp/daw_hash_(hmac_* functions already use correct prefix).io.popenandio.openused directly -- should migrate to sys.runand fs.write_file long-term. Not blocking but tracked here.
HMAC key written to temp file and read via
$(cat ...)shellsubstitution. Key is briefly on filesystem. Check if openssl supports
-passin file:<path>to avoid shell substitution.Also: openssl dependency for HMAC is justified (no standard alternative for keyed-hash), but should be documented prominently in the header, separate from the sha256 section.
assert() replaced with nil,err. Hardcoded /tmp/steurjan_hash_* and /tmp/daw_hmac_* replaced with daw.common.fs.temp (mktemp, no custom prefix). io.open/io.popen replaced with daw.common.fs.file / daw.common.sys. Also added: shell-quoting for the user-supplied path in hash_file() (was previously interpolated unquoted into the shell command). Covered in test_crypto.lua / test_crypto_hmac.lua.