Skip to content

tag "c=" without "/..." == part with "/..." Optional part at rfc!  #10

@jetsam729

Description

@jetsam729
Warning: Undefined array key 1 Validator.php on line...
...
Fatal error: Uncaught TypeError: ...::canonicalizeBody(): Argument #2 ($style) must be of type string, null given, 

error at:
line 87: [$headerCA, $bodyCA] = explode('/', $dkimTags['c']);

rfc4871-dkimbase.html#dkim-sig-hdr
rfc6376#section-3.5
..If only one algorithm is named, that algorithm is used for the header and "simple" is used for the body. For example, "c=relaxed" is treated the same as "c=relaxed/simple"...

maybe add before as:
if(empty($dkimTags['c'])) $dkimTags['c'] = 'simple/simple';
if(!str_contains($dkimTags['c'],'/')) $dkimTags['c'] .='/simple';

example - email from phpclasses.org as "DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=phpclasses.org;..."
AND - tag maybe not exists :) :
rfc6376#section-3.5 :
c= Message canonicalization (plain-text; OPTIONAL, default is "simple/simple").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions