HTTP A. Backman, Ed. Internet-Draft Amazon Intended status: Standards Track J. Richer Expires:21 May16 September 2021 Bespoke Engineering M. Sporny Digital Bazaar17 November 202015 March 2021 Signing HTTP Messagesdraft-ietf-httpbis-message-signatures-01draft-ietf-httpbis-message-signatures-02 Abstract This document describes a mechanism for creating, encoding, and verifying digital signatures or message authentication codes over content within an HTTP message. This mechanism supports use cases where the full HTTP message may not be known to the signer, and where the message may be transformed (e.g., by intermediaries) before reaching the verifier. Note to Readers _RFC EDITOR: please remove this section before publication_This work was originally basedDiscussion of this draft takes place ondraft-cavage-http-signatures-12, but has since diverged from it, to reflect discussion since adoption bythe HTTPWorking Group. In particular, it addresses issues that have been identified, and adds features to support new use cases. Itworking group mailing list (ietf-http-wg@w3.org), which isa work-in-progressarchived at https://lists.w3.org/Archives/Public/ietf-http-wg/ (https://lists.w3.org/Archives/Public/ietf-http-wg/). Working Group information can be found at https://httpwg.org/ (https://httpwg.org/); source code andnot yet suitableissues list fordeployment.this draft can be found at https://github.com/httpwg/http-extensions/labels/ signatures (https://github.com/httpwg/http-extensions/labels/ signatures). Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on21 May16 September 2021. Copyright Notice Copyright (c)20202021 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . .43 1.1. Requirements Discussion . . . . . . . . . . . . . . . . .54 1.2. HTTP Message Transformations . . . . . . . . . . . . . . 5 1.3. Safe Transformations . . . . . . . . . . . . . . . . . .65 1.4. Conventions and Terminology . . . . . . . . . . . . . . . 6 1.5. Application of HTTP Message Signatures . . . . . . . . . 7 2. Identifying and Canonicalizing Content . . . . . . . . . . . 8 2.1. HTTPHeader FieldsHeaders . . . . . . . . . . . . . . . . . . . . . . 8 2.1.1. Canonicalized Structured HTTP Headers . . . . . . . . 9 2.1.2. Canonicalization Examples . . . . . . . . . . . . . . 9 2.2. Dictionary Structured Field Members . . . . . . . . . . .910 2.2.1. Canonicalization Examples . . . . . . . . . . . . . . 10 2.3. List Prefixes . . . . . . . . . . . . . . . . . . . . . .1011 2.3.1. Canonicalization Examples . . . . . . . . . . . . . .10 2.4. Signature Creation Time . . . . . . . . . . . . . . . . .112.5. Signature Expiration Time2.4. Specialty Content Fields . . . . . . . . . . . . . . . .11 2.6.12 2.4.1. Request TargetEndpoint. . . . . . . . . . . . . . . . . . . 12 2.4.2. Signature Parameters . .11 2.6.1. Canonicalization Examples. . . . . . . . . . . . . .1213 3. HTTP Message Signatures . . . . . . . . . . . . . . . . . . .1214 3.1. Signature Metadata . . . . . . . . . . . . . . . . . . .1314 3.2. Creating a Signature . . . . . . . . . . . . . . . . . .1316 3.2.1. Choose and Set Signature Metadata Properties . . . .1416 3.2.2. Create the Signature Input . . . . . . . . . . . . .1618 3.2.3. Sign the Signature Input . . . . . . . . . . . . . .1719 3.3. Verifying a Signature . . . . . . . . . . . . . . . . . .1719 3.3.1. Enforcing Application Requirements . . . . . . . . .1820 4. Including a Message Signature in a Message . . . . . . . . .1921 4.1. The 'Signature-Input' HTTP Header . . . . . . . . . . . .19 4.1.1. Metadata Parameters . . . . . . . . . . . . . . . . . 1921 4.2. The 'Signature' HTTP Header . . . . . . . . . . . . . . .2021 4.3. Examples . . . . . . . . . . . . . . . . . . . . . . . .2022 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . .2123 5.1. HTTP Signature Algorithms Registry . . . . . . . . . . .2123 5.1.1. Registration Template . . . . . . . . . . . . . . . .2123 5.1.2. Initial Contents . . . . . . . . . . . . . . . . . .2224 5.2. HTTP Signature Metadata Parameters Registry . . . . . . .2425 5.2.1. Registration Template . . . . . . . . . . . . . . . .2425 5.2.2. Initial Contents . . . . . . . . . . . . . . . . . .24 6. Security Considerations25 5.3. HTTP Signature Specialty Content Identifiers Registry . . 26 5.3.1. Registration Template . . . . . . . . . . . . . . . . 26 5.3.2. Initial Contents .25 7. References. . . . . . . . . . . . . . . . . 26 6. Security Considerations . . . . . . . .25 7.1. Normative References. . . . . . . . . . . 27 7. References . . . . . . .25 7.2. Informative References. . . . . . . . . . . . . . . . .26 Appendix A. Examples. 27 7.1. Normative References . . . . . . . . . . . . . . . . . . 27 7.2. Informative References . . .27 A.1. Example Keys. . . . . . . . . . . . . .. . . . . . . . 27 A.1.1. Example Key RSA test . . . . . . . . . . . . . . . . 27 A.2. Example keyId Values . . . . . . . . . . . . . . . . . . 28 A.3. Test Cases . . . . . . . . . . . . . . . . . . . . . . . 29 A.3.1. Signature Generation . . . . . . .28 Appendix A. Detecting HTTP Message Signatures . . . . . . . . . 29A.3.2. Signature Verification . . . . . . . . . . . . . . . 32Appendix B.Topics for Working Group Discussion . . . . . . . . 34 B.1. Issues . . . . . . .Examples . . . . . . . . . . . . . . . . . .34 B.1.1. Confusing guidance on algorithm and key identification. . . . 29 B.1. Example Keys . . . . . . . . . . . . . . .35 B.1.2. Lack of definition of keyId hurts interoperability.35 B.1.3. Algorithm Registry duplicates work of JWA. . . . . .35 B.1.4. Algorithm Registry should not be initialized with deprecated entries29 B.1.1. Example Key RSA test . . . . . . . . . . . . . . . . 29 B.2. Example keyid Values .36 B.1.5. No percent-encoding normalization of path/query. . .36 B.1.6. Misleading name for headers parameter. . . . . . . .36 B.1.7. Changes to whitespace in header field values break verification. . . . . . 30 B.3. Test Cases . . . . . . . . . . . . . .36 B.1.8. Multiple Set-Cookie headers are not well supported.36 B.1.9. Covered Content list is not signed. . . . . . . . 31 B.3.1. Signature Generation .37 B.1.10. Algorithm is not signed. . . . . . . . . . . . . . .37 B.1.11.31 B.3.2. Signature Verificationkey identifier is not signed . . . . . . 37 B.1.12. Max values, precision for Integer String and Decimal String not defined. . . . . . . . . . . . . . . 34 Acknowledgements . .37 B.1.13. keyId parameter value could break list syntax. . . .37 B.1.14. Creation Time and Expiration Time do not allow for clock skew. . . . . . . . . . . . . . . . . . 36 Document History . . .37 B.1.15. Should require lowercased header field names as identifiers. . . . . . . . . . . . . . . . . . . . . 37B.1.16. Reconcile Date header and Creation Time . . .Authors' Addresses . . . .38 B.1.17. Remove algorithm-specific rules for content identifiers. . . . . . . . . . . . . . . . . . .. . 38 B.1.18. Add guidance for signing compressed headers . . . . . 38 B.1.19. Transformations to Via header field value break verification . . . . . . . . . . . . . . . . . . . . 38 B.1.20. Case changes to case-insensitive header field values break verification . . . . . . . . . . . . . . . . . 38 B.1.21. Need more examples for Signature header . . . . . . . 38 B.1.22. Expiration not needed . . . . . . . . . . . . . . . . 39 B.2. Features . . . . . . . . . . . . . . . . . . . . . . . . 39 B.2.1. Define more content identifiers . . . . . . . . . . . 39 B.2.2. Multiple signature support . . . . . . . . . . . . . 39 B.2.3. Support for incremental signing of header field value list items . . . . . . . . . . . . . . . . . . . . . 40 B.2.4. Support expected authority changes . . . . . . . . . 40 B.2.5. Support for signing specific cookies . . . . . . . . 40 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 41 Document History . . . . . . . . . . . . . . . . . . . . . . . . 41 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43 1. Introduction Message integrity and authenticity are important security properties that are critical to the secure operation of many HTTP applications. Application developers typically rely on the transport layer to provide these properties, by operating their application over [TLS]. However, TLS only guarantees these properties over a single TLS connection, and the path between client and application may be composed of multiple independent TLS connections (for example, if the application is hosted behind a TLS-terminating gateway or if the client is behind a TLS Inspection appliance). In such cases, TLS cannot guarantee end-to-end message integrity or authenticity between the client and application. Additionally, some operating environments present obstacles that make it impractical to use TLS, or to use features necessary to provide message authenticity. Furthermore, some applications require the binding of an application- level key to the HTTP message, separate from any TLS certificates in use. Consequently, while TLS can meet message integrity and authenticity needs for many HTTP-based applications, it is not a universal solution. This document defines a mechanism for providing end-to-end integrity and authenticity for content within an HTTP message. The mechanism allows applications to create digital signatures or message authentication codes (MACs) over only that content within the message that is meaningful and appropriate for the application. Strict canonicalization rules ensure that the verifier can verify the signature even if the message has been transformed in any of the many ways permitted by HTTP. The mechanism described in this document consists of three parts: * A common nomenclature and canonicalization rule set for the different protocol elements and other content within HTTP messages. * Algorithms for generating and verifying signatures over HTTP message content using this nomenclature and rule set. * A mechanism for attaching a signature and related metadata to an HTTP message. 1.1. Requirements Discussion HTTP permits and sometimes requires intermediaries to transform messages in a variety of ways. This may result in a recipient receiving a message that is not bitwise equivalent to the message that was oringally sent. In such a case, the recipient will be unable to verify a signature over the raw bytes of the sender's HTTP message, as verifying digital signatures or MACs requires both signer and verifier to have the exact same signed content. Since the raw bytes of the message cannot be relied upon as signed content, the signer and verifier must derive the signed content from their respective versions of the message, via a mechanism that is resilient to safe changes that do not alter the meaning of the message. For a variety of reasons, it is impractical to strictly define what constitutes a safe change versus an unsafe one. Applications use HTTP in a wide variety of ways, and may disagree on whether a particular piece of information in a message (e.g., the body, or the "Date" header field) is relevant. Thus a general purpose solution must provide signers with some degree of control over which message content is signed. HTTP applications may be running in environments that do not provide complete access to or control over HTTP messages (such as a web browser's JavaScript environment), or may be using libraries that abstract away the details of the protocol (such as the Java HTTPClient library (https://openjdk.java.net/groups/net/httpclient/ intro.html)). These applications need to be able to generate and verify signatures despite incomplete knowledge of the HTTP message. 1.2. HTTP Message Transformations As mentioned earlier, HTTP explicitly permits and in some cases requires implementations to transform messages in a variety of ways. Implementations are required to tolerate many of these transformations. What follows is a non-normative and non-exhaustive list of transformations that may occur under HTTP, provided as context: * Re-ordering of header fields with different header field names ([MESSAGING], Section 3.2.2). * Combination of header fields with the same field name ([MESSAGING], Section 3.2.2). * Removal of header fields listed in the "Connection" header field ([MESSAGING], Section 6.1). * Addition of header fields that indicate control options ([MESSAGING], Section 6.1). * Addition or removal of a transfer coding ([MESSAGING], Section 5.7.2). * Addition of header fields such as "Via" ([MESSAGING], Section 5.7.1) and "Forwarded" ([RFC7239], Section 4). 1.3. Safe Transformations Based on the definition of HTTP and the requirements described above, we can identify certain types of transformations that should not prevent signature verification, even when performed on content covered by the signature. The following list describes those transformations: * Combination of header fields with the same field name. * Reordering of header fields with different names. * Conversion between different versions of the HTTP protocol (e.g., HTTP/1.x to HTTP/2, or vice-versa). * Changes in casing (e.g., "Origin" to "origin") of any case- insensitive content such as header field names, request URI scheme, or host. * Addition or removal of leading or trailing whitespace to a header field value. * Addition or removal of "obs-folds". * Changes to the "request-target"39 1. Introduction Message integrity and"Host" header fieldauthenticity are important security properties thatwhen applied together do not result in a changeare critical to themessage's effective request URI, as defined in Section 5.5secure operation of[MESSAGING]. Additionally, all changes to content not covered bymany HTTP applications. Application developers typically rely on thesignature are considered safe. 1.4. Conventions and Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document aretransport layer tobe interpreted as described in BCP 14 [RFC2119] [RFC8174] when, andprovide these properties, by operating their application over [TLS]. However, TLS onlywhen, they appear in all capitals, as shown here. The terms "HTTP message", "HTTP request", "HTTP response", "absolute- form", "absolute-path", "effective request URI", "gateway", "header field", "intermediary", "request-target", "sender",guarantees these properties over a single TLS connection, and"recipient" are used as defined in [MESSAGING]. The term "method" is to be interpreted as defined in Section 4 of [SEMANTICS]. For brevity,theterm "signature" on its own is used in this document to refer to both digital signaturespath between client andkeyed MACs. Similarly, the verb "sign" refers toapplication may be composed of multiple independent TLS connections (for example, if thegeneration of eitherapplication is hosted behind adigital signatureTLS-terminating gateway orkeyed MAC overif the client is behind agiven input string. The qualified term "digital signature" refers specificallyTLS Inspection appliance). In such cases, TLS cannot guarantee end-to-end message integrity or authenticity between the client and application. Additionally, some operating environments present obstacles that make it impractical to use TLS, or to use features necessary to provide message authenticity. Furthermore, some applications require theoutputbinding of anasymmetric cryptographic signing operation. In additionapplication- level key tothose listed above, this document usesthefollowing terms: Decimal String An Integer String optionally concatenated with a period "." followed by a second Integer String, representing a positive real number expressedHTTP message, separate from any TLS certificates inbase 10. The first Integer String represents the integral portion of the number,use. Consequently, whilethe optional second Integer String represents the fractional portion of the number. (( Editor's note: There's got to be a definition for this that weTLS canreference. )) Integer String A US-ASCII string of one or more digits "0-9", representingmeet message integrity and authenticity needs for many HTTP-based applications, it is not apositive integer in base 10. (( Editor's note: There's got to beuniversal solution. This document defines adefinitionmechanism forthis that we can reference. )) Signer The entity that is generating or has generatedproviding end-to-end integrity and authenticity for content within an HTTPMessage Signature. Verifier An entitymessage. The mechanism allows applications to create digital signatures or message authentication codes (MACs) over only that content within the message that isverifying or has verified an HTTP Message Signature against an HTTP Message. Notemeaningful and appropriate for the application. Strict canonicalization rules ensure thatan HTTP Message Signature may be verified multiple times, potentiallythe verifier can verify the signature even if the message has been transformed in any of the many ways permitted bydifferent entities. ThisHTTP. The mechanism described in this documentcontains non-normative examplesconsists ofpartialthree parts: * A common nomenclature andcompletecanonicalization rule set for the different protocol elements and other content within HTTP messages.To improve readability, header fields may be split into multiple lines,* Algorithms for generating and verifying signatures over HTTP message content usingthe "obs-fold" syntax. This syntax is deprecated in [MESSAGING],this nomenclature andsenders MUST NOT generate messages that include it. 2. Identifyingrule set. * A mechanism for attaching a signature andCanonicalizing Content In orderrelated metadata toallow signersan HTTP message. 1.1. Requirements Discussion HTTP permits andverifierssometimes requires intermediaries toestablish which contenttransform messages in a variety of ways. This may result in a recipient receiving a message that iscovered bynot bitwise equivalent to the message that was oringally sent. In such a case, the recipient will be unable to verify asignature, this document defines content identifiers forsignaturemetadataover the raw bytes of the sender's HTTP message, as verifying digital signatures or MACs requires both signer anddiscrete piecesverifier to have the exact same signed content. Since the raw bytes of the messagecontent that maycannot becovered by an HTTP Message Signature. Somerelied upon as signed content, the signer and verifier must derive the signed contentwithin HTTP messages may undergo transformations that changefrom their respective versions of the message, via a mechanism that is resilient to safe changes that do not alter thebitwise value without alteringmeaning of thecontent (for example, the merging togethermessage. For a variety ofheader fields with the same name). Message content must therefore be canonicalized beforereasons, it issigned,impractical toensure thatstrictly define what constitutes asignature can be verified despite such innocuous transformations. This document defines rules for each content identifier that transform the identifier's associated content into suchsafe change versus an unsafe one. Applications use HTTP in acanonical form. The following sections define content identifiers, their associated content,wide variety of ways, andtheir canonicalization rules. 2.1. HTTP Header Fields An HTTPmay disagree on whether a particular piece of information in a message (e.g., the body, or the "Date" headerfieldfield) isidentified by its header field name. While HTTP header field names are case-insensitive, implementations MUST use lowercased field names (e.g., "content-type", "date", "etag") when using them asrelevant. Thus a general purpose solution must provide signers with some degree of control over which message contentidentifiers. An HTTP header field valueiscanonicalizedsigned. HTTP applications may be running in environments that do not provide complete access to or control over HTTP messages (such asfollows: 1. Create an ordered list ofa web browser's JavaScript environment), or may be using libraries that abstract away thefield values of each instancedetails of theheader field in the message, inprotocol (such as theorder that they occur (or will occur) inJava HTTPClient library (https://openjdk.java.net/groups/net/httpclient/ intro.html)). These applications need to be able to generate and verify signatures despite incomplete knowledge of the HTTP message.2. Strip leading1.2. HTTP Message Transformations As mentioned earlier, HTTP explicitly permits andtrailing whitespace from each iteminthe list. 3. Concatenate the list items together, withsome cases requires implementations to transform messages in acomma "," and space " " between each item. The resulting stringvariety of ways. Implementations are required to tolerate many of these transformations. What follows isthe canonicalized value. 2.1.1. Canonicalization Examples This section containsa non-normativeexamples of canonicalized values for header fields, given the following example HTTP message: HTTP/1.1 200 OK Server: www.example.com Date: Tue, 07 Jun 2014 20:51:35 GMT X-OWS-Header: Leadingandtrailing whitespace. X-Obs-Fold-Header: Obsolete line folding. X-Empty-Header: Cache-Control: max-age=60 Cache-Control: must-revalidate The following table shows example canonicalized values for header fields, givennon-exhaustive list of transformations thatmessage: +===================+==================================+ | Header Field | Canonicalized Value | +===================+==================================+ | cache-control | max-age=60, must-revalidate | +-------------------+----------------------------------+ | date | Tue, 07 Jun 2014 20:51:35 GMT | +-------------------+----------------------------------+ | server | www.example.com | +-------------------+----------------------------------+ | x-empty-header | | +-------------------+----------------------------------+ | x-obs-fold-header | Obsolete line folding. | +-------------------+----------------------------------+ | x-ows-header | Leading and trailing whitespace. | +-------------------+----------------------------------+ Table 1: Non-normative examplesmay occur under HTTP, provided as context: * Re-ordering of header fields with different header fieldcanonicalization. 2.2. Dictionary Structured Field Members An individual member innames ([MESSAGING], Section 3.2.2). * Combination of header fields with thevaluesame field name ([MESSAGING], Section 3.2.2). * Removal ofa Dictionary Structured Field is identified byheader fields listed in thelowercased"Connection" header fieldname, followed by([MESSAGING], Section 6.1). * Addition of header fields that indicate control options ([MESSAGING], Section 6.1). * Addition or removal of asemicolon "":"", followed by the member name. An individual member intransfer coding ([MESSAGING], Section 5.7.2). * Addition of header fields such as "Via" ([MESSAGING], Section 5.7.1) and "Forwarded" ([RFC7239], Section 4). 1.3. Safe Transformations Based on thevaluedefinition ofa Dictionary Structured Field is canonicalized by applyingHTTP and theserialization algorithmrequirements describedin Section 4.1.2above, we can identify certain types of[StructuredFields] on a Dictionary containing onlytransformations thatmember. 2.2.1. Canonicalization Examples This section contains non-normative examples of canonicalized values for Dictionary Structured Field Members givenshould not prevent signature verification, even when performed on content covered by thefollowing example header field, whose value is assumed to be a Dictionary: X-Dictionary: a=1, b=2;x=1;y=2, c=(a, b, c)signature. The followingtable shows example canonicalized values for different content identifiers, given that field: +====================+=====================+ | Content Identifier | Canonicalized Value | +====================+=====================+ | x-dictionary:a | 1 | +--------------------+---------------------+ | x-dictionary:b | 2;x=1;y=2 | +--------------------+---------------------+ | x-dictionary:c | (a, b, c) | +--------------------+---------------------+ Table 2: Non-normative exampleslist describes those transformations: * Combination ofDictionary member canonicalization. 2.3. List Prefixes A prefixheader fields with the same field name. * Reordering ofa List Structured Field consistingheader fields with different names. * Conversion between different versions of thefirst N membersHTTP protocol (e.g., HTTP/1.x to HTTP/2, or vice-versa). * Changes inthe field's value (where N is an integer greater than 0 and less thancasing (e.g., "Origin" to "origin") of any case- insensitive content such as header field names, request URI scheme, orequalhost. * Addition or removal of leading or trailing whitespace tothe numbera header field value. * Addition or removal ofmembers in the List) is identified by"obs-folds". * Changes to thelowercased"request-target" and "Host" header fieldname, followed bythat when applied together do not result in asemicolon "":"", followed by N expressed as an Integer String. A list prefix is canonicalized by applyingchange to theserialization algorithm describedmessage's effective request URI, as defined in Section4.1.15.5 of[StructuredFields] on a List containing only[MESSAGING]. Additionally, all changes to content not covered by thefirst N members as specifiedsignature are considered safe. 1.4. Conventions and Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" inthe list prefix,this document are to be interpreted as described inthe orderBCP 14 [RFC2119] [RFC8174] when, and only when, they appear inthe original List. 2.3.1. Canonicalization Examples This section contains non-normative examples of canonicalized values for list prefixes given the following example header fields, whose values are assumed to be Dictionaries: X-List-A: (a, b, c, d, e, f) X-List-B: () The following table shows example canonicalized values for different content identifiers, given those fields: +====================+=====================+ | Content Identifier | Canonicalized Value | +====================+=====================+ | x-list-a:0 | () | +--------------------+---------------------+ | x-list-a:1 | (a) | +--------------------+---------------------+ | x-list-a:3 | (a, b, c) | +--------------------+---------------------+ | x-list-a:6 | (a, b, c, d, e, f) | +--------------------+---------------------+ | x-list-b:0 | () | +--------------------+---------------------+ Table 3: Non-normative examples of list prefix canonicalization. 2.4. Signature Creation Time The signature's Creation Time (Section 3.1) is identified by the "*created" identifier. Its canonicalized value is an Integer String containing the signature's Creation Time expressedall capitals, asthe number of seconds since the Epoch,shown here. The terms "HTTP message", "HTTP request", "HTTP response", "absolute- form", "absolute-path", "effective request URI", "gateway", "header field", "intermediary", "request-target", "sender", and "recipient" are used as defined inSection 4.16 (https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ V1_chap04.html#tag_04_16) of [POSIX.1]. The use of seconds since the Epoch to canonicalize a timestamp simplifies processing and avoids timezone management required by specifications such as [RFC3339]. 2.5. Signature Expiration Time[MESSAGING]. Thesignature's Expiration Time (Section 3.1) is identified by the "*expires" identifier. Its canonicalized valueterm "method" isa Decimal String containing the signature's Expiration Time expressed as the number of seconds since the Epoch,to be interpreted as defined in Section4.16 (https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ V1_chap04.html#tag_04_16) of [POSIX.1]. 2.6. Target Endpoint The request target endpoint, consisting of the request method and the path and query4 of [SEMANTICS]. For brevity, theeffective request URI, is identified by the "*request-target" identifier. Its valueterm "signature" on its own iscanonicalized as follows: 1. Take the lowercased HTTP method of the message. 2. Append a space " ". 3. Append the pathused in this document to refer to both digital signatures andquery of the request target ofkeyed MACs. Similarly, themessage, formatted accordingverb "sign" refers to therules defined for the :path pseudo- header in [HTTP2], Section 8.1.2.3. The resulting string is the canonicalized value. 2.6.1. Canonicalization Examples The following table contains non-normative example HTTP messages and their canonicalized "*request-target" values. +=========================+=================+ |HTTP Message | *request-target | +=========================+=================+ | POST /?param=value HTTP/1.1| post | | Host: www.example.com | /?param=value | +-------------------------+-----------------+ | POST /a/b HTTP/1.1 | post /a/b | | Host: www.example.com | | +-------------------------+-----------------+ | GET http://www.example.com/a/ HTTP/1.1| get /a/ | +-------------------------+-----------------+ | GET http://www.example.com HTTP/1.1| get / | +-------------------------+-----------------+ | CONNECT server.example.com:80 HTTP/1.1| connect / | | Host: server.example.com| | +-------------------------+-----------------+ | OPTIONS * HTTP/1.1 | options * | | Host: server.example.com| | +-------------------------+-----------------+ Table 4: Non-normative examplesgeneration of"*request-target" canonicalization. 3. HTTP Message Signatures An HTTP Message Signature iseither a digital signature or keyed MAC over astring generated from a subset of the content in an HTTP message and metadata aboutgiven input string. The qualified term "digital signature" refers specifically to thesignature itself. When successfully verified againstoutput of anHTTP message, it providesasymmetric cryptographicproof that with respectsigning operation. In addition to those listed above, this document uses thesubset of contentfollowing terms: Signer: The entity thatwas signed, the messageissemantically equivalent to the message for which the signature was generated. 3.1. Signature Metadatagenerating or has generated an HTTP MessageSignatures have metadata properties that provide information regarding the signature's generation and/or verification. The following metadata properties are defined: AlgorithmSignature. Verifier: An entity that is verifying or has verified an HTTP Message SignatureAlgorithm defined in theagainst an HTTP Message. Note that an HTTP Message SignatureAlgorithms Registrymay be verified multiple times, potentially by different entities. The term "Unix time" is definedin this document. It describes the signingby [POSIX.1] section 4.16 (http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ V1_chap04.html#tag_04_16). This document contains non-normative examples of partial andverification algorithms for the signature. Creation Time A timestamp representingcomplete HTTP messages. To improve readability, header fields may be split into multiple lines, using thepoint"obs-fold" syntax. This syntax is deprecated intime[MESSAGING], and senders MUST NOT generate messages thatthe signature was generated. Sub-second precision is not supported. A signature's Creation Time MAY be undefined, indicatinginclude it. Additionally, some examples use '\' line wrapping for long values thatit is unknown. Covered Content An ordered listcontain no whitespace, as per [RFC8792]. 1.5. Application of HTTP Message Signatures HTTP Message Signatures are designed to be a general-purpose security mechanism applicable in a wide variety of circumstances and applications. In order to properly and safely apply HTTP Message Signatures, an application or profile of this specification MUST specify all of the following items: * The set of content identifiers (Section 2) thatindicates the metadataare expected andmessage contentrequired. For example, an authorization protocol would mandate thatisthe "Authorization" header be coveredbyto protect the authorization credentials, as well as a "*created" field to allow replay detection. * A means of retrieving the key material used to verify the signature.The orderAn application will usually use the "keyid" field ofidentifiers in this list affects signature generation and verification,the "Signature-Input" header value andtherefore MUST be preserved. Expiration Timedefine rules for resolving a key from there. * Atimestamp representing the point in time at whichmeans of determining the signatureexpires. An expiredalgorithm used to verify the signaturealways fails verification.content is appropriate for the key material. * Asignature's Expiration Time MAY be undefined, indicatingmeans of determining thatthe signature does not expire. Verification Key Material Thea given keymaterial required to verifyand algorithm presented in thesignature. 3.2. Creatingrequest are appropriate for the request being made. For example, aSignatureserver expecting only ECDSA signatures should know to reject any RSA signatures; or a server expecting asymmetric cryptography should know to reject any symmetric cryptography. The details of this kind of profiling are the purview of the application and outside the scope of this specification. 2. Identifying and Canonicalizing Content In order tocreateallow signers and verifiers to establish which content is covered by a signature, this document defines content identifiers for data items covered by an HTTP Message Signature. Some content within HTTP messages can undergo transformations that change the bitwise value without altering meaning of the content (for example, the merging together of header fields with the same name). Message content must therefore be canonicalized before it is signed, to ensure that asignature,signature can be verified despite such intermediary transformations. This document defines rules for each content identifier that transform the identifier's associated content into such asigner completescanonical form. Content identifiers are defined using production grammar defined by [RFC8941] section 4. The content identifier is an "sf-string" value. The content identifier type MAY define parameters which are included using thefollowing process: 1. Choose key material and algorithm, and set metadata properties Section 3.2.1 2. Create"parameters" rule. content-identifier = sf-string parameters Note that this means theSignature Input Section 3.2.2 3. Signvalue of theSignature Input Section 3.2.3identifier itself is encased in double quotes, with parameters following as a semicolon-separated list, such as ""cache-control"", ""date"", or ""@signature-params"". The following sectionsdescribe each of these steps in detail. 3.2.1. Choosedefine content identifier types, their parameters, their associated content, andSet Signature Metadata Properties 1.their canonicalization rules. 2.1. HTTP Headers Thesigner choosescontent identifier for an HTTPSignature Algorithm from those registered inheader is the lowercased form of its header field name. While HTTPSignature Algorithms Registry definedheader field names are case- insensitive, implementations MUST use lowercased field names (e.g., "content-type", "date", "etag") when using them as content identifiers. Unless overridden bythis document,additional parameters andsetsrules, thesignature's Algorithm property to that value. The signerHTTP header field value MUSTNOT choose an algorithm marked "Deprecated". The mechanism by whichbe canonicalized with thesigner choosesfollowing steps: 1. Create analgorithm is outordered list ofscope for this document.the field values of each instance of the header field in the message, in the order that they occur (or will occur) in the message. 2.The signer chooses key material to use for signing and verification,Strip leading andsetstrailing whitespace from each item in thesignature's Verification Key Material property tolist. 3. Concatenate thekey material required for verification.list items together, with a comma "," and space " " between each item. Thesigner MUST choose key material thatresulting string isappropriate forthesignature's Algorithm, and that conforms to any requirements defined bycanonicalized value. 2.1.1. Canonicalized Structured HTTP Headers If value of theAlgorithm, such as key size or format. The mechanism by whichthesigner chooses key materialHTTP header in question isout of scope fora structured field [RFC8941], the content identifier MAY include the "sf" parameter. If thisdocument. 3. The signer setsparameter is included, thesignature's Creation Time property toHTTP header value MUST be canonicalized using thecurrent time.rules specified in [RFC8941] section 4. Note that this process will replace any optional whitespace with a single space. Thesigner sets the signature's Expiration Time property to the time at which the signatureresulting string isto expire, or to undefined ifused as thesignature will not expire. 5.field value input in Section 2.1. 2.1.2. Canonicalization Examples This section contains non-normative examples of canonicalized values for header fields, given the following example HTTP message: HTTP/1.1 200 OK Server: www.example.com Date: Tue, 07 Jun 2014 20:51:35 GMT X-OWS-Header: Leading and trailing whitespace. X-Obs-Fold-Header: Obsolete line folding. X-Empty-Header: Cache-Control: max-age=60 Cache-Control: must-revalidate Thesigner creates an ordered listfollowing table shows example canonicalized values for header fields, given that message: +=====================+==================================+ | Header Field | Canonicalized Value | +=====================+==================================+ | "cache-control" | max-age=60, must-revalidate | +---------------------+----------------------------------+ | "date" | Tue, 07 Jun 2014 20:51:35 GMT | +---------------------+----------------------------------+ | "server" | www.example.com | +---------------------+----------------------------------+ | "x-empty-header" | | +---------------------+----------------------------------+ | "x-obs-fold-header" | Obsolete line folding. | +---------------------+----------------------------------+ | "x-ows-header" | Leading and trailing whitespace. | +---------------------+----------------------------------+ Table 1: Non-normative examples ofcontent identifiers representingheader field canonicalization. 2.2. Dictionary Structured Field Members An individual member in themessage content and signature metadata to be coveredvalue of a Dictionary Structured Field is identified by using thesignature, and assigns this list asparameter "key" on thesignature's Covered Content. * Eachcontent identifierMUST be onefor the header. The value ofthose defined in Section 2. * This list MUST NOT be empty, asthiswould result in creatingparameter is asignature overtheempty string. * If the signature's Algorithm name does not start with rsa, hmac, or ecdsa, signers SHOULD include "*created" and "*request-target"key being identified, without any parameters present on that key in thelist. * If the signature's Algorithm starts with rsa, hmac, or ecdsa, signers SHOULD include "date" and "*request-target"original dictionary. An individual member in thelist. * Further guidance on what to include in this list and in what order is outvalue ofscope for this document. However, the list ordera Dictionary Structured Field issignificant and once established forcanonicalized by applying the serialization algorithm described in Section 4.1.2 of [RFC8941] on agiven signature it MUST be preserved forDictionary containing only thatsignature. For example,member. 2.2.1. Canonicalization Examples This section contains non-normative examples of canonicalized values for Dictionary Structured Field Members given the followingHTTP message: GET /foo HTTP/1.1 Host: example.org Date: Sat, 07 Jun 2014 20:51:35 GMT X-Example: Example header with some whitespace. X-EmptyHeader:example header field, whose value is assumed to be a Dictionary: X-Dictionary: a=1,b=2 X-List: (a, b, c, d) Cache-Control: max-age=60 Cache-Control: must-revalidateb=2;x=1;y=2, c=(a b c) The following tablepresents a non-normativeshows exampleof metadatacanonicalized values for different content identifiers, given thata signer may choose: +==============+================================================+ | Property | Value | +==============+================================================+ | Algorithm | hs2019 | +--------------+------------------------------------------------+ | Covered | "*request-target", "*created", "host", "date", |field: +======================+=====================+ | Content Identifier |"cache-contol", "x-emptyheader", "x-example", | | | "x-dictionary:b", "x-dictionary:a", "x-list:3" | +--------------+------------------------------------------------+ | Creation | 1402174295 | | Time | | +--------------+------------------------------------------------+ | Expiration | 1402174595Canonicalized Value | +======================+=====================+ |Time"x-dictionary";key=a | 1 |+--------------+------------------------------------------------++----------------------+---------------------+ |Verification"x-dictionary";key=b |The public key provided in Appendix A.1.1 and2;x=1;y=2 | +----------------------+---------------------+ |Key Material"x-dictionary";key=c |identified by the "keyId" value "test-key-a".(a, b, c) |+--------------+------------------------------------------------++----------------------+---------------------+ Table5:2: Non-normativeexample metadata values 3.2.2. Create the Signature Input The Signature Input is a US-ASCII string containing the content that will be signed. To create it, the signer concatenates together entries for each identifier in the signature's Covered Content in the order it occurs in the list, with each entry separated by a newline ""\n"". An identifier's entry isexamples of Dictionary member canonicalization. 2.3. List Prefixes A prefix of aUS-ASCII stringList Structured Field consisting of thelowercased identifier followed with a colon "":"", a space "" "", andfirst N members in theidentifier's canonicalizedfield's value(described below). If Covered Content contains "*created" and the signature's Creation Time is undefined or the signature's Algorithm name starts with "rsa", "hmac", or "ecdsa" an implementation MUST produce an error. If Covered Content contains "*expires" and the signature does not have an Expiration Time or the signature's Algorithm name starts with "rsa", "hmac", or "ecdsa" an implementation MUST produce an error. If Covered Content contains an identifier for a header field that(where N isnot presentan integer greater than 0 and less than ormalformed in the message,equal to theimplementation MUST produce an error. If Covered Content contains an identifier for a Dictionary member that references a header field that is not present, is malformednumber of members in themessage, orList) isnot a Dictionary Structured Field,identified by theimplementation MUST produce an error. Ifparameter "prefix" with theheader fieldvaluedoes not contain the specified member, the implementation MUST produce an error. If Covered Content containsof N as anidentifier for a List Prefix that references a header field that is not present,integer. A list prefix value ismalformed incanonicalized by applying themessage, or is notserialization algorithm described in Section 4.1.1 of [RFC8941] on a ListStructured Field, the implementation MUST produce an error. If the header field value contains fewer thancontaining only the first N members as specifiednumber of members,in theimplementation MUST produce an error. Forlist prefix, in thenon-normative example Signature metadataorder they appear inTable 5,thecorresponding Signature Input is: *request-target: get /foo *created: 1402170695 host: example.org date: Tue, 07 Jun 2014 20:51:35 GMT cache-control: max-age=60, must-revalidate x-emptyheader: x-example: Exampleoriginal List. 2.3.1. Canonicalization Examples This section contains non-normative examples of canonicalized values for list prefixes given the following example headerwith some whitespace. x-dictionary: b=2 x-dictionary: a=1 x-list:fields, whose values are assumed to be Dictionaries: X-List-A: (a b c d e f) X-List-B: () The following table shows example canonicalized values for different content identifiers, given those fields: +=====================+=====================+ | Content Identifier | Canonicalized Value | +=====================+=====================+ | "x-list-a";prefix=0 | () | +---------------------+---------------------+ | "x-list-a";prefix=1 | (a) | +---------------------+---------------------+ | "x-list-a";prefix=3 | (a, b, c)Figure 1:| +---------------------+---------------------+ | "x-list-a";prefix=6 | (a, b, c, d, e, f) | +---------------------+---------------------+ | "x-list-b";prefix=0 | () | +---------------------+---------------------+ Table 3: Non-normativeexample Signature Input 3.2.3. Sign the Signature Input The signer signs the Signature Input usingexamples of list prefix canonicalization. 2.4. Specialty Content Fields Content not found in an HTTP header can be included in thesigning algorithm describedsignature base string bythe signature's Algorithm property,defining a content identifier and thekey material chosen by the signer. The signer then encodescanonicalization method for its content. To differentiate speciality content identifiers from HTTP headers, specialty content identifiers MUST start with theresult of that operation as a base 64-encoded string [RFC4648]."at" "@" character. Thisstring is the signature value. Forspecification defines thenon-normative example Signature metadata infollowing specialty content identifiers: @request-target The target request endpoint. Section3.2.1 and Signature Input in Figure 1, the corresponding signature value is: K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUeZx/Kdrq32DrfakQ6b PsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibeoHyqU/yCjphSmEdd7WD+z rchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4CaB8X/I5/+HLZLGvDiezqi6/7 p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg1Q7MpWYZs0soHjttq0uLIA3DIbQfL iIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZgFquQrXRlmYOh+Hx5D9fJkXcXe5tmAg== Figure 2: Non-normative example2.4.1 @signature-params The signaturevalue 3.3. Verifying a Signature In order to verify a signature, a verifier MUST: 1. Examine the signature'smetadatato confirm that the signature meets the requirements described inparameters for thisdocument, as well as any additional requirements defined by the application such as which header fields or othersignature. Section 2.4.2 Additional specialty contentare required toidentifiers MAY becovered by the signature. 2. Use the received HTTP messagedefined andthe signature's metadata to recreate the Signature Input, using the process describedregistered in the HTTP Signatures Specialty Content Identifier Registry. Section3.2.2. 3. Use5.3 2.4.1. Request Target The request target endpoint, consisting of thesignature's Algorithmrequest method andVerification Key Material withtherecreated Signing Input to verifypath and query of thesignature value. A signature with a Creation Time thateffective request URI, isinidentified by thefuture or an Expiration Time that"@request-target" identifier. Its value isincanonicalized as follows: 1. Take thepast MUST NOT be processed. The verifier MUST ensure thatlowercased HTTP method of the message. 2. Append asignature's Algorithm is appropriate forspace " ". 3. Append thekey materialpath and query of theverifier will use to verifyrequest target of thesignature. Ifmessage, formatted according to theAlgorithm is not appropriaterules defined for thekey material (for example, if it is the wrong size, or:path pseudo- header in [HTTP2], Section 8.1.2.3. The resulting string is thewrong format), the signature MUST NOT be processed. 3.3.1. Enforcing Application Requirementscanonicalized value. 2.4.1.1. Canonicalization Examples Theverification requirements specified in this document are intended as a baseline set of restrictions that are generally applicable to all use cases. Applications usingfollowing table contains non-normative example HTTPMessage Signatures MAY impose requirements abovemessages andbeyond those specified by this document, as appropriate fortheiruse case. Some non-normative examples of additional requirements an application might define are: * Requiring a specific set of header fields to be signed (e.g., Authorization, Digest). * Enforcing a maximum signature age. * Prohibiting the use of certain algorithms, or mandating the use of an algorithm.canonicalized "@request-target" values. +=========================+=================+ |HTTP Message | @request-target | +=========================+=================+ | POST /?param=value HTTP/1.1| post | | Host: www.example.com | /?param=value | +-------------------------+-----------------+ | POST /a/b HTTP/1.1 | post /a/b | | Host: www.example.com | | +-------------------------+-----------------+ | GET http://www.example.com/a/ HTTP/1.1| get /a/ | +-------------------------+-----------------+ | GET http://www.example.com HTTP/1.1| get / | +-------------------------+-----------------+ | CONNECT server.example.com:80 HTTP/1.1| connect / | | Host: server.example.com| | +-------------------------+-----------------+ | OPTIONS *Requiring keys to beHTTP/1.1 | options * | | Host: server.example.com| | +-------------------------+-----------------+ Table 4: Non-normative examples ofa certain size (e.g., 2048 bits vs. 1024 bits). Application-specific requirements are expected and encouraged. When an application defines additional requirements, it MUST enforce them during the signature verification process, and"@request-target" canonicalization. 2.4.2. Signature Parameters The signatureverification MUST fail ifparameters special content is identified by thesignature does not conform to"@signature-params" identifier. Its canonicalized value is theapplication's requirements. Applications MUST enforceserialization of therequirements defined insignature parameters for thisdocument. Regardless of use case, applications MUST NOT accept signaturessignature, including the covered content list with all associated parameters. Section 3.1 Note thatdo not conform to these requirements. 4. Including a Message Signature in a Message Message signatures can be included withinan HTTP messageviacould contain multiple signatures, but only the"Signature-Input" and "Signature" HTTP header fields, both defined within this specification. The "Signature" HTTP header field containssignaturevalues, whileparameters used for the"Signature-Input" HTTP header field identifiescurrent signature are included. 2.4.2.1. Canonicalization Examples Given the following signature parameters: +==============+=========================================+ | Property | Value | +==============+=========================================+ | Algorithm | hs2019 | +--------------+-----------------------------------------+ | Covered | "@request-target", "host", "date", | | Content | "cache-control", "x-emptyheader", | | | "x-example", "x-dictionary;key=b", | | | "x-dictionary;key=a", "x-list;prefix=3" | +--------------+-----------------------------------------+ | Creation | 1402174295 | | Time | | +--------------+-----------------------------------------+ | Expiration | 1402174595 | | Time | | +--------------+-----------------------------------------+ | Verification | The public key provided in | | Key Material | Appendix B.1.1 andmetadata that describe how each signature was generated. 4.1.identified by the | | | "keyid" value "test-key-a". | +--------------+-----------------------------------------+ Table 5 The'Signature-Input'signature parameter value is defined as: "@signature-params": ("@request-target" "host" "date" "cache-control" "x-empty-header" "x-example" "x-dictionary";key=b "x-dictionary";key=a "x-list";prefix=3); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170995 3. HTTPHeader The "Signature-Input"Message Signatures An HTTPheader fieldMessage Signature is aDictionary Structured Header [StructuredFields] containing the metadata for zero or more message signaturessignature over a string generated fromcontent withina subset of the content in an HTTPmessage. Each member describes a singlemessagesignature. The member's name is an identifier that uniquely identifiesand metadata about themessagesignaturewithinitself. When successfully verified against an HTTP message, it provides cryptographic proof that with respect to thecontextsubset of content that was signed, theHTTP message. The member's valuemessage is semantically equivalent to the messagesignature's Covered Content, expressed as a List of Tokens. Furtherfor which the signature was generated. 3.1. Signature Metadata HTTP Message Signatures have metadatais expressed in parameters onproperties that provide information regarding themember value, as described below. 4.1.1. Metadata Parameterssignature's generation and/or verification. Theparameters on each "Signature-Input" member value containfollowing metadataabout the signature. Each parameter name MUST be a parameter name registered in the IANAproperties are defined: Algorithm: An HTTPSignatures Metadata Parameters RegistrySignature Algorithm defined inSection 5.2 of this document. This document defines the following parameters, and registers them as the initial contents of the registry: alg RECOMMENDED. The "alg" parameter is a Token containing the name of the signature's Algorithm, as registered inthe HTTP Signature Algorithms Registry definedbyin thisdocument. Verifiers MUST determine the signature's Algorithm fromdocument, represented as a string. It describes the"keyId" parameter rather than from "alg". If "alg" is providedsigning anddiffers from or is incompatible with the algorithm or key material identified by "keyId" (for example, "alg" has a value of "rsa-sha256" but "keyId" identifies an EdDSA key), then implementations MUST produce an error. created RECOMMENDED. The "created" parameter is a Decimal containingverification algorithms for thesignature'ssignature. CreationTime, expressed asTime: A timestamp representing thecanonicalized value ofpoint in time that the"*created" content identifier,signature was generated, represented asdefined in Section 2. Ifan integer. Sub-second precision is notspecified, thesupported. A signature's Creation Time MAY be undefined, indicating that it isundefined. This parameter is useful when signers are not capable of controlling the Date HTTP Header such as when operating in certain web browser environments. expires OPTIONAL. The "expires" parameter is a Decimal containing the signature'sunknown. ExpirationTime, expressed as the canonicalized value ofTime: A timestamp representing the"*expires" content identifier, as definedpoint inSection 2. Iftime at which the signaturedoes not haveexpires, represented as anExpiration Time, this parameter MUST be omitted. If not specified, theinteger. An expired signature always fails verification. A signature's Expiration Timeis undefined. keyId REQUIRED. The "keyId" parameter is a String whose value canMAY beused by a verifier to identify and/or obtainundefined, indicating that thesignature'ssignature does not expire. Verification KeyMaterial. Further format and semantics of this value are out of scope for this document. 4.2. The 'Signature' HTTP HeaderMaterial: The"Signature" HTTP header field is a Dictionary Structured Header [StructuredFields] containing zero or more message signatures generated fromkey material required to verify the signature. Covered Content: An ordered list of contentwithinidentifiers (Section 2) that indicates theHTTP message. Each member's name is a signature identifiermetadata and message content that ispresent as a member name incovered by the"Signature-Input" Structured Header withinsignature. This list MUST NOT include theHTTP message. Each member's value"@signature-params" content identifier. The signature metadata isa Byte Sequence containingserialized using thesignature value forrules in [RFC8941] section 4 as follows: 1. Let the output be an empty string. 2. Serialize the content identifiers as an ordered "inner-list" according to [RFC8941] section 4.1.1.1 and append this to themessage signature identified byoutput. 3. Append themember name. Any membersignature metadata as parameters according to [RFC8941] section 4.1.1.2 in the"Signature" HTTP header fieldany order, skipping fields thatdoesare nothave a corresponding member inavailable: * "alg": Algorithm as an "sf-string" value. * "keyid": Verification Key Material as an "sf-string" value. * "created": Creation Time as an "sf-integer" timestamp value. * "expires": Expiration Time as an "sf-integer" timestamp value. Note that theHTTP message's "Signature-Input" HTTP header field MUST be ignored. 4.3. Examples The following"inner-list" serialization isa non-normative exampleused instead of"Signature-Input" and "Signature" HTTP header fields representingthesignature"sf- list" serialization inFigure 2: Signature-Input: sig1=(*request-target, *created, host, date, cache-control, x-empty-header, x-example); keyId="test-key-a"; alg=hs2019; created=1402170695; expires=1402170995 Signature: sig1=:K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUe Zx/Kdrq32DrfakQ6bPsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibe oHyqU/yCjphSmEdd7WD+zrchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4 CaB8X/I5/+HLZLGvDiezqi6/7p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg 1Q7MpWYZs0soHjttq0uLIA3DIbQfLiIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZg FquQrXRlmYOh+Hx5D9fJkXcXe5tmAg==: Sinceorder to facilitate this value's inclusion in the "Signature-Input"and "Signature" are both definedheader's dictionary, asDictionary Structured Headers, they candiscussed in Section 4.1. The Table 6 values would beused to easily include multiple signatures within the same HTTP message. For example,serialized as follows: ("@request-target" "host" "date" "cache-control" "x-empty-header" "x-example"); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170995 3.2. Creating asigner may include multiple signatures signing the same content with different keys and/or algorithmsSignature In order tosupport verifiers with different capabilities, orcreate areverse proxy may include information about the client in header fields when forwarding the request tosignature, aservice host,signer completes the following process: 1. Choose key material andmay also include a signature over those fieldsalgorithm, and set metadata properties Section 3.2.1 2. Create theclient's signature.Signature Input Section 3.2.2 3. Sign the Signature Input Section 3.2.3 The followingis a non-normative examplesections describe each ofheader fields a reverse proxy might add to a forwarded request that contains the signaturethese steps in detail. 3.2.1. Choose and Set Signature Metadata Properties 1. The signer chooses an HTTP Signature Algorithm from those registered in theabove example: X-Forwarded-For: 192.0.2.123 Signature-Input: reverse_proxy_sig=(*created, host, date, signature:sig1, x-forwarded-for); keyId="test-key-a"; alg=hs2019; created=1402170695; expires=1402170695.25 Signature: reverse_proxy_sig=:ON3HsnvuoTlX41xfcGWaOEVo1M3bJDRBOp0Pc/O jAOWKQn0VMY0SvMMWXS7xG+xYVa152rRVAo6nMV7FS3rv0rR5MzXL8FCQ2A35DCEN LOhEgj/S1IstEAEFsKmE9Bs7McBsCtJwQ3hMqdtFenkDffSoHOZOInkTYGafkoy78 l1VZvmb3Y4yf7McJwAvk2R3gwKRWiiRCw448Nt7JTWzhvEwbh7bN2swc/v3NJbg/w JYyYVbelZx4IywuZnYFxgPl/qvqbAjeEVvaLKLgSMr11y+uzxCHoMnDUnTYhMrmOT 4O8lBLfRFOcoJPKBdoKg9U0a96U2mUug1bFOozEVYFg==: 5. IANA Considerations 5.1.HTTP Signature Algorithms RegistryThis document defines HTTP Signature Algorithms, for which IANA is asked to create and maintain a new registry titled "HTTP Signature Algorithms". Initial values fordefined by thisregistry are given in Section 5.1.2. Future assignments and modifications to existing assignment are to be made through the Expert Review registration policy [RFC8126]document, andshall followsets thetemplate presented in Section 5.1.1. 5.1.1. Registration Templatesignature's AlgorithmName An identifier for the HTTP Signature Algorithm.property to that value. Thenamesigner MUSTbe an ASCII string consisting only of lower-case characters (""a"" - ""z""), digits (""0"" - ""9""), and hyphens (""-""), and SHOULDNOTexceed 20 characters in length.choose an algorithm marked "Deprecated". Theidentifier MUST be unique within the context of the registry. Status A brief text description ofmechanism by which thestatussigner chooses an algorithm is out ofthe algorithm.scope for this document. 2. Thedescription MUST begin with one of "Active" or "Deprecated", and MAY provide further context or explanation assigner chooses key material tothe reasonuse forthe status. Description A description of the algorithm used to sign thesigningstring when generating an HTTP Message Signature, or instructions on howand verification, and sets the signature's Verification Key Material property todetermine that algorithm. Whenthedescription specifies an algorithm, itkey material required for verification. The signer MUSTinclude a reference tochoose key material that is appropriate for thedocument or documentssignature's Algorithm, and thatdefineconforms to any requirements defined by thealgorithm. 5.1.2. Initial Contents (( MS: The references in this section are problematicAlgorithm, such asmanykey size or format. The mechanism by which the signer chooses key material is out of scope for this document. 3. The signer sets thespecifications that they refersignature's Creation Time property toare too implementation specific, rather than just pointingthe current time. 4. The signer sets the signature's Expiration Time property to theproper signature and hashing specifications. A better approach might be just specifyingtime at which the signatureand hashing function specifications, leaving implementersis toconnect the dots (which are not that hardexpire, or toconnect). )) 5.1.2.1. hs2019 Algorithm Name "hs2019" Status active Description Derived from metadata associated with keyId. Recommend support for: * RSASSA-PSS [RFC8017] using SHA-512 [RFC6234] * HMAC [RFC2104] using SHA-512 [RFC6234] * ECDSA using curve P-256 DSS [FIPS186-4] and SHA-512 [RFC6234] * Ed25519ph, Ed25519ctx, and Ed25519 [RFC8032] 5.1.2.2. rsa-sha1 Algorithm Name "rsa-sha1" Status Deprecated; SHA-1 not secure. Description RSASSA-PKCS1-v1_5 [RFC8017] using SHA-1 [RFC6234] 5.1.2.3. rsa-sha256 Algorithm Name "rsa-sha256" Status Deprecated; specifying signature algorithm enables attack vector. Description RSASSA-PKCS1-v1_5 [RFC8017] using SHA-256 [RFC6234] 5.1.2.4. hmac-sha256 Algorithm Name "hmac-sha256" Status Deprecated; specifying signature algorithm enables attack vector. Description HMAC [RFC2104] using SHA-256 [RFC6234] 5.1.2.5. ecdsa-sha256 Algorithm Name "ecdsa-sha256" Status Deprecated; specifying signature algorithm enables attack vector. Description ECDSA using curve P-256 DSS [FIPS186-4] and SHA-256 [RFC6234] 5.2. HTTP Signature Metadata Parameters Registry This document definesundefined if the signature will not expire. 5. The signer creates an ordered list of content identifiers representing the"Signature-Input" Structured Header, whose member values may have parameters containing metadata about amessagesignature. IANA is asked to createcontent andmaintain a new registry titled "HTTP Signature Metadata Parameters"signature metadata torecordbe covered by the signature, andmaintainassigns this list as thesetsignature's Covered Content. * Each identifier MUST be one ofparametersthose definedfor use with member valuesin Section 2. * This list MUST NOT be empty, as this would result in creating a signature over the"Signature-Input" Structured Header. Initial values forempty string. * Signers SHOULD include "@request-target" in the list. * Signers SHOULD include a date stamp, such as the "date" header. Alternatively, the "created" signature metadata parameter can fulfil thisregistry are givenrole. * Further guidance on what to include inSection 5.2.2. Future assignmentsthis list andmodifications to existing assignments are to be made throughin what order is out of scope for this document. However, theExpert Review registration policy [RFC8126]list order is significant andshall followonce established for a given signature it MUST be preserved for that signature. * Note that thetemplate presentedsignature metadata is not included inSection 5.2.1. 5.2.1. Registration Template 5.2.2. Initial Contents The table below containstheinitial contentsexplicit list of covered content identifiers since its value is always covered. For example, given the following HTTPSignature Metadata Parameters Registry. Each row in themessage: GET /foo HTTP/1.1 Host: example.org Date: Sat, 07 Jun 2014 20:51:35 GMT X-Example: Example header with some whitespace. X-EmptyHeader: X-Dictionary: a=1, b=2 X-List: (a b c d) Cache-Control: max-age=60 Cache-Control: must-revalidate The following tablerepresentspresents adistinct entry in the registry. +=========+========+================================+ | Namenon-normative example of metadata values that a signer may choose: +==============+=========================================+ |StatusProperty |Reference(s)Value |+=========+========+================================++==============+=========================================+ |algAlgorithm |Activehs2019 |Section 4.1.1 of this document+--------------+-----------------------------------------+ |+---------+--------+--------------------------------+Covered |created"@request-target", "host", "date", |Active|Section 4.1.1 of this documentContent |+---------+--------+--------------------------------+"cache-control", "x-emptyheader", |expires|Active|Section 4.1.1 of this document"x-example", "x-dictionary;key=b", |+---------+--------+--------------------------------+|keyId|Active"x-dictionary;key=a", "x-list;prefix=3" |Section 4.1.1 of this document+--------------+-----------------------------------------+ |+---------+--------+--------------------------------+ Table 6: Initial contents of the HTTP Signature Metadata Parameters Registry. 6. Security Considerations (( TODO: need to dive deeper on this section; not sure how much of what's referenced below is actually applicable, or if it covers everything we need to worry about. )) (( TODO: Should provide some recommendations on how to determine what content needs to be signed for a given use case. )) There are a number of security considerations to take into account when implementing or utilizing this specification. A thorough security analysis of this protocol, including its strengths and weaknesses, can be found in [WP-HTTP-Sig-Audit]. 7. References 7.1. Normative References [FIPS186-4] "Digital Signature Standard (DSS)", 2013, <https://csrc.nist.gov/publications/detail/fips/186/4/ final>. [HTTP2] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <https://www.rfc-editor.org/info/rfc7540>. [MESSAGING] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014, <https://www.rfc-editor.org/info/rfc7230>. [POSIX.1] "The Open Group Base Specifications Issue 7, 2018 edition", 2018, <https://pubs.opengroup.org/onlinepubs/9699919799/>. [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- Hashing for Message Authentication", RFC 2104, DOI 10.17487/RFC2104, February 1997, <https://www.rfc-editor.org/info/rfc2104>. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>. [RFC8174] Leiba, B., "Ambiguity of Uppercase vs LowercaseCreation | 1402174295 | | Time | | +--------------+-----------------------------------------+ | Expiration | 1402174595 | | Time | | +--------------+-----------------------------------------+ | Verification | The public key provided inRFC 2119| | KeyWords", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>. [SEMANTICS] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): SemanticsMaterial | Appendix B.1.1 andContent", RFC 7231, DOI 10.17487/RFC7231, June 2014, <https://www.rfc-editor.org/info/rfc7231>. [StructuredFields] "Structured Field Vauesidentified by the | | | "keyid" value "test-key-a". | +--------------+-----------------------------------------+ Table 6: Non-normative example metadata values 3.2.2. Create the Signature Input The Signature Input is a US-ASCII string containing the content that will be signed. To create it, the signer or verifier concatenates together entries forHTTP", 2020, <https://datatracker.ietf.org/doc/draft-ietf-httpbis- header-structure>. 7.2. Informative References [RFC3230] Mogul, J. and A. Van Hoff, "Instance Digestseach identifier inHTTP", RFC 3230, DOI 10.17487/RFC3230, January 2002, <https://www.rfc-editor.org/info/rfc3230>. [RFC3339] Klyne, G. and C. Newman, "Date and Time ontheInternet: Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, <https://www.rfc-editor.org/info/rfc3339>. [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005, <https://www.rfc-editor.org/info/rfc3986>. [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, <https://www.rfc-editor.org/info/rfc4648>. [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, DOI 10.17487/RFC6234, May 2011, <https://www.rfc-editor.org/info/rfc6234>. [RFC7239] Petersson, A. and M. Nilsson, "Forwarded HTTP Extension", RFC 7239, DOI 10.17487/RFC7239, June 2014, <https://www.rfc-editor.org/info/rfc7239>. [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, DOI 10.17487/RFC7518, May 2015, <https://www.rfc-editor.org/info/rfc7518>. [RFC7541] Peon, R. and H. Ruellan, "HPACK: Header Compression for HTTP/2", RFC 7541, DOI 10.17487/RFC7541, May 2015, <https://www.rfc-editor.org/info/rfc7541>. [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, "PKCS #1: RSA Cryptography Specifications Version 2.2", RFC 8017, DOI 10.17487/RFC8017, November 2016, <https://www.rfc-editor.org/info/rfc8017>. [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital Signature Algorithm (EdDSA)", RFC 8032, DOI 10.17487/RFC8032, January 2017, <https://www.rfc-editor.org/info/rfc8032>. [RFC8126] Cotton, M., Leiba, B.,signature's Covered Content in the order it occurs in the list, with each entry separated by a newline ""\n"". An identifier's entry is a "sf-string" followed with a colon "":"", a space "" "", andT. Narten, "Guidelinesthe identifier's canonicalized value. The signer or verifier then includes the signature metadata specialty field "@signature-params" as the last entry in the covered content, separated by a newline ""\n"". Section 2.4.2 If Covered Content contains an identifier forWritinga header field that is malformed or is not present in the message, the implementation MUST produce anIANA Considerations Sectionerror. If Covered Content contains an identifier for a Dictionary member that references a header field using the "key" parameter that is not present, is malformed inRFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, June 2017, <https://www.rfc-editor.org/info/rfc8126>. [TLS] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, <https://www.rfc-editor.org/info/rfc8446>. [WP-HTTP-Sig-Audit] "Security Considerationsthe message, or is not a Dictionary Structured Field, the implementation MUST produce an error. If the header field value does not contain the specified member, the implementation MUST produce an error. If Covered Content contains an identifier forHTTP Signatures", 2013, <https://web-payments.org/specs/source/http-signatures- audit/>. Appendix A. Examples A.1.a List Prefix that references a header field using the "prefix" parameter that is not present, is malformed in the message, or is not a List Structured Field, the implementation MUST produce an error. If the header field value contains fewer than the specified number of members, the implementation MUST produce an error. For the non-normative example Signature metadata in Table 6, the corresponding Signature Input is: "@request-target": get /foo "host": example.org "date": Tue, 07 Jun 2014 20:51:35 GMT "cache-control": max-age=60, must-revalidate "x-emptyheader": "x-example": ExampleKeys This section provides cryptographic keys that are referenced inheader with some whitespace. "x-dictionary";key=b: 2 "x-dictionary";key=a: 1 "x-list";prefix=3: (a, b, c) "@signature-params": ("@request-target" "host" "date" "cache-control" "x-empty-header" "x-example" "x-dictionary";key=b "x-dictionary";key=b "x-list";prefix=3); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170995 Figure 1: Non-normative examplesignatures throughout this document. These keys MUST NOT be used for any purpose other than testing. A.1.1. Example Key RSA testSignature Input 3.2.3. Sign the Signature Input Thefollowing key is a 2048-bit RSA publicsigner signs the Signature Input using the signing algorithm described by the signature's Algorithm property, andprivatethe keypair: -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAhAKYdtoeoy8zcAcR874L8cnZxKzAGwd7v36APp7Pv6Q2jdsPBRrw WEBnez6d0UDKDwGbc6nxfEXAy5mbhgajzrw3MOEt8uA5txSKobBpKDeBLOsdJKFq MGmXCQvEG7YemcxDTRPxAleIAgYYRjTSd/QBwVW9OwNFhekro3RtlinV0a75jfZg kne/YiktSvLG34lw2zqXBDTC5NHROUqGTlML4PlNZS5Ri2U4aCNx2rUPRcKIlE0P uKxI4T+HIaFpv8+rdV6eUgOrB2xeI1dSFFn/nnv5OoZJEIB+VmuKn3DCUcCZSFlQ PSXSfBDiUGhwOw76WuSSsf1D4b/vLoJ10wIDAQAB -----END RSA PUBLIC KEY----- -----BEGIN RSA PRIVATE KEY----- MIIEqAIBAAKCAQEAhAKYdtoeoy8zcAcR874L8cnZxKzAGwd7v36APp7Pv6Q2jdsP BRrwWEBnez6d0UDKDwGbc6nxfEXAy5mbhgajzrw3MOEt8uA5txSKobBpKDeBLOsd JKFqMGmXCQvEG7YemcxDTRPxAleIAgYYRjTSd/QBwVW9OwNFhekro3RtlinV0a75 jfZgkne/YiktSvLG34lw2zqXBDTC5NHROUqGTlML4PlNZS5Ri2U4aCNx2rUPRcKI lE0PuKxI4T+HIaFpv8+rdV6eUgOrB2xeI1dSFFn/nnv5OoZJEIB+VmuKn3DCUcCZ SFlQPSXSfBDiUGhwOw76WuSSsf1D4b/vLoJ10wIDAQABAoIBAG/JZuSWdoVHbi56 vjgCgkjg3lkO1KrO3nrdm6nrgA9P9qaPjxuKoWaKO1cBQlE1pSWp/cKncYgD5WxE CpAnRUXG2pG4zdkzCYzAh1i+c34L6oZoHsirK6oNcEnHveydfzJL5934egm6p8DW +m1RQ70yUt4uRc0YSor+q1LGJvGQHReF0WmJBZHrhz5e63Pq7lE0gIwuBqL8SMaA yRXtK+JGxZpImTq+NHvEWWCu09SCq0r838ceQI55SvzmTkwqtC+8AT2zFviMZkKR Qo6SPsrqItxZWRty2izawTF0Bf5S2VAx7O+6t3wBsQ1sLptoSgX3QblELY5asI0J YFz7LJECgYkAsqeUJmqXE3LP8tYoIjMIAKiTm9o6psPlc8CrLI9CH0UbuaA2JCOM cCNq8SyYbTqgnWlB9ZfcAm/cFpA8tYci9m5vYK8HNxQr+8FS3Qo8N9RJ8d0U5Csw DzMYfRghAfUGwmlWj5hp1pQzAuhwbOXFtxKHVsMPhz1IBtF9Y8jvgqgYHLbmyiu1 mwJ5AL0pYF0G7x81prlARURwHo0Yf52kEw1dxpx+JXER7hQRWQki5/NsUEtv+8RT qn2m6qte5DXLyn83b1qRscSdnCCwKtKWUug5q2ZbwVOCJCtmRwmnP131lWRYfj67 B/xJ1ZA6X3GEf4sNReNAtaucPEelgR2nsN0gKQKBiGoqHWbK1qYvBxX2X3kbPDkv 9C+celgZd2PW7aGYLCHq7nPbmfDV0yHcWjOhXZ8jRMjmANVR/eLQ2EfsRLdW69bn f3ZD7JS1fwGnO3exGmHO3HZG+6AvberKYVYNHahNFEw5TsAcQWDLRpkGybBcxqZo 81YCqlqidwfeO5YtlO7etx1xLyqa2NsCeG9A86UjG+aeNnXEIDk1PDK+EuiThIUa /2IxKzJKWl1BKr2d4xAfR0ZnEYuRrbeDQYgTImOlfW6/GuYIxKYgEKCFHFqJATAG IxHrq1PDOiSwXd2GmVVYyEmhZnbcp8CxaEMQoevxAta0ssMK3w6UsDtvUvYvF22m qQKBiD5GwESzsFPy3Ga0MvZpn3D6EJQLgsnrtUPZx+z2Ep2x0xc5orneB5fGyF1P WtP+fG5Q6Dpdz3LRfm+KwBCWFKQjg7uTxcjerhBWEYPmEMKYwTJF5PBG9/ddvHLQ EQeNC8fHGg4UXU8mhHnSBt3EA10qQJfRDs15M38eG2cYwB1PZpDHScDnDA0= -----END RSA PRIVATE KEY----- A.2. Example keyId Valuesmaterial chosen by the signer. Thetable below mapssigner then encodes the result of that operation as a base 64-encoded string [RFC4648]. This string is the signature value. For the non-normative example"keyId" values to associated algorithms and/or keys. These areSignature metadata in Section 3.2.1 and Signature Input in Figure 1, the corresponding signature value is: K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUeZx/Kdrq32DrfakQ6b PsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibeoHyqU/yCjphSmEdd7WD+z rchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4CaB8X/I5/+HLZLGvDiezqi6/7 p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg1Q7MpWYZs0soHjttq0uLIA3DIbQfL iIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZgFquQrXRlmYOh+Hx5D9fJkXcXe5tmAg== Figure 2: Non-normative examplemappingssignature value 3.3. Verifying a Signature In order to verify a signature, a verifier MUST: 1. Examine the signature's metadata to confirm that the signature meets the requirements described in this document, as well as any additional requirements defined by the application such as which header fields or other content arevalid only withinrequired to be covered by the signature. 2. Use the received HTTP message and thecontext of examplessignature's metadata to recreate the Signature Input, using the process described inexamples withinSection 3.2.2. The value of the "@signature-params" input is the value of the signature input header field for this signature, not including the signature's label. 3. Use the signature's Algorithm and Verification Key Material with the recreated Signing Input to verify the signature value. A signature with a Creation Time that is in the futuredocumentsor an Expiration Time thatreference this section. Unless otherwise specified, withinis in thecontext of examples it shouldpast MUST NOT beassumedprocessed. The verifier MUST ensure that a signature's Algorithm is appropriate for the key material thesigner andverifierunderstand these "keyId" mappings. These "keyId" values are not reserved, and deployments are free towill usethem, with these associations or others. +============+=================================+================+ | keyId |to verify the signature. If the Algorithm| Verification | | | | Key | +============+=================================+================+ | test-key-a | "hs2019", using RSASSA-PSS | The publicis not appropriate for the key| | | [RFC8017] and SHA-512 [RFC6234] | specifiedmaterial (for example, if it is the wrong size, or in| | | | Appendix A.1.1 | +------------+---------------------------------+----------------+ | test-key-b | rsa-sha256 |the wrong format), the signature MUST NOT be processed. 3.3.1. Enforcing Application Requirements Thepublic key | | | |verification requirements specified in| | | | Appendix A.1.1 | +------------+---------------------------------+----------------+ Table 7 A.3. Test Cases This section providesthis document are intended as a baseline set of restrictions that are generally applicable to all use cases. Applications using HTTP Message Signatures MAY impose requirements above and beyond those specified by this document, as appropriate for their use case. Some non-normative examplesthat mayof additional requirements an application might define are: * Requiring a specific set of header fields to beused as test casessigned (e.g., Authorization, Digest). * Enforcing a maximum signature age. * Prohibiting the use of certain algorithms, or mandating the use of an algorithm. * Requiring keys tovalidate implementation correctness. These examplesbe of a certain size (e.g., 2048 bits vs. 1024 bits). Application-specific requirements arebased onexpected and encouraged. When an application defines additional requirements, it MUST enforce them during thefollowing HTTP message: POST /foo?param=value&pet=dog HTTP/1.1 Host: example.com Date: Tue, 07 Jun 2014 20:51:35 GMT Content-Type: application/json Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Content-Length: 18 {"hello": "world"} A.3.1. Signature Generation A.3.1.1. hs2019signatureover minimal recommended content This presents metadata for a Signature using "hs2019", over minimum recommended dataverification process, and signature verification MUST fail if the signature does not conform tosign: +==============+===================================+ | Property | Value | +==============+===================================+ | Algorithm | "hs2019", using RSASSA-PSS | | | [RFC8017] using SHA-512 [RFC6234] | +--------------+-----------------------------------+ | Covered | *created, *request-target | | Content | | +--------------+-----------------------------------+ | Creation | 8:51:35 PM GMT, June 7th, 2014 | | Time | | +--------------+-----------------------------------+ | Expiration | Undefined | | Time | | +--------------+-----------------------------------+ | Verification | The public key specifiedthe application's requirements. Applications MUST enforce the requirements defined in| | Key Material | Appendix A.1.1. | +--------------+-----------------------------------+ Table 8 The Signature Input is: *created: 1402170695 *request-target: post /foo?param=value&pet=dog The signature value is: QaVaWYfF2da6tG66Xtd0GrVFChJ0fOWUe/C6kaYESPiYYwnMH9egOgyKqgLLY9NQJFk7b QY834sHEUwjS5ByEBaO3QNwIvqEY1qAAU/2MX14tc9Yn7ELBnaaNHaHkV3xVO9KIuLT7V 6e4OUuGb1axfbXpMgPEql6CEFrn6K95CLuuKP5/gOEcBtmJp5L58gN4VvZrk2OVA6U971 YiEDNuDa4CwMcQMvcGssbc/L3OULTUffD/1VcPtdGImP2uvVQntpT8b2lBeBpfh8MuaV2 vtzidyBYFtAUoYhRWO8+ntqA1q2OK4LMjM2XgDScSVWvGdVd459A0wI9lRlnPap3zg== A possiblethis document. Regardless of use case, applications MUST NOT accept signatures that do not conform to these requirements. 4. Including a Message Signature in a Message Message signatures can be included within an HTTP message via the "Signature-Input" and "Signature" HTTP headercontainingfields, both defined within this specification. The "Signature" HTTP header field contains signatureis: Signature-Input: sig1=(*created, *request-target); keyId="test-key-a"; created=1402170695 Signature: sig1=:QaVaWYfF2da6tG66Xtd0GrVFChJ0fOWUe/C6kaYESPiYYwnMH9eg OgyKqgLLY9NQJFk7bQY834sHEUwjS5ByEBaO3QNwIvqEY1qAAU/2MX14tc9Yn7ELB naaNHaHkV3xVO9KIuLT7V6e4OUuGb1axfbXpMgPEql6CEFrn6K95CLuuKP5/gOEcB tmJp5L58gN4VvZrk2OVA6U971YiEDNuDa4CwMcQMvcGssbc/L3OULTUffD/1VcPtd GImP2uvVQntpT8b2lBeBpfh8MuaV2vtzidyBYFtAUoYhRWO8+ntqA1q2OK4LMjM2X gDScSVWvGdVd459A0wI9lRlnPap3zg==: A.3.1.2. hs2019values, while the "Signature-Input" HTTP header field identifies the Covered Content and metadata that describe how each signaturecovering allwas generated. 4.1. The 'Signature-Input' HTTP Header The "Signature-Input" HTTP headerfields This presentsfield is a Dictionary Structured Header [RFC8941] containing the metadata for zero or more message signatures generated from content within the HTTP message. Each member describes aSignature using "hs2019"single message signature. The member's name is an identifier thatcovers all header fields inuniquely identifies therequest: +==============+========================================+ | Property | Value | +==============+========================================+ | Algorithm | "hs2019", using RSASSA-PSS [RFC8017] | | | using SHA-512 [RFC6234] | +--------------+----------------------------------------+ | Covered | *created, *request-target, host, date, | | Content | content-type, digest, content-length | +--------------+----------------------------------------+ | Creation | 8:51:35 PM GMT, June 7th, 2014 | | Time | | +--------------+----------------------------------------+ | Expiration | Undefined | | Time | | +--------------+----------------------------------------+ | Verification |message signature within the context of the HTTP message. Thepublic key specifiedmember's value is the serialization of the covered content including all signature metadata parameters, described in| | Key Material | Appendix A.1.1. | +--------------+----------------------------------------+ Table 9 The Signature Input is: *created: 1402170695 *request-target: post /foo?param=value&pet=dog host: example.com date: Tue, 07 Jun 2014 20:51:35 GMT content-type: application/json digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= content-length: 18 TheSection 3.1. Signature-Input: sig1=("@request-target" "host" "date" "cache-control" "x-empty-header" "x-example"); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170995 To facilitate signaturevalue is: B24UG4FaiE2kSXBNKV4DA91J+mElAhS3mncrgyteAye1GKMpmzt8jkHNjoudtqw3GngGY 3n0mmwjdfn1eA6nAjgeHwl0WXced5tONcCPNzLswqPOiobGeA5y4WE8iBveel30OKYVel 0lZ1OnXOmN5TIEIIPo9LrE+LzZis6A0HA1FRMtKgKGhT3N965pkqfhKbq/V48kpJKT8+c Zs0TOn4HFMG+OIy6c9ofSBrXD68yxP6QYTz6xH0GMWawLyPLYR52j3I05fK1ylAb6K0ox PxzQ5nwrLD+mUVPZ9rDs1En6fmOX9xfkZTblG/5D+s1fHHs9dDXCOVkT5dLS8DjdIA== A possiblevalidation, the "Signature-Input"and "Signature"headercontaining thisMUST contain the same serialization value used in generating the signatureis: Signature-Input: sig1=(*request-target, *created, host, date, content-type, digest, content-length); keyId="test-key-a"; alg=hs2019; created=1402170695 Signature: sig1=:B24UG4FaiE2kSXBNKV4DA91J+mElAhS3mncrgyteAye1GKMpmzt8 jkHNjoudtqw3GngGY3n0mmwjdfn1eA6nAjgeHwl0WXced5tONcCPNzLswqPOiobGe A5y4WE8iBveel30OKYVel0lZ1OnXOmN5TIEIIPo9LrE+LzZis6A0HA1FRMtKgKGhT 3N965pkqfhKbq/V48kpJKT8+cZs0TOn4HFMG+OIy6c9ofSBrXD68yxP6QYTz6xH0G MWawLyPLYR52j3I05fK1ylAb6K0oxPxzQ5nwrLD+mUVPZ9rDs1En6fmOX9xfkZTbl G/5D+s1fHHs9dDXCOVkT5dLS8DjdIA==: A.3.2. Signature Verification A.3.2.1. Minimal Required Signatureinput. 4.2. The 'Signature' HTTP HeaderThis presents a "Signature-Input" andThe "Signature" HTTP header field is a Dictionary Structured Header [RFC8941] containingonlyzero or more message signatures generated from content within theminimal required parameters: Signature-Input: sig1=(); keyId="test-key-a"; created=1402170695 Signature: sig1=:cxieW5ZKV9R9A70+Ua1A/1FCvVayuE6Z77wDGNVFSiluSzR9TYFV vwUjeU6CTYUdbOByGMCee5q1eWWUOM8BIH04Si6VndEHjQVdHqshAtNJk2Quzs6WC 2DkV0vysOhBSvFZuLZvtCmXRQfYGTGhZqGwq/AAmFbt5WNLQtDrEe0ErveEKBfaz+ IJ35zhaj+dun71YZ82b/CRfO6fSSt8VXeJuvdqUuVPWqjgJD4n9mgZpZFGBaDdPiw pfbVZHzcHrumFJeFHWXH64a+c5GN+TWlP8NPg2zFdEc/joMymBiRelq236WGm5VvV 9a22RW2/yLmaU/uwf9v40yGR/I1NRA==: The correspondingHTTP message. Each member's name is a signaturemetadata derived from this header field is: +=================+==========================================+ | Property | Value | +=================+==========================================+ | Algorithm | "hs2019", using RSASSA-PSS using SHA-256 | +-----------------+------------------------------------------+ | Covered Content | *created | +-----------------+------------------------------------------+ | Creation Time | 8:51:35 PM GMT, June 7th, 2014 | +-----------------+------------------------------------------+ | Expiration Time | Undefined | +-----------------+------------------------------------------+ | Verification | The public key specifiedidentifier that is present as a member name in| | Key Material | Appendix A.1.1. | +-----------------+------------------------------------------+ Table 10 The corresponding Signature Input is: *created: 1402170695 A.3.2.2. Minimal Recommended Signaturethe "Signature-Input" Structured HeaderThis presentswithin the HTTP message. Each member's value is a"Signature-Input" and "Signature" headerByte Sequence containingonlytheminimal required and recommended parameters: Signature-Input: sig1=(); alg=hs2019; keyId="test-key-a"; created=1402170695 Signature: sig1=:cxieW5ZKV9R9A70+Ua1A/1FCvVayuE6Z77wDGNVFSiluSzR9TYFV vwUjeU6CTYUdbOByGMCee5q1eWWUOM8BIH04Si6VndEHjQVdHqshAtNJk2Quzs6WC 2DkV0vysOhBSvFZuLZvtCmXRQfYGTGhZqGwq/AAmFbt5WNLQtDrEe0ErveEKBfaz+ IJ35zhaj+dun71YZ82b/CRfO6fSSt8VXeJuvdqUuVPWqjgJD4n9mgZpZFGBaDdPiw pfbVZHzcHrumFJeFHWXH64a+c5GN+TWlP8NPg2zFdEc/joMymBiRelq236WGm5VvV 9a22RW2/yLmaU/uwf9v40yGR/I1NRA==: The correspondingsignaturemetadata derived from this header field is: +=================+==========================================+ | Property | Value | +=================+==========================================+ | Algorithm | "hs2019", using RSASSA-PSS using SHA-512 | +-----------------+------------------------------------------+ | Covered Content | *created | +-----------------+------------------------------------------+ | Creation Time | 8:51:35 PM GMT, June 7th, 2014 | +-----------------+------------------------------------------+ | Expiration Time | Undefined | +-----------------+------------------------------------------+ | Verification | The public key specifiedvalue for the message signature identified by the member name. Any member in| | Key Material | Appendix A.1.1. | +-----------------+------------------------------------------+ Table 11 Thethe "Signature" HTTP header field that does not have a correspondingSignature Input is: *created: 1402170695 A.3.2.3. Minimal Signature Header using rsa-sha256 This presentsmember in the HTTP message's "Signature-Input" HTTP header field MUST be ignored. Signature: sig1=:K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUe\ Zx/Kdrq32DrfakQ6bPsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibe\ oHyqU/yCjphSmEdd7WD+zrchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4\ CaB8X/I5/+HLZLGvDiezqi6/7p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg\ 1Q7MpWYZs0soHjttq0uLIA3DIbQfLiIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZg\ FquQrXRlmYOh+Hx5D9fJkXcXe5tmAg==: 4.3. Examples The following is aminimalnon-normative example of "Signature-Input" and "Signature" HTTP headerforfields representing the signature in Figure 2: # NOTE: '\' line wrapping per RFC 8792 Signature-Input: sig1=("@request-target" "host" "date" "cache-control" "x-empty-header" "x-example"); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170995 Signature: sig1=:K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUe\ Zx/Kdrq32DrfakQ6bPsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibe\ oHyqU/yCjphSmEdd7WD+zrchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4\ CaB8X/I5/+HLZLGvDiezqi6/7p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg\ 1Q7MpWYZs0soHjttq0uLIA3DIbQfLiIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZg\ FquQrXRlmYOh+Hx5D9fJkXcXe5tmAg==: Since "Signature-Input" and "Signature" are both defined as Dictionary Structured Headers, they can be used to easily include multiple signatures within the same HTTP message. For example, a signer may include multiple signatures signing the same content with different keys and/or algorithms to support verifiers with different capabilities, or a reverse proxy may include information about the client in header fields when forwarding the request to a service host, and may also include a signatureusingover those fields and the"rsa-sha256" algorithm: Signature: sig1=(date); alg=rsa-sha256; keyId="test-key-b" Signature: sig1=:HtXycCl97RBVkZi66ADKnC9c5eSSlb57GnQ4KFqNZplOpNfxqk62 JzZ484jXgLvoOTRaKfR4hwyxlcyb+BWkVasApQovBSdit9Ml/YmN2IvJDPncrlhPD VDv36Z9/DiSO+RNHD7iLXugdXo1+MGRimW1RmYdenl/ITeb7rjfLZ4b9VNnLFtVWw rjhAiwIqeLjodVImzVc5srrk19HMZNuUejK6I3/MyN3+3U8tIRW4LWzx6ZgGZUaEE P0aBlBkt7Fj0Tt5/P5HNW/Sa/m8smxbOHnwzAJDa10PyjzdIbywlnWIIWtZKPPsoV oKVopUWEU3TNhpWmaVhFrUL/O6SN3w==:client's signature. Thecorresponding signature metadata derived from thisfollowing is a non-normative example of headerfield is: +===========================+==========================+ | Property | Value | +===========================+==========================+ | Algorithm | rsa-sha256 | +---------------------------+--------------------------+ | Covered Content | date | +---------------------------+--------------------------+ | Creation Time | Undefined | +---------------------------+--------------------------+ | Expiration Time | Undefined | +---------------------------+--------------------------+ | Verification Key Material | The public key specified | | |fields a reverse proxy might add to a forwarded request that contains the signature inAppendix A.1.1. | +---------------------------+--------------------------+ Table 12 The correspondingthe above example: # NOTE: '\' line wrapping per RFC 8792 X-Forwarded-For: 192.0.2.123 Signature-Input: reverse_proxy_sig=("host" "date" "signature";key=sig1 "x-forwarded-for"); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170695 Signature: reverse_proxy_sig=:ON3HsnvuoTlX41xfcGWaOEVo1M3bJDRBOp0Pc/O\ jAOWKQn0VMY0SvMMWXS7xG+xYVa152rRVAo6nMV7FS3rv0rR5MzXL8FCQ2A35DCEN\ LOhEgj/S1IstEAEFsKmE9Bs7McBsCtJwQ3hMqdtFenkDffSoHOZOInkTYGafkoy78\ l1VZvmb3Y4yf7McJwAvk2R3gwKRWiiRCw448Nt7JTWzhvEwbh7bN2swc/v3NJbg/w\ JYyYVbelZx4IywuZnYFxgPl/qvqbAjeEVvaLKLgSMr11y+uzxCHoMnDUnTYhMrmOT\ 4O8lBLfRFOcoJPKBdoKg9U0a96U2mUug1bFOozEVYFg==: 5. IANA Considerations 5.1. HTTP SignatureInput is: date: Tue, 07 Jun 2014 20:51:35 GMT Appendix B. TopicsAlgorithms Registry This document defines HTTP Signature Algorithms, forWorking Group Discussion _RFC EDITOR: please remove this section before publication_ The draft has known issues that will needwhich IANA is asked tobe addressed during development,create andthese issues have been enumerated but not addressed inmaintain a new registry titled "HTTP Signature Algorithms". Initial values for thisversion. Topicsregistry arenot listedgiven inany particular order. B.1. Issues B.1.1. Confusing guidance on algorithmSection 5.1.2. Future assignments andkey identification The current draft encourages determiningmodifications to existing assignment are to be made through theAlgorithm metadata property fromExpert Review registration policy [RFC8126] and shall follow the"keyId" field, bothtemplate presented inthe guidanceSection 5.1.1. 5.1.1. Registration Template Algorithm Name: An identifier for theuseHTTP Signature Algorithm. The name MUST be an ASCII string consisting only of"algorithm" and "keyId",lower-case characters (""a"" - ""z""), digits (""0"" - ""9""), andthe definition for the "hs2019" algorithmhyphens (""-""), anddeprecation of the other algorithmsSHOULD NOT exceed 20 characters inthe registry.length. Thecurrent state arose from concern that a malicious party could changeidentifier MUST be unique within thevaluecontext of the"algorithm" parameter, potentially tricking the verifier into accepting a signature that would not have been verified under the actual parameter. Punting algorithm identification into "keyId" hurts interoperability, since we aren't defining the syntax or semanticsregistry. Status: A brief text description of"keyId". It actually goes against that claim, as we are dictating that the signing algorithm must be specified by "keyId" or derivable from it. It also rendersthealgorithm registry essentially useless. Insteadstatus ofthis approach, we can protect against manipulationthe algorithm. The description MUST begin with one of "Active" or "Deprecated", and MAY provide further context or explanation as to theSignature header field by adding supportreason for(and possibly mandating) including Signature metadata within the Signature Input. B.1.2. Lack of definition of keyId hurts interoperability The current text leavestheformat and semanticsstatus. Description: A description of"keyId" completely up totheimplementation. This is primarily duealgorithm used to sign thefact that most implementers of Cavage have extensive investment in key distribution and management, and just need to plugsigning string when generating anidentifier intoHTTP Message Signature, or instructions on how to determine that algorithm. When theheader. We should support those cases, but we also needdescription specifies an algorithm, it MUST include a reference toprovide guidance forthedeveloperdocument or documents thatdoesn't havedefine the algorithm. 5.1.2. Initial Contents (( MS: The references in this section are problematic as many of the specifications thatand just wantsthey refer toknow howare too implementation specific, rather than just pointing toidentify a key. It maythe proper signature and hashing specifications. A better approach might beenough to punt thisjust specifying the signature and hashing function specifications, leaving implementers toprofiling specs, but this needsconnect the dots (which are not that hard tobe explored more. B.1.3.connect). )) 5.1.2.1. hs2019 AlgorithmRegistry duplicates work of JWA [RFC7518] already defines an IANA registry for cryptographic algorithms.Name: "hs2019" Status: active Description: Derived from metadata associated with keyid. Recommend support for: * RSASSA-PSS [RFC8017] using SHA-512 [RFC6234] * HMAC [RFC2104] using SHA-512 [RFC6234] * ECDSA using curve P-256 DSS [FIPS186-4] and SHA-512 [RFC6234] * Ed25519ph, Ed25519ctx, and Ed25519 [RFC8032] 5.1.2.2. rsa-sha1 Algorithm Name: "rsa-sha1" Status: Deprecated; SHA-1 not secure. Description: RSASSA-PKCS1-v1_5 [RFC8017] using SHA-1 [RFC6234] 5.1.2.3. rsa-sha256 Algorithm Name: "rsa-sha256" Status: Deprecated; specifying signature algorithm enables attack vector. Description: RSASSA-PKCS1-v1_5 [RFC8017] using SHA-256 [RFC6234] 5.1.2.4. hmac-sha256 Algorithm Name: "hmac-sha256" Status: Deprecated; specifying signature algorithm enables attack vector. Description: HMAC [RFC2104] using SHA-256 [RFC6234] 5.1.2.5. ecdsa-sha256 Algorithm Name: "ecdsa-sha256" Status: Deprecated; specifying signature algorithm enables attack vector. Description: ECDSA using curve P-256 DSS [FIPS186-4] and SHA-256 [RFC6234] 5.2. HTTP Signature Metadata Parameters Registry Thiswasn't used by Cavage out of concernsdocument defines the "Signature-Input" Structured Header, whose member values may have parameters containing metadata aboutcomplexity of JOSE, and issues with JWEa message signature. IANA is asked to create andJWS being too flexible, leadingmaintain a new registry titled "HTTP Signature Metadata Parameters" toinsecure combinationsrecord and maintain the set ofoptions. Using JWA's definitions does not need to mean we're using JOSE, however. We should look at if/how we can leverage JWA's work without introducing too many sharp edgesparameters defined forimplementers. In anyuseof JWS algorithms,with member values in the "Signature-Input" Structured Header. Initial values for thisspec would define a wayregistry are given in Section 5.2.2. Future assignments and modifications tocreate the JWS Signing Input stringexisting assignments are to beapplied tomade through thealgorithm. It should be noted that this is incompatible with JWS itself, which requiresExpert Review registration policy [RFC8126] and shall follow theinclusion of a structured headertemplate presented in Section 5.2.1. 5.2.1. Registration Template 5.2.2. Initial Contents The table below contains thesignature input. A possible approach is to incorporate all elementsinitial contents of theJWA signature algorithm registry into this spec using a prefix or other marker, such as "jws-RS256" for the RSA 256 JSON WebHTTP Signaturealgorithm. B.1.4. Algorithm Registry should not be initialized with deprecated entries The initial entries in this document reflect thoseMetadata Parameters Registry. Each row inCavage. The ones that are marked deprecated were done so because oftheissue explainedtable represents a distinct entry inAppendix B.1.1, withthepossible exceptionregistry. +=========+========+==============================+ | Name | Status | Reference(s) | +=========+========+==============================+ | alg | Active | Section 3.1 of this document | +---------+--------+------------------------------+ | created | Active | Section 3.1 of this document | +---------+--------+------------------------------+ | expires | Active | Section 3.1 of this document | +---------+--------+------------------------------+ | keyid | Active | Section 3.1 of this document | +---------+--------+------------------------------+ Table 7: Initial contents of"rsa- sha1". We should probably just remove that one. B.1.5. No percent-encoding normalization of path/query See: issue #26 (https://github.com/w3c-dvcg/http-signatures/ issues/26) The canonicalization rulesthe HTTP Signature Metadata Parameters Registry. 5.3. HTTP Signature Specialty Content Identifiers Registry This document defines a method for"*request-target" do not perform handle minor, semantically meaningless differences in percent- encoding, suchcanonicalizing HTTP message content, including content thatverification could fail if an intermediary normalizescan be generated from theeffective request URI prior to forwardingcontext of themessage. AtHTTP message outside of the HTTP headers. This content is identified by aminimum, they should be caseunique key. IANA is asked to create andpercent-encoding normalized as described in sections 6.2.2.1maintain a new registry typed "HTTP Signature Specialty Content Identifiers" to record and6.2.2.2maintain the set of[RFC3986]. B.1.6. Misleading name for headers parameter The Covered Content list containsnon-header content identifiers and their canonicalization method. Initial values formore than just headers, so the "header" parameter name is no longer appropriate. Some alternatives: "content", "signed-content", "covered-content". B.1.7. Changes to whitespacethis registry are given inheader field values break verification Some header field values contain RWS, OWS, and/or BWS. Since the header field value canonicalization rules do not address whitespace, changes to it (e.g., removing OWS or BWS or replacing strings of RWS with a single space) can cause verificationSection 5.3.2. Future assignments and modifications tofail. B.1.8. Multiple Set-Cookie headersexisting assignments arenot well supported The Set-Cookie header can occur multiple times but does not adhereto be made through thelist syntax,Expert Review registration policy [RFC8126] andthus is not well supported byshall follow theheader field value concatenation rules. B.1.9. Covered Content list is not signedtemplate presented in Section 5.3.1. 5.3.1. Registration Template 5.3.2. Initial Contents TheCovered Content list should be parttable below contains the initial contents of the HTTP SignatureInput, to protect against malicious changes. B.1.10. Algorithm is not signed The Algorithm should be partSpecialty Content Identifiers Registry. +===================+========+================================+ | Name | Status | Reference(s) | +===================+========+================================+ | @request-target | Active | Section 2.4.1 of this document | +-------------------+--------+--------------------------------+ | @signature-params | Active | Section 2.4.2 of this document | +-------------------+--------+--------------------------------+ Table 8: Initial contents of the HTTP SignatureInput,Specialty Content Identifiers Registry. 6. Security Considerations (( TODO: need toprotect against malicious changes. B.1.11. Verification key identifier isdive deeper on this section; not sure how much of what's referenced below is actually applicable, or if it covers everything we need to worry about. )) (( TODO: Should provide some recommendations on how to determine what content needs to be signedThe Verification key identifier (e.g., the value usedforthe "keyId" parameter) should be parta given use case. )) There are a number ofthe Signature Input,security considerations toprotect against malicious changes. B.1.12. Max values, precisiontake into account when implementing or utilizing this specification. A thorough security analysis of this protocol, including its strengths and weaknesses, can be found in [WP-HTTP-Sig-Audit]. 7. References 7.1. Normative References [FIPS186-4] "Digital Signature Standard (DSS)", 2013, <https://csrc.nist.gov/publications/detail/fips/186/4/ final>. [HTTP2] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext Transfer Protocol Version 2 (HTTP/2)", RFC 7540, DOI 10.17487/RFC7540, May 2015, <https://www.rfc-editor.org/rfc/rfc7540>. [MESSAGING] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing", RFC 7230, DOI 10.17487/RFC7230, June 2014, <https://www.rfc-editor.org/rfc/rfc7230>. [POSIX.1] "The Open Group Base Specifications Issue 7, 2018 edition", 2018, <https://pubs.opengroup.org/onlinepubs/9699919799/>. [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- Hashing for Message Authentication", RFC 2104, DOI 10.17487/RFC2104, February 1997, <https://www.rfc-editor.org/rfc/rfc2104>. [RFC2119] Bradner, S., "Key words forInteger Stringuse in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/rfc/rfc2119>. [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/rfc/rfc8174>. [RFC8792] Watsen, K., Auerswald, E., Farrel, A., and Q. Wu, "Handling Long Lines in Content of Internet-Drafts and RFCs", RFC 8792, DOI 10.17487/RFC8792, June 2020, <https://www.rfc-editor.org/rfc/rfc8792>. [RFC8941] Nottingham, M. andDecimal String not defined The definitionsP-H. Kamp, "Structured Field Values forInteger StringHTTP", RFC 8941, DOI 10.17487/RFC8941, February 2021, <https://www.rfc-editor.org/rfc/rfc8941>. [SEMANTICS] Fielding, R., Ed. andDecimal String do not specify a maximum value. The definition for Decimal String (used to provide sub-second precision for Expiration Time) does not define minimum or maximum precision requirements. It should set a sane requirement here (e.g., MUST support up to 3 decimal placesJ. Reschke, Ed., "Hypertext Transfer Protocol (HTTP/1.1): Semantics andno more). B.1.13. keyId parameter value could break list syntax The "keyId" parameter value needs to be constrained so as to not break list syntax (e.g., by containing a comma). B.1.14. Creation TimeContent", RFC 7231, DOI 10.17487/RFC7231, June 2014, <https://www.rfc-editor.org/rfc/rfc7231>. 7.2. Informative References [RFC4648] Josefsson, S., "The Base16, Base32, andExpiration Time do not allowBase64 Data Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, <https://www.rfc-editor.org/rfc/rfc4648>. [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, DOI 10.17487/RFC6234, May 2011, <https://www.rfc-editor.org/rfc/rfc6234>. [RFC7239] Petersson, A. and M. Nilsson, "Forwarded HTTP Extension", RFC 7239, DOI 10.17487/RFC7239, June 2014, <https://www.rfc-editor.org/rfc/rfc7239>. [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, "PKCS #1: RSA Cryptography Specifications Version 2.2", RFC 8017, DOI 10.17487/RFC8017, November 2016, <https://www.rfc-editor.org/rfc/rfc8017>. [RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital Signature Algorithm (EdDSA)", RFC 8032, DOI 10.17487/RFC8032, January 2017, <https://www.rfc-editor.org/rfc/rfc8032>. [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines forclock skew The processing instructionsWriting an IANA Considerations Section in RFCs", BCP 26, RFC 8126, DOI 10.17487/RFC8126, June 2017, <https://www.rfc-editor.org/rfc/rfc8126>. [TLS] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, <https://www.rfc-editor.org/rfc/rfc8446>. [WP-HTTP-Sig-Audit] "Security Considerations forCreation Time and Expiration Time imply that verifiers are not permittedHTTP Signatures", 2013, <https://web-payments.org/specs/source/http-signatures- audit/>. Appendix A. Detecting HTTP Message Signatures There have been many attempts toaccount for clock skew during signature verification. B.1.15. Should require lowercased header field names as identifiers The current text allows mixed-casecreate signed HTTP messages in the past, including other non-standard definitions of the "Signature" headerfield names when they are beingusedas content identifiers. Thiswithin this specification. It isunnecessary, as header field names are case-insensitive,recommended that developers wishing to support both this specification andcreates opportunity for incompatibility. Instead, content identifiers should always be lowercase. B.1.16. Reconcile Date headerother historial drafts do so carefully andCreation Time The draftdeliberately, as incompatibilities between this specification and various versions of other drafts could lead to problems. It ismissing guidance on if/howrecommended that implementers first detect and validate theDate"Signature-Input" headerrelates to signature Creation Time. There are cases where they may be different, such as if a signature was pre-created. Should Creation Time defaultdefined in this specification tothe valuedetect that this standard is in use and not an alternative. If theDate"Signature- Input" headerif the "created" parameterisnot specified? B.1.17. Remove algorithm-specific rules for content identifiers The rules that restrict when the signerpresent, all "Signature" headers canor must include certain identifiers appear toberelatedparsed and interpreted in the context of this draft. Appendix B. Examples B.1. Example Keys This section provides cryptographic keys that are referenced in example signatures throughout this document. These keys MUST NOT be used for any purpose other than testing. B.1.1. Example Key RSA test The following key is a 2048-bit RSA public and private key pair: -----BEGIN RSA PUBLIC KEY----- MIIBCgKCAQEAhAKYdtoeoy8zcAcR874L8cnZxKzAGwd7v36APp7Pv6Q2jdsPBRrw WEBnez6d0UDKDwGbc6nxfEXAy5mbhgajzrw3MOEt8uA5txSKobBpKDeBLOsdJKFq MGmXCQvEG7YemcxDTRPxAleIAgYYRjTSd/QBwVW9OwNFhekro3RtlinV0a75jfZg kne/YiktSvLG34lw2zqXBDTC5NHROUqGTlML4PlNZS5Ri2U4aCNx2rUPRcKIlE0P uKxI4T+HIaFpv8+rdV6eUgOrB2xeI1dSFFn/nnv5OoZJEIB+VmuKn3DCUcCZSFlQ PSXSfBDiUGhwOw76WuSSsf1D4b/vLoJ10wIDAQAB -----END RSA PUBLIC KEY----- -----BEGIN RSA PRIVATE KEY----- MIIEqAIBAAKCAQEAhAKYdtoeoy8zcAcR874L8cnZxKzAGwd7v36APp7Pv6Q2jdsP BRrwWEBnez6d0UDKDwGbc6nxfEXAy5mbhgajzrw3MOEt8uA5txSKobBpKDeBLOsd JKFqMGmXCQvEG7YemcxDTRPxAleIAgYYRjTSd/QBwVW9OwNFhekro3RtlinV0a75 jfZgkne/YiktSvLG34lw2zqXBDTC5NHROUqGTlML4PlNZS5Ri2U4aCNx2rUPRcKI lE0PuKxI4T+HIaFpv8+rdV6eUgOrB2xeI1dSFFn/nnv5OoZJEIB+VmuKn3DCUcCZ SFlQPSXSfBDiUGhwOw76WuSSsf1D4b/vLoJ10wIDAQABAoIBAG/JZuSWdoVHbi56 vjgCgkjg3lkO1KrO3nrdm6nrgA9P9qaPjxuKoWaKO1cBQlE1pSWp/cKncYgD5WxE CpAnRUXG2pG4zdkzCYzAh1i+c34L6oZoHsirK6oNcEnHveydfzJL5934egm6p8DW +m1RQ70yUt4uRc0YSor+q1LGJvGQHReF0WmJBZHrhz5e63Pq7lE0gIwuBqL8SMaA yRXtK+JGxZpImTq+NHvEWWCu09SCq0r838ceQI55SvzmTkwqtC+8AT2zFviMZkKR Qo6SPsrqItxZWRty2izawTF0Bf5S2VAx7O+6t3wBsQ1sLptoSgX3QblELY5asI0J YFz7LJECgYkAsqeUJmqXE3LP8tYoIjMIAKiTm9o6psPlc8CrLI9CH0UbuaA2JCOM cCNq8SyYbTqgnWlB9ZfcAm/cFpA8tYci9m5vYK8HNxQr+8FS3Qo8N9RJ8d0U5Csw DzMYfRghAfUGwmlWj5hp1pQzAuhwbOXFtxKHVsMPhz1IBtF9Y8jvgqgYHLbmyiu1 mwJ5AL0pYF0G7x81prlARURwHo0Yf52kEw1dxpx+JXER7hQRWQki5/NsUEtv+8RT qn2m6qte5DXLyn83b1qRscSdnCCwKtKWUug5q2ZbwVOCJCtmRwmnP131lWRYfj67 B/xJ1ZA6X3GEf4sNReNAtaucPEelgR2nsN0gKQKBiGoqHWbK1qYvBxX2X3kbPDkv 9C+celgZd2PW7aGYLCHq7nPbmfDV0yHcWjOhXZ8jRMjmANVR/eLQ2EfsRLdW69bn f3ZD7JS1fwGnO3exGmHO3HZG+6AvberKYVYNHahNFEw5TsAcQWDLRpkGybBcxqZo 81YCqlqidwfeO5YtlO7etx1xLyqa2NsCeG9A86UjG+aeNnXEIDk1PDK+EuiThIUa /2IxKzJKWl1BKr2d4xAfR0ZnEYuRrbeDQYgTImOlfW6/GuYIxKYgEKCFHFqJATAG IxHrq1PDOiSwXd2GmVVYyEmhZnbcp8CxaEMQoevxAta0ssMK3w6UsDtvUvYvF22m qQKBiD5GwESzsFPy3Ga0MvZpn3D6EJQLgsnrtUPZx+z2Ep2x0xc5orneB5fGyF1P WtP+fG5Q6Dpdz3LRfm+KwBCWFKQjg7uTxcjerhBWEYPmEMKYwTJF5PBG9/ddvHLQ EQeNC8fHGg4UXU8mhHnSBt3EA10qQJfRDs15M38eG2cYwB1PZpDHScDnDA0= -----END RSA PRIVATE KEY----- B.2. Example keyid Values The table below maps example "keyid" values to associated algorithms and/or keys. These are example mappings that are valid only within thepseudo-revvingcontext ofthe Cavage draftexamples in examples within this and future documents thathappened whenreference this section. Unless otherwise specified, within the"hs2019" algorithm was introduced. We should drop these rules, ascontext of examples itcan be expected that anyone implementing this draft will support all content identifiers. B.1.18. Add guidance for signing compressed headers The draftshouldprovide guidance on how to sign headers when [RFC7541] is used. This guidance mightbeas simple as "sign the uncompressed header field value." B.1.19. Transformations to Via header field value break verification Intermediaries are permitted to strip comments fromassumed that the"Via" header field value,signer andconsolidate related sequences of entries. The canonicalization rules do not account forverifier understand thesechanges, and thus they cause signature verification to fail if the "Via" header is signed. At the very least, guidance on signing or not signing "Via" headers needs to be included. B.1.20. Case changes to case-insensitive header field values break verification Some header field"keyid" mappings. These "keyid" values arecase-insensitive, in wholenot reserved, and deployments are free to use them, with these associations or others. +============+=================================+================+ | keyid | Algorithm | Verification | | | | Key | +============+=================================+================+ | test-key-a | "hs2019", using RSASSA-PSS | The public key | | | [RFC8017] and SHA-512 [RFC6234] | specified inpart.| | | | Appendix B.1.1 | +------------+---------------------------------+----------------+ | test-key-b | rsa-sha256 | Thecanonicalization rules do not account for this, thus a case change to a covered header field value causes verification to fail. B.1.21. Need more examples for Signature header Add morepublic key | | | | specified in | | | | Appendix B.1.1 | +------------+---------------------------------+----------------+ Table 9 B.3. Test Cases This section provides non-normative examplesshowing different cases e.g, where "created" or "expires" are not present. B.1.22. Expiration not needed In many cases, putting the expiration of the signature into the hands of the signer opens up more options for failures than necessary. Instead of the "expires", any verifier can use the "created" field and an internal lifetime or offset to calculate expiration. We should consider dropping the "expires" field. B.2. Features B.2.1. Define more content identifiers It shouldthat may bepossibleused as test cases toindependently includevalidate implementation correctness. These examples are based on the following HTTP message: POST /foo?param=value&pet=dog HTTP/1.1 Host: example.com Date: Tue, 07 Jun 2014 20:51:35 GMT Content-Type: application/json Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Content-Length: 18 {"hello": "world"} B.3.1. Signature Generation B.3.1.1. hs2019 signature over minimal recommended contentandThis presents metadataproperties in Covered Content: * The signature's Algorithm * The signature's Covered Content * The value usedforthe "keyId" parameter * Request method * Individual components of the effective request URI: scheme, authority, path, query * Status code * Request body (currently supported via Digest header [RFC3230] ) B.2.2. Multiple signature support (( Editor's note: I believe this use case is theoretical. Please let me know if this is a use case you have. )) There may be scenarios where attaching multiple signatures to a single message is useful: * A gateway attachesasignatureSignature using "hs2019", overheaders it adds (e.g., "Forwarded") to messages already signed by the user agent. * A signer attaches two signatures signed by different keys,minimum recommended data tobe verified by different entities. This could be addressed by changing thesign: +==============+===================================+ | Property | Value | +==============+===================================+ | Algorithm | "hs2019", using RSASSA-PSS | | | [RFC8017] using SHA-512 [RFC6234] | +--------------+-----------------------------------+ | Covered | @request-target | | Content | | +--------------+-----------------------------------+ | Creation | 8:51:35 PM GMT, June 7th, 2014 | | Time | | +--------------+-----------------------------------+ | Expiration | Undefined | | Time | | +--------------+-----------------------------------+ | Verification | The public key specified in | | Key Material | Appendix B.1.1. | +--------------+-----------------------------------+ Table 10 The Signatureheader syntax to accept a list of parameter sets for a single signature, e.g., by separating parameters with "";"" instead of "","". It may also be necessary to include aInput is: "@request-target": post /foo?param=value&pet=dog "@signature-params": ("@request-target"); keyid="test-key-a"; created=1402170695 The signatureidentifier parameter. B.2.3. Support for incremental signing of header fieldvaluelist items (( Editor's note: I believe this use case is theoretical. Please let me know if this is a use case you have. )) Currently, signing ais: QaVaWYfF2da6tG66Xtd0GrVFChJ0fOWUe/C6kaYESPiYYwnMH9egOgyKqgLLY9NQJFk7b QY834sHEUwjS5ByEBaO3QNwIvqEY1qAAU/2MX14tc9Yn7ELBnaaNHaHkV3xVO9KIuLT7V 6e4OUuGb1axfbXpMgPEql6CEFrn6K95CLuuKP5/gOEcBtmJp5L58gN4VvZrk2OVA6U971 YiEDNuDa4CwMcQMvcGssbc/L3OULTUffD/1VcPtdGImP2uvVQntpT8b2lBeBpfh8MuaV2 vtzidyBYFtAUoYhRWO8+ntqA1q2OK4LMjM2XgDScSVWvGdVd459A0wI9lRlnPap3zg== A possible "Signature-Input" and "Signature" headerfield value is all-or-nothing: either the entire value is signed, or none of it is. Forcontaining this signature is: # NOTE: '\' line wrapping per RFC 8792 Signature-Input: sig1=("@request-target"); keyid="test-key-a"; created=1402170695 Signature: sig1=:QaVaWYfF2da6tG66Xtd0GrVFChJ0fOWUe/C6kaYESPiYYwnMH9eg\ OgyKqgLLY9NQJFk7bQY834sHEUwjS5ByEBaO3QNwIvqEY1qAAU/2MX14tc9Yn7ELB\ naaNHaHkV3xVO9KIuLT7V6e4OUuGb1axfbXpMgPEql6CEFrn6K95CLuuKP5/gOEcB\ tmJp5L58gN4VvZrk2OVA6U971YiEDNuDa4CwMcQMvcGssbc/L3OULTUffD/1VcPtd\ GImP2uvVQntpT8b2lBeBpfh8MuaV2vtzidyBYFtAUoYhRWO8+ntqA1q2OK4LMjM2X\ gDScSVWvGdVd459A0wI9lRlnPap3zg==: B.3.1.2. hs2019 signature covering all header fields This presents metadata for a Signature using "hs2019" thatuse list syntax, it would be useful to be able to specify which itemscovers all header fields in thelist are signed.request: +==============+============================================+ | Property | Value | +==============+============================================+ | Algorithm | "hs2019", using RSASSA-PSS [RFC8017] using | | | SHA-512 [RFC6234] | +--------------+--------------------------------------------+ | Covered | "@request-target", "host", "date", | | Content | "content-type", "digest", "content-length" | +--------------+--------------------------------------------+ | Creation | 8:51:35 PM GMT, June 7th, 2014 | | Time | | +--------------+--------------------------------------------+ | Expiration | Undefined | | Time | | +--------------+--------------------------------------------+ | Verification | The public key specified in | | Key Material | Appendix B.1.1. | +--------------+--------------------------------------------+ Table 11 The Signature Input is: "@request-target": post /foo?param=value&pet=dog "host": example.com "date": Tue, 07 Jun 2014 20:51:35 GMT "content-type": application/json "digest": SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= "content-length": 18 "@signature-params": ("@request-target" "host" "date" "content-type" "digest" "content-length"); keyid="test-key-a"; alg="hs2019"; created=1402170695 The signature value is: B24UG4FaiE2kSXBNKV4DA91J+mElAhS3mncrgyteAye1GKMpmzt8jkHNjoudtqw3GngGY 3n0mmwjdfn1eA6nAjgeHwl0WXced5tONcCPNzLswqPOiobGeA5y4WE8iBveel30OKYVel 0lZ1OnXOmN5TIEIIPo9LrE+LzZis6A0HA1FRMtKgKGhT3N965pkqfhKbq/V48kpJKT8+c Zs0TOn4HFMG+OIy6c9ofSBrXD68yxP6QYTz6xH0GMWawLyPLYR52j3I05fK1ylAb6K0ox PxzQ5nwrLD+mUVPZ9rDs1En6fmOX9xfkZTblG/5D+s1fHHs9dDXCOVkT5dLS8DjdIA== Asimple approach that allowed the signer to indicate the list size at signing time would allowpossible "Signature-Input" and "Signature" header containing this signature is: # NOTE: '\' line wrapping per RFC 8792 Signature-Input: sig1=("@request-target" "host" "date" "content-type" "digest" "content-length"); keyid="test-key-a"; alg="hs2019"; created=1402170695 Signature: sig1=:B24UG4FaiE2kSXBNKV4DA91J+mElAhS3mncrgyteAye1GKMpmzt8\ jkHNjoudtqw3GngGY3n0mmwjdfn1eA6nAjgeHwl0WXced5tONcCPNzLswqPOiobGe\ A5y4WE8iBveel30OKYVel0lZ1OnXOmN5TIEIIPo9LrE+LzZis6A0HA1FRMtKgKGhT\ 3N965pkqfhKbq/V48kpJKT8+cZs0TOn4HFMG+OIy6c9ofSBrXD68yxP6QYTz6xH0G\ MWawLyPLYR52j3I05fK1ylAb6K0oxPxzQ5nwrLD+mUVPZ9rDs1En6fmOX9xfkZTbl\ G/5D+s1fHHs9dDXCOVkT5dLS8DjdIA==: B.3.2. Signature Verification B.3.2.1. Minimal Required Signature Header This presents asigner to sign"Signature-Input" and "Signature" headerfields that are may be appended to by intermediaries as the message makes its way tocontaining only therecipient. Specifying list sizeminimal required parameters: # NOTE: '\' line wrapping per RFC 8792 Signature-Input: sig1=(); keyid="test-key-a"; created=1402170695 Signature: sig1=:cxieW5ZKV9R9A70+Ua1A/1FCvVayuE6Z77wDGNVFSiluSzR9TYFV\ vwUjeU6CTYUdbOByGMCee5q1eWWUOM8BIH04Si6VndEHjQVdHqshAtNJk2Quzs6WC\ 2DkV0vysOhBSvFZuLZvtCmXRQfYGTGhZqGwq/AAmFbt5WNLQtDrEe0ErveEKBfaz+\ IJ35zhaj+dun71YZ82b/CRfO6fSSt8VXeJuvdqUuVPWqjgJD4n9mgZpZFGBaDdPiw\ pfbVZHzcHrumFJeFHWXH64a+c5GN+TWlP8NPg2zFdEc/joMymBiRelq236WGm5VvV\ 9a22RW2/yLmaU/uwf9v40yGR/I1NRA==: The corresponding signature metadata derived from this header field is: +=================+==========================================+ | Property | Value | +=================+==========================================+ | Algorithm | "hs2019", using RSASSA-PSS using SHA-256 | +-----------------+------------------------------------------+ | Covered Content | `` | +-----------------+------------------------------------------+ | Creation Time | 8:51:35 PM GMT, June 7th, 2014 | +-----------------+------------------------------------------+ | Expiration Time | Undefined | +-----------------+------------------------------------------+ | Verification | The public key specified interms of number of items could introduce risks of list syntax is not strictly adhered to (e.g., a malicious party crafts| | Key Material | Appendix B.1.1. | +-----------------+------------------------------------------+ Table 12 The corresponding Signature Input is: "@signature-params": sig1=(); alg="hs2019"; keyid="test-key-a"; created=1402170695 B.3.2.2. Minimal Recommended Signature Header This presents avalue that gets parsed by the application as 5 items, but by the verifier as 4). Specifying list size in number of octets might address this, but more exploration is required. B.2.4. Support expected authority changes In some cases, the authority of"Signature-Input" and "Signature" header containing only theeffective request URI may be expected to change, for exampleminimal required and recommended parameters: # NOTE: '\' line wrapping per RFC 8792 Signature-Input: sig1=(); alg="hs2019"; keyid="test-key-a"; created=1402170695 Signature: sig1=:cxieW5ZKV9R9A70+Ua1A/1FCvVayuE6Z77wDGNVFSiluSzR9TYFV\ vwUjeU6CTYUdbOByGMCee5q1eWWUOM8BIH04Si6VndEHjQVdHqshAtNJk2Quzs6WC\ 2DkV0vysOhBSvFZuLZvtCmXRQfYGTGhZqGwq/AAmFbt5WNLQtDrEe0ErveEKBfaz+\ IJ35zhaj+dun71YZ82b/CRfO6fSSt8VXeJuvdqUuVPWqjgJD4n9mgZpZFGBaDdPiw\ pfbVZHzcHrumFJeFHWXH64a+c5GN+TWlP8NPg2zFdEc/joMymBiRelq236WGm5VvV\ 9a22RW2/yLmaU/uwf9v40yGR/I1NRA==: The corresponding signature metadata derived from"public-service- name.example.com" to "service-host-1.public-service- name.example.com".this header field is: +=================+==========================================+ | Property | Value | +=================+==========================================+ | Algorithm | "hs2019", using RSASSA-PSS using SHA-512 | +-----------------+------------------------------------------+ | Covered Content | `` | +-----------------+------------------------------------------+ | Creation Time | 8:51:35 PM GMT, June 7th, 2014 | +-----------------+------------------------------------------+ | Expiration Time | Undefined | +-----------------+------------------------------------------+ | Verification | The public key specified in | | Key Material | Appendix B.1.1. | +-----------------+------------------------------------------+ Table 13 The corresponding Signature Input is: "@signature-params": sig1=(); alg="rsa-sha256"; keyid="test-key-b" B.3.2.3. Minimal Signature Header using rsa-sha256 Thisis commonly the case for services that are hosted behind a load-balancing gateway, where the client sends requests topresents apublicly known domain name for the service,minimal "Signature-Input" andthese requests are transformed by the gateway into requests to specific hosts in"Signature" header for a signature using theservice fleet. One possible way to handle"rsa-sha256" algorithm: # NOTE: '\' line wrapping per RFC 8792 Signature: sig1=("date"); alg=rsa-sha256; keyid="test-key-b" Signature: sig1=:HtXycCl97RBVkZi66ADKnC9c5eSSlb57GnQ4KFqNZplOpNfxqk62\ JzZ484jXgLvoOTRaKfR4hwyxlcyb+BWkVasApQovBSdit9Ml/YmN2IvJDPncrlhPD\ VDv36Z9/DiSO+RNHD7iLXugdXo1+MGRimW1RmYdenl/ITeb7rjfLZ4b9VNnLFtVWw\ rjhAiwIqeLjodVImzVc5srrk19HMZNuUejK6I3/MyN3+3U8tIRW4LWzx6ZgGZUaEE\ P0aBlBkt7Fj0Tt5/P5HNW/Sa/m8smxbOHnwzAJDa10PyjzdIbywlnWIIWtZKPPsoV\ oKVopUWEU3TNhpWmaVhFrUL/O6SN3w==: The corresponding signature metadata derived from thiswould be to special-case the Hostheader fieldto allow verifier to substitute a known expected value, or a value providedis: +===========================+==========================+ | Property | Value | +===========================+==========================+ | Algorithm | rsa-sha256 | +---------------------------+--------------------------+ | Covered Content | date | +---------------------------+--------------------------+ | Creation Time | Undefined | +---------------------------+--------------------------+ | Expiration Time | Undefined | +---------------------------+--------------------------+ | Verification Key Material | The public key specified | | | inanother header field (e.g., "Via") when generating theAppendix B.1.1. | +---------------------------+--------------------------+ Table 14 The corresponding SignatureInput, provided that the verifier also recognizes the real value in the "Host" header. Alternatively, this logic could apply to an "(audience)" content identifier. B.2.5. Support for signing specific cookies A signer may only wish to sign one or a few cookies, for example if the website requires its authentication state cookie to be signed, but also sets other cookies (e.g., for analytics, ad tracking, etc.)Input is: "date": Tue, 07 Jun 2014 20:51:35 GMT "@signature-params": ("date"); alg=rsa-sha256; keyid="test-key-b" Acknowledgements This specificationiswas initially based on thedraft-cavage-http-signaturesdraft-cavage-http- signatures internet draft. Theeditoreditors would like to thank the authors of that draft, Mark Cavage and Manu Sporny, for their work on that draft and their continuing contributions. The editor would also like to thank the following individuals for feedback on and implementations of the draft-cavage-http-signatures draft (in alphabetical order): Mark Adamcin, Mark Allen, Paul Annesley, Karl Boehlmark, Stephane Bortzmeyer, Sarven Capadisli, Liam Dennehy, ductm54, Stephen Farrell, Phillip Hallam-Baker, Eric Holmes, Andrey Kislyuk, Adam Knight, Dave Lehn, Dave Longley, James H. Manger, Ilari Liusvaara, Mark Nottingham, Yoav Nir, Adrian Palmer, Lucas Pardue, Roberto Polli, Julian Reschke, Michael Richardson, Wojciech Rygielski, Adam Scarr, Cory J. Slep, Dirk Stein, Henry Story, Lukasz Szewc, Chris Webber, and Jeffrey Yasskin Document History _RFC EDITOR: please remove this section before publication_ * draft-ietf-httpbis-message-signatures - Since-01-02 - -02 o Removed editorial comments on document sources. o Removed in-document issues list in favor of tracked issues. o Replaced unstructured "Signature" header with "Signature- Input" and "Signature" Dictionary Structured Header Fields. o Defined content identifiers for individual Dictionary members, e.g.,"x-dictionary-field:member-name".""x-dictionary-field";key=member-name". o Defined content identifiers for first N members of a List, e.g.,"x-list-field:4".""x-list-field":prefix=4". o Fixed up examples. o Updated introduction now that it's adopted. o Defined specialty content identifiers and a means to extend them. o Required signature parameters to be included in signature. o Added guidance on backwards compatibility, detection, and use of signature methods. - -01 o Strengthened requirement for content identifiers for header fields to be lower-case (changed from SHOULD to MUST). o Added real example values for Creation Time and Expiration Time. o Minor editorial corrections and readability improvements. - -00 o Initialized from draft-richanna-http-message-signatures-00, following adoption by the working group. * draft-richanna-http-message-signatures - -00 o Converted to xml2rfc v3 and reformatted to comply with RFC style guides. o Removed Signature auth-scheme definition and related content. o Removed conflicting normative requirements for use of algorithm parameter. Now MUST NOT be relied upon. o Removed Extensions appendix. o Rewrote abstract and introduction to explain context and need, and challenges inherent in signing HTTP messages. o Rewrote and heavily expanded algorithm definition, retaining normative requirements. o Added definitions for key terms, referenced RFC 7230 for HTTP terms. o Added examples for canonicalization and signature generation steps. o Rewrote Signature header definition, retaining normative requirements. o Added default values for algorithm and expires parameters. o Rewrote HTTP Signature Algorithms registry definition. Added change control policy and registry template. Removed suggested URI. o Added IANA HTTP Signature Parameter registry. o Added additional normative and informative references. o Added Topics for Working Group Discussion section, to be removed prior to publication as an RFC. Authors' Addresses Annabelle Backman (editor) Amazon P.O. Box 81226 Seattle, WA 98108-1226 United States of America Email: richanna@amazon.com URI: https://www.amazon.com/ Justin Richer Bespoke Engineering Email: ietf@justin.richer.org URI: https://bspk.io/ Manu Sporny Digital Bazaar 203 Roanoke Street W. Blacksburg, VA 24060 United States of America Email: msporny@digitalbazaar.com URI: https://manu.sporny.org/