-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script for updating the trusted roots that are accepted by Dodo.
- Loading branch information
Rob Stradling
committed
Jun 28, 2017
1 parent
eca65ed
commit fa73297
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
cd crt/dodo | ||
|
||
# Get a list (from the crt.sh DB) of the SHA-256 hashes of all of the roots that are currently trusted (but not for the server authentication trust purpose)by the Apple, Microsoft and Mozilla root programs. These roots will be accepted by Dodo but not by Mammoth or Sabre. | ||
# TODO: Expose this data via https://crt.sh/ | ||
psql -c "\COPY (SELECT upper(encode(digest(c.CERTIFICATE, 'sha256'), 'hex')) FROM root_trust_purpose rtp, ca_certificate cac, certificate c WHERE rtp.TRUST_CONTEXT_ID IN (1, 5, 12) AND rtp.CERTIFICATE_ID = cac.CERTIFICATE_ID AND cac.CERTIFICATE_ID = c.ID GROUP BY digest(c.CERTIFICATE, 'sha256') HAVING min(TRUST_PURPOSE_ID) > 1 ORDER BY min(get_ca_name_attribute(cac.CA_ID))) TO '__roots_sha256_not_serverauth__.sh'" | ||
|
||
sed -i "s/^/wget --content-disposition \"https:\/\/crt.sh\/?d=/g" __roots_sha256_not_serverauth__.sh | ||
sed -i "s/$/\"/g" __roots_sha256_not_serverauth__.sh | ||
chmod 755 __roots_sha256_not_serverauth__.sh | ||
./__roots_sha256_not_serverauth__.sh | ||
rm __roots_sha256_not_serverauth__.sh |