Skip to content

Commit 7340f9f

Browse files
authored
Merge pull request #14 from devilbox/release-0.6
Release 0.6
2 parents b53d6d0 + 01f116f commit 7340f9f

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

.tests/test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ if [ "${USE_DOCKER}" = "1" ]; then
212212
ERROR=1
213213
fi
214214

215+
echo
215216
echo "[INFO] Validating openssl certificate with openssl client"
216217
if ! run "echo | openssl s_client -verify 8 -CAfile ${CA_CRT_PATH} | grep 'Verify return code: 0 (ok)'" "60"; then
217218
ERROR=1
@@ -233,6 +234,7 @@ else
233234
echo "[INFO] Ensuring OpenSSL server is not running"
234235
run "ps aux | grep openssl | grep s_server | awk '{print \$2}' | xargs kill 2>/dev/null || true"
235236

237+
echo
236238
echo "[INFO] Starting OpenSSL server"
237239
run "openssl s_server -key ${CERT_KEY_PATH} -cert ${CERT_CRT_PATH} -CAfile ${CA_CRT_PATH} -accept ${OPENSSL_PORT} -www >/dev/null &"
238240

bin/ca-gen

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ NAME="ca-gen"
99
# Generate default options
1010
DEF_KEYSIZE=2048
1111
DEF_DAYS=3650
12+
DEF_SIGN_SIGNATURE="sha256"
1213
# Subject default options
1314
DEF_COUNTRY=
1415
DEF_STATE=
@@ -23,7 +24,7 @@ DEF_VERBOSE=
2324

2425

2526
print_version() {
26-
echo "${NAME} v0.5"
27+
echo "${NAME} v0.6"
2728
}
2829
print_help() {
2930
echo "USAGE: ${NAME} -n CN [-kdcslouev] <keyfile> <crtfile>"
@@ -246,7 +247,7 @@ cmd="openssl req \
246247
-new \
247248
-x509 \
248249
-nodes \
249-
-sha256 \
250+
-${DEF_SIGN_SIGNATURE} \
250251
-days ${DEF_DAYS} \
251252
-key ${CA_KEY_FILE} \
252253
-subj '${SUBJECT}' \

bin/cert-gen

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ NAME="cert-gen"
88

99
# Generate default options
1010
DEF_KEYSIZE=2048
11-
DEF_DAYS=3650
11+
DEF_DAYS=825
12+
DEF_SIGN_SIGNATURE="sha256"
1213
# Subject default options
1314
DEF_COUNTRY=
1415
DEF_STATE=
@@ -27,7 +28,7 @@ DEF_VERBOSE=
2728

2829

2930
print_version() {
30-
echo "${NAME} v0.5"
31+
echo "${NAME} v0.6"
3132
}
3233
print_help() {
3334
echo "USAGE: ${NAME} -n CN [-kdcsloueav] <ca-key> <ca-crt> <key> <csr> <crt>"
@@ -251,6 +252,7 @@ ENDOFTEXT
251252
# Command
252253
cmd="openssl req \
253254
-newkey rsa:${DEF_KEYSIZE} \
255+
-${DEF_SIGN_SIGNATURE} \
254256
-nodes \
255257
-extensions v3_req \
256258
-config <(echo \"${OPENSSL_CONFIG}\") \
@@ -284,7 +286,7 @@ fi
284286
# shellcheck disable=SC1117
285287
cmd="openssl x509 \
286288
-req \
287-
-sha256 \
289+
-${DEF_SIGN_SIGNATURE} \
288290
-extensions v3_req \
289291
-extfile <(printf '[ req ]\nreq_extensions = v3_req\n[ v3_req ]\nsubjectAltName=${ALT_NAMES}\n') \
290292
-days ${DEF_DAYS} \

0 commit comments

Comments
 (0)