Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verifier accepts tag duplicates #13

Open
dlucredativ opened this issue Oct 12, 2020 · 2 comments
Open

Verifier accepts tag duplicates #13

dlucredativ opened this issue Oct 12, 2020 · 2 comments
Assignees

Comments

@dlucredativ
Copy link

https://tools.ietf.org/html/rfc6376#section-3.2 states:

Tags with duplicate names MUST NOT occur within a single tag-list;
if a tag name does occur more than once, the entire tag-list is invalid.

Suggestion:

diff --git a/lib/Mail/DKIM/KeyValueList.pm b/lib/Mail/DKIM/KeyValueList.pm
index 0d98574..1c33fe9 100644
--- a/lib/Mail/DKIM/KeyValueList.pm
+++ b/lib/Mail/DKIM/KeyValueList.pm
@@ -50 +50,6 @@ sub parse {
-        $self->{tags_by_name}->{$tagname} = $tag;
+        if (defined $self->{tags_by_name}->{$tagname}) {
+            # https://tools.ietf.org/html/rfc6376#section-3.2
+            croak 'reused tag name';
+        } else {
+            $self->{tags_by_name}->{$tagname} = $tag;
+        }
@marcbradshaw marcbradshaw self-assigned this Oct 26, 2020
@dlucredativ
Copy link
Author

Any ETA when this might be resolved? Will it help if I created a pull request?

@marcbradshaw
Copy link
Member

yes, please create a pull request. Thanks.

marcbradshaw added a commit that referenced this issue Jun 19, 2024
Add missing Author prerequisite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants