Skip to content

Commit

Permalink
fixed regex pattern for SDID, Selector and local_part
Browse files Browse the repository at this point in the history
  • Loading branch information
lieser committed May 30, 2013
1 parent 932ebb8 commit e374f0d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.3.2 [2013-05-30]
------------------
- fixed regex pattern for SDID, Selector and local_part

0.3.1 [2013-05-30]
------------------
- fixed problem with CompactHeader addon
Expand Down
8 changes: 4 additions & 4 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.3.0 (29 May 2013)
* version: 0.3.2 (30 May 2013)
*
* Copyright (c) 2013 Philippe Lieser
*
Expand Down Expand Up @@ -386,7 +386,7 @@ DKIM_Verifier.DKIMVerifier = (function() {
// Pattern for sub-domain as specified in Section 4.1.2 of RFC 5321
var sub_domain = "(?:[A-z0-9](?:[A-z0-9-]*[A-z0-9])?)";
var domain_name = "(?:"+sub_domain+"(?:\\."+sub_domain+")+)";
var SDIDTag = DKIMSignatureHeader.match(tag_spec("d",sub_domain+"(?:."+sub_domain+")*"));
var SDIDTag = DKIMSignatureHeader.match(tag_spec("d",domain_name));
if (SDIDTag === null) {
throw new DKIM_SigError(DKIM_STRINGS.DKIM_SIGERROR_MISSING_D);
}
Expand Down Expand Up @@ -472,7 +472,7 @@ DKIM_Verifier.DKIMVerifier = (function() {
*/

var atext = "[A-z0-9!#$%&'*+/=?^_`{|}~-]";
var local_part = "(?:"+atext+"(?:."+atext+")*)";
var local_part = "(?:"+atext+"(?:\\."+atext+")*)";
var sig_i_tag = local_part+"?@"+domain_name;
var AUIDTag = DKIMSignatureHeader.match(tag_spec("i", sig_i_tag));
if (AUIDTag === null) {
Expand Down Expand Up @@ -504,7 +504,7 @@ DKIM_Verifier.DKIMVerifier = (function() {
}

// get selector subdividing the namespace for the "d=" (domain) tag (plain-text; REQUIRED)
var SelectorTag = DKIMSignatureHeader.match(tag_spec("s", sub_domain+"(?:."+sub_domain+")*"));
var SelectorTag = DKIMSignatureHeader.match(tag_spec("s", sub_domain+"(?:\\."+sub_domain+")*"));
if (SelectorTag === null) {
throw new DKIM_SigError(DKIM_STRINGS.DKIM_SIGERROR_MISSING_S);
}
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.3.1</em:version>
<em:version>0.3.2</em:version>

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

Expand Down

0 comments on commit e374f0d

Please sign in to comment.