HttpMessageSigning icon indicating copy to clipboard operation
HttpMessageSigning copied to clipboard

Update To Published Standard RFC 9421

Open jwwisetyler opened this issue 2 years ago • 2 comments

Can you update the headers and conditions to match the published standard?

https://datatracker.ietf.org/doc/html/rfc9421

jwwisetyler avatar Mar 08 '24 20:03 jwwisetyler

Duplicate of #27

I am currently going through the RFC to gather the required changes to the libraries. Unfortunately, it's more than just updating the headers. Much more.

Unsure when I will have the time and resources to complete this. But it's an ongoing process.

DavidLievrouw avatar Mar 09 '24 08:03 DavidLievrouw

Analysis draft dump

First discovered noticeable changes, impacting this library:
    The (created), (expires) and (request-target) pseudo-headers have been replaced by specialty fields @request-target and @signature-params.
        The @signature-params specialty field should be part of the composed signature string. This includes the values of the legacy (created) and (expires) pseudo-headers.
    The signature used to be added to the Authorization-header of the request message. In the new spec, a combination of Signature and Signature-Input headers are used instead. This will allow for multiple signatures in the future.
    HTTP header fields must use LOWERCASED field names, not case-insensitive ones.
    Simplify combination of encryption and hashing algorithms to those from the draft, and specify them in the alg field:
        rsa-pss-sha512
        rsa-v1_5-sha256
        hmac-sha256
        ecdsa-p256-sha256

Work list
    Enable padding mode setting for RSA
    Write alg field correctly (no longer hs2019)
    HTTP header fields must use LOWERCASED field names, not case-insensitive ones
    Remove (expires) and (created) pseudo headers
    //Replace usage of (request-target) with @request-target derived component
    Create @signature-params specialty field and add it to the composed signature string
    Sign and verify using the Signature and Signature-Input headers
    Update conformance tests
    Add support for multiple signatures
    Add support for Dictionary Structured Fields
    Add support for List Prefixes

Definite work list:
	- Drop conformance and benchmark tests
	- Check canonincalization rules
		- Lowercased field names (because they are case-insensitive)
		- ASCII values, if not, use "bs" parameter
		- Multiple values in http header > ,-separated, and ordered in which they occur, distinct
		- Strip leading and trailing whitespace, line breaks are replaced with a single space
		- Fields cannot contain @. This is reserved for Derived components.
	- Update open issues in github with link to the RFC chapter
	- Predefined headers should be replaced by:
		(request-target): @request-target derived component
		(expires): expires signature parameter
		(created): created signature parameter
	- Append the "@signature-params" component to the canonicalized string
	
New features:
	- Use "bs" boolean flag for value binary serialization: https://datatracker.ietf.org/doc/html/rfc9421#name-binary-wrapped-http-fields
	- Support for trailer fields: https://datatracker.ietf.org/doc/html/rfc9421#name-trailer-fields
	- Add support for more derived components, next to @request-target: https://datatracker.ietf.org/doc/html/rfc9421#name-derived-components
	- Add support for more signature parameters, next to expires and created: https://datatracker.ietf.org/doc/html/rfc9421#name-signature-parameters
	

DavidLievrouw avatar Oct 01 '24 11:10 DavidLievrouw