Commit 4c8ca27
committed
fix(ci): export the password vars before keytool reads them
Key generation aborted with:
Cannot find environment variable: STORE_PW
`keytool -storepass:env NAME` reads NAME out of keytool's own environment, so
a plain shell variable is invisible to it. The script set STORE_PW and KEY_PW
as shell variables and only exported them after the `fi` — after the
generation branch had already run. They are now exported in both branches
before any keytool call.
Passing the password as `-storepass` instead would have been simpler and
wrong: arguments are visible in the process list, which is exactly what
`:env` exists to avoid.
Reproduced the failure and verified the fix with a disposable 2048-bit key in
a temp directory — generation, SHA-256 extraction and the 64-hex validation
all succeed with the export in place; the throwaway key was deleted.
Also lets the reuse branch accept a blank key password to mean "same as the
store password", which is the common single-password keystore layout.1 parent ac25d78 commit 4c8ca27
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
0 commit comments