OpenDKIM icon indicating copy to clipboard operation
OpenDKIM copied to clipboard

Per request sign algorithm (A part of issue #6)

Open futatuki opened this issue 1 year ago • 7 comments
trafficstars

This extends KeyTable value fields as the issue comment https://github.com/trusteddomainproject/OpenDKIM/issues/6#issuecomment-393036103 said.

With an extended KeyTable and lua script, I could confirm that the milter can both rsa-sha256 and ed25519-sha256 signature.

(Edit) Now, this PR depends on PR #207 for conversion table for dkim_alg_t and dkim_canon_t (but not including those commits).

futatuki avatar Mar 01 '24 12:03 futatuki

I didn't care opendkim-testkey, so I'll update it later.

futatuki avatar Mar 01 '24 12:03 futatuki

I didn't care opendkim-testkey, so I'll update it later.

Done. However library function dkim_test_key() does not support ed25519 keys, so opendkim-testkey still reports "keys do not match" at ed25519 key entry.

futatuki avatar Mar 03 '24 03:03 futatuki

As commit message of commit 2fb3b18 is wrong, rebase latest 2 commit.

futatuki avatar Mar 03 '24 04:03 futatuki

As commit message of commit 2fb3b18 is wrong, rebase latest 2 commit.

Done.

futatuki avatar Mar 03 '24 04:03 futatuki

I separated lookup functions and tables from opendkim/opendkim.c into opendkim/opendkim-const.c because opendkim/opendkim-testkey.c uses conversion from sign algorithm string to sign algorithm internal code.

However I found it has been provided in libopendkim/dkim-tables.h, so I'll remove last 2 commit and I'll use dkim_name_to_code in opendkim/opendkim-testkey.c.

I think lookups for dkimf_canon and dkimf_sign in opendkim/opendkim.c should also use dkim_name_to_code or dkim_code_to_name with canonicalizations table and algorithms, but it is another issue.

futatuki avatar Mar 09 '24 18:03 futatuki

It turned out that all nametable s which should be used with dkim_code_to_name() or dkim_name_to_code() are all not exposed outside of the library because of their name, while the functions are exposed.

I believe those nametables are worth exposed. Also, there is no bad side effect if names of the tables are renamed by adding prefix 'dkim_', because all macros in the tables are already exposed.

futatuki avatar Mar 10 '24 03:03 futatuki

Now, it uses lookup table for dkim_alg_t and dkim_canon_t in libopendkim (by using PR #207).

futatuki avatar Mar 23 '24 08:03 futatuki