You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The relevant code is in modules/rsasign-1.2.js:282
if(hSig.length!=this.n.bitLength()/4){DKIMVerifier.log.debug("rsasign: hSig has wrong length");return0;// throw new Error("rsasign Error: hSig has wrong length");}
That test is probably useless (it is not there in newer versions) and is wrong for odd keys, because bitLength() returns the exact length in bits, not the bytes. If the key, and hence the signature, happen to have the four most significant bits zero, hSig.length is the full byte length, while bitLength() / 2 would be an odd number.
An example key (gamma._domainkey.tana.it) is this:
The relevant code is in modules/rsasign-1.2.js:282
That test is probably useless (it is not there in newer versions) and is wrong for odd keys, because bitLength() returns the exact length in bits, not the bytes. If the key, and hence the signature, happen to have the four most significant bits zero,
hSig.length
is the full byte length, whilebitLength() / 2
would be an odd number.An example key (
gamma._domainkey.tana.it
) is this:That modulus is not 144*8=1152, but 1148 bits. DER breakdown can be checked here.
The text was updated successfully, but these errors were encountered: