Fixed space-related issues in export-pkcs
This commit is contained in:
parent
0527385231
commit
74739844b4
@ -1390,11 +1390,12 @@ Run easyrsa without commands for usage and command help."
|
|||||||
done
|
done
|
||||||
|
|
||||||
pkcs_opts=
|
pkcs_opts=
|
||||||
|
pkcs_certfile_path=
|
||||||
if [ $want_ca ]; then
|
if [ $want_ca ]; then
|
||||||
verify_file x509 "$crt_ca" || die "\
|
verify_file x509 "$crt_ca" || die "\
|
||||||
Unable to include CA cert in the $pkcs_type output (missing file, or use noca option.)
|
Unable to include CA cert in the $pkcs_type output (missing file, or use noca option.)
|
||||||
Missing file expected at: $crt_ca"
|
Missing file expected at: $crt_ca"
|
||||||
pkcs_opts="$pkcs_opts -certfile $crt_ca"
|
pkcs_certfile_path="$crt_ca"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# input files must exist
|
# input files must exist
|
||||||
@ -1412,13 +1413,14 @@ Unable to export p12 for short name '$short_name' without the key
|
|||||||
(if you want a p12 without the private key, use nokey option.)
|
(if you want a p12 without the private key, use nokey option.)
|
||||||
Missing key expected at: $key_in"
|
Missing key expected at: $key_in"
|
||||||
else
|
else
|
||||||
pkcs_opts="$pkcs_opts -nokeys"
|
pkcs_opts="-nokeys"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# export the p12:
|
# export the p12:
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
easyrsa_openssl pkcs12 -in "$crt_in" -inkey "$key_in" -export \
|
easyrsa_openssl pkcs12 -in "$crt_in" -inkey "$key_in" -export \
|
||||||
-out "$pkcs_out" $pkcs_opts ${EASYRSA_PASSIN:+-passin "$EASYRSA_PASSIN"} ${EASYRSA_PASSOUT:+-passout "$EASYRSA_PASSOUT"} || die "\
|
-out "$pkcs_out" $pkcs_opts ${pkcs_certfile_path:+-certfile "$pkcs_certfile_path"} \
|
||||||
|
${EASYRSA_PASSIN:+-passin "$EASYRSA_PASSIN"} ${EASYRSA_PASSOUT:+-passout "$EASYRSA_PASSOUT"} || die "\
|
||||||
Export of p12 failed: see above for related openssl errors."
|
Export of p12 failed: see above for related openssl errors."
|
||||||
;;
|
;;
|
||||||
p7)
|
p7)
|
||||||
@ -1427,14 +1429,13 @@ Export of p12 failed: see above for related openssl errors."
|
|||||||
# export the p7:
|
# export the p7:
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
easyrsa_openssl crl2pkcs7 -nocrl -certfile "$crt_in" \
|
easyrsa_openssl crl2pkcs7 -nocrl -certfile "$crt_in" \
|
||||||
-out "$pkcs_out" $pkcs_opts ${EASYRSA_PASSIN:+-passin "$EASYRSA_PASSIN"} ${EASYRSA_PASSOUT:+-passout "$EASYRSA_PASSOUT"} || die "\
|
-out "$pkcs_out" ${pkcs_certfile_path:+-certfile "$pkcs_certfile_path"} \
|
||||||
|
${EASYRSA_PASSIN:+-passin "$EASYRSA_PASSIN"} ${EASYRSA_PASSOUT:+-passout "$EASYRSA_PASSOUT"} || die "\
|
||||||
Export of p7 failed: see above for related openssl errors."
|
Export of p7 failed: see above for related openssl errors."
|
||||||
;;
|
;;
|
||||||
p8)
|
p8)
|
||||||
if [ -z $want_pass ]; then
|
if [ -z $want_pass ]; then
|
||||||
pkcs_opts="-nocrypt"
|
pkcs_opts="-nocrypt"
|
||||||
else
|
|
||||||
pkcs_opts=""
|
|
||||||
fi
|
fi
|
||||||
pkcs_out="$EASYRSA_PKI/private/$short_name.p8"
|
pkcs_out="$EASYRSA_PKI/private/$short_name.p8"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user