Bug fixes

Fixed a bug in retrieving the DKIM public key:

For some emails, the DKIM public key is not stored TXT record directly in `selector._domainkey.domain`, but instead points to a CNAME.

For example, when retrieving the DKIM public key for the following domain: `protonmail._domainkey.proton.me`, we first need to resolve the CNAME for this domain: `protonmail.domainkey.drfeyjwh4gwlal4e2rhajsytrp6auv2nhenecpzigu7muak6lw6ya.domains.proton.ch`.

However, using the "dns" npm package, the CNAME cannot be resolved.

With this update, all DNS resolutions will be performed using google DNS-over-HTTPS (DoH).
This commit is contained in:
Jayden
2024-08-21 11:19:44 +08:00
committed by shreyas-londhe
parent 95e92c74be
commit 9b0d51d7d2

View File

@@ -301,11 +301,7 @@ export const getPublicKey = async (
resolver: (...args: [name: string, type: string]) => Promise<any>
) => {
minBitLength = minBitLength || 1024;
if (!IS_BROWSER) {
resolver = resolver || require("dns").promises.resolve;
} else {
resolver = resolveDNSHTTP;
}
resolver = resolveDNSHTTP;
let list = await resolver(name, "TXT");
let rr =