Skip to content

Commit

Permalink
Add script for updating the trusted roots that are accepted by Dodo.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Stradling committed Jun 28, 2017
1 parent eca65ed commit fa73297
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions update_dodo_crt.sh
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

0 comments on commit fa73297

Please sign in to comment.