#!/bin/sh
-# Copyright 2018 - 2022 Paul Hänsch
+# Copyright 2018 - 2022, 2026 Paul Hänsch
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
server_key(){
IDFILE="${IDFILE:-${_DATA:-.}/serverkey}"
if [ "$(stat -c %s "$IDFILE")" -ne 512 ] || ! cat "$IDFILE"; then
- dd count=1 bs=512 if=/dev/urandom \
+ tr -d \\0 </dev/urandom \
+ | dd count=1 bs=512 \
| tee "$IDFILE"
fi 2>&-
}
new_session(){
local sid time sig
- debug "Setting up new session"
+ # debug "Setting up new session"
sid="$(randomid)"
time=$(( $_DATE + $SESSION_TIMEOUT ))
sig="$(session_mac "$sid" "$time")"