assignment 3 enunciado

This commit is contained in:
vasco
2026-05-11 11:38:51 +01:00
parent b03a6987f4
commit 66534a1648
57 changed files with 0 additions and 8 deletions

View File

@@ -0,0 +1,15 @@
#!/bin/bash
depth=$1
if [ "$depth" -eq 0 ]; then
if [ -n "$tls_serial_0" ]; then
# é preciso converter o serial para hexadecimal porque o openssl espera em hex
hex_serial=$(printf '%x' "$tls_serial_0")
status=$(openssl ocsp -issuer /etc/openvpn/server/ca.crt -serial "0x$hex_serial" -url http://10.60.0.1:8888 -CAfile /etc/openvpn/server/ca.crt 2>/dev/null)
if echo "$status" | grep -q "good"; then
exit 0 # sucesso
fi
exit 1 # revogado ou não encontrado
fi
exit 1
fi