sign-req: Unique serial, check input serial is hexadecimal only

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2023-07-16 00:27:56 +01:00
parent a78babf835
commit 8ca55cfff0
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -2449,6 +2449,13 @@ Certificate created at:
# Check serial in db
check_serial_unique() {
[ "$1" ] || user_error "Serial number required!"
case "$1" in
(*[!1234567890abcdef]*)
user_error "Invalid serial number: '$1'"
;;
*)
: # ok
esac
[ "$2" = batch ] && internal_batch=1