axtls provides a way to implement "SSH" style key verification by checking the SHA-1 hash of the (entire) certificate. Unfortunately this checksum changes every time the certificate is changed, e.g. because it's getting renewed (usually every year, for letsencrypt.org even every 3 months) or extended with new domains.
For HTTP public key pinning (RFC7469), the SHA-256 hash of the Subject
Public Key Info (which usually only changes when the public key
changes) is used rather than the SHA-1 hash of the entire certificate. This makes a lot of sense for use with axtls, too. This pull request introduces a new function ssl_match_spki_sha256() that allows an API consumer to verify the SHA-256 hash of the SPKI. The existing SHA-1 certificate hash verification support is left untouched so there should not be any compatibility concerns.
axtls provides a way to implement "SSH" style key verification by checking the SHA-1 hash of the (entire) certificate. Unfortunately this checksum changes every time the certificate is changed, e.g. because it's getting renewed (usually every year, for letsencrypt.org even every 3 months) or extended with new domains.
For HTTP public key pinning (RFC7469), the SHA-256 hash of the Subject Public Key Info (which usually only changes when the public key changes) is used rather than the SHA-1 hash of the entire certificate. This makes a lot of sense for use with axtls, too. This pull request introduces a new function ssl_match_spki_sha256() that allows an API consumer to verify the SHA-256 hash of the SPKI. The existing SHA-1 certificate hash verification support is left untouched so there should not be any compatibility concerns.