crypto.lua: sha256sum not available on OpenBSD/FreeBSD #10
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#10
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?
Problem
crypto.hash_file()andcrypto.hash_string()usesha256sumwhich is aGNU coreutils tool. It is not available on OpenBSD or FreeBSD by default.
On OpenBSD/FreeBSD the native command is
sha256(with-rflag forsha256sum-compatible output format).
Impact
steurjan verify-periodusescrypto.hash_fileandcrypto.hash_stringfor manifest integrity checks. Fails on OpenBSD without GNU coreutils port.
Fix
Detect available command once at module load time (cached):
sha256sumpresent -> use it (Linux/GNU)sha256 -r(OpenBSD/FreeBSD)hash_stringwrites content to a temp file to avoid shell pipedifferences between platforms.
Acceptance criteria
crypto.hash_file()works on Linux, OpenBSD, FreeBSDcrypto.hash_string()works on Linux, OpenBSD, FreeBSDRefs
Used by DAW/steurjan#19 (verify-period)