Skip to content

Commit

Permalink
DNS exception now caught
Browse files Browse the repository at this point in the history
  • Loading branch information
lieser committed May 22, 2013
1 parent 37f8f47 commit f47de93
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
0.2.1pre1 [2013-05-22]
0.2.1 [2013-05-22]
------------------
- query method was parsed wrong
- last header field was parsed wrong
- DNS exception now caught

0.2 [2013-05-16]
------------------
Expand Down
28 changes: 20 additions & 8 deletions chrome/content/dkim.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Verifies the DKIM-Signatures as specified in RFC 6376
* http://tools.ietf.org/html/rfc6376
*
* version: 0.2.1pre1 (22 May 2013)
* version: 0.2.1 (22 May 2013)
*
* Copyright (c) 2013 Philippe Lieser
*
Expand Down Expand Up @@ -998,14 +998,26 @@ var that = {
* the message to be verified is passed as the 2. parameter
*/
dnsCallback : function (dnsResult, msg) {
DKIM_Debug("DNS result: " + dnsResult);
if (dnsResult === null) {
throw new DKIM_SigError(DKIM_STRINGS.DKIM_SIGERROR_KEYFAIL);
try {
DKIM_Debug("DNS result: " + dnsResult);
if (dnsResult === null) {
throw new DKIM_SigError(DKIM_STRINGS.DKIM_SIGERROR_KEYFAIL);
}

msg.keyQueryResult = dnsResult[0];

verifySignaturePart2(msg);
} catch(e) {
var dkimMsgHdrRes = document.getElementById("dkim_verifier_msgHdrRes");
if (e instanceof DKIM_SigError) {
dkimMsgHdrRes.value = DKIM_STRINGS.PERMFAIL + " (" + e.message + ")";
} else {
dkimMsgHdrRes.value = "Internal Error";
}
if (prefDKIMDebug) {
Components.utils.reportError(e+"\n"+e.stack);
}
}

msg.keyQueryResult = dnsResult[0];

verifySignaturePart2(msg);
}
};
return that;
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<em:name>DKIM Verifier</em:name>
<em:description>Verifies the DKIM-Signature of an e-mail.</em:description>

<em:version>0.2.1pre1</em:version>
<em:version>0.2.1</em:version>

<em:creator>Philippe Lieser</em:creator>

Expand Down

0 comments on commit f47de93

Please sign in to comment.