Skip to content

Commit 6deb11d

Browse files
More extensive Oracle key and cert verification
Add verification logic both before and inside the Solaris VM to ensure we are actually copying valid cert and keys. Signed-off-by: michael-grunder <michael.grunder@gmail.com>
1 parent 4e3cccc commit 6deb11d

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,23 +100,33 @@ jobs:
100100
- name: Transfer Oracle Studio certificates
101101
run: |
102102
set -e
103-
printf '%s\n' "$PKG_ORACLE_CERT" \
104-
> pkg.oracle.com.certificate.pem
105-
printf '%s\n' "$PKG_ORACLE_KEY" \
106-
> pkg.oracle.com.key.pem
103+
printf '%s\n' "$PKG_ORACLE_CERT" > pkg.oracle.com.certificate.pem
104+
printf '%s\n' "$PKG_ORACLE_KEY" > pkg.oracle.com.key.pem
105+
106+
- name: Verify cert and key secrets
107+
run: |
108+
set -euo pipefail
109+
openssl x509 -noout -in pkg.oracle.com.certificate.pem >/dev/null
110+
openssl pkey -noout -in pkg.oracle.com.key.pem >/dev/null
107111
108112
- name: Build on Solaris
109113
uses: vmactions/solaris-vm@v1.1.8
110114
with:
111115
usesh: true
112116
prepare: |
113-
set -e
117+
set -euo pipefail
114118
115119
cp "$GITHUB_WORKSPACE/pkg.oracle.com.key.pem" \
116120
/root/pkg.oracle.com.key.pem
117121
cp "$GITHUB_WORKSPACE/pkg.oracle.com.certificate.pem" \
118122
/root/pkg.oracle.com.certificate.pem
119123
124+
# Double-check the cert and key files
125+
/usr/bin/openssl x509 \
126+
-noout -in /root/pkg.oracle.com.certificate.pem >/dev/null
127+
/usr/bin/openssl pkey \
128+
-noout -in /root/pkg.oracle.com.key.pem >/dev/null
129+
120130
sudo pkg set-publisher \
121131
-k /root/pkg.oracle.com.key.pem \
122132
-c /root/pkg.oracle.com.certificate.pem \
@@ -132,6 +142,7 @@ jobs:
132142
export PATH
133143
134144
gmake USE_THREADS=1 USE_TLS=1 -j"$(psrinfo -p)"
145+
135146
build-cross:
136147
name: Cross-compile ${{ matrix.config.target }}
137148
runs-on: ubuntu-22.04

0 commit comments

Comments
 (0)