File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 runtimeInputs = [
1010 clan-core . packages . ${ system } . clan-cli
1111 final . coreutils
12+ final . gitMinimal
1213 final . openssl
1314 ] ;
1415 text = ''
2728 key="$work/ca.key"
2829 serial="$work/ca.srl"
2930
31+ repo="'' ${CLAN_DIR:-$(git rev-parse --show-toplevel)}"
32+ root_crt="$repo/vars/shared/tls-ca/ca.crt/value"
33+ if [[ ! -s "$root_crt" ]]; then
34+ echo "missing root CA certificate: $root_crt" >&2
35+ exit 1
36+ fi
37+
3038 cleanup() {
3139 rm -f "$root_key"
3240 }
4351 openssl x509 \
4452 -req \
4553 -in "$csr" \
46- -CA vars/shared/tls-ca/ca.crt/value \
54+ -CA "$root_crt" \
4755 -CAkey "$root_key" \
4856 -CAserial "$serial" \
4957 -CAcreateserial \
5260 -sha256 \
5361 -extfile ${ intermediateCaExt }
5462
55- openssl verify -CAfile vars/shared/tls-ca/ca.crt/value "$crt"
63+ openssl verify -CAfile "$root_crt" "$crt"
5664
5765 clan vars set "$machine" tpm/ca.key < "$key"
5866 clan vars set "$machine" tpm/ca.crt < "$crt"
You can’t perform that action at this time.
0 commit comments