a Secarta project ...

HTTPsec Authentication Protocol


Preamble

4.11. mac

The mac directive in a continuation request and a continuation response is a keyed message authentication code computed on the values of protocol directives and specific HTTP headers present in that continuation transaction. It employs a MAC Key derived from the Shared Secret.

To create a message authentication code for a message either prior to sending it or in order to validate it, the appropriate computation is made as follows:

Request:
   mac = base64enc( HMAC( request-mac-key,  request-transcript  ) )

Response:
   mac = base64enc( HMAC( response-mac-key, response-transcript ) )

where the following apply:

The message authentication codes are formulated so as to provide the following:

  • message originator authentication;
  • integrity protection for the protocol directives of this specification;
  • integrity protection for the minimal set of HTTP headers designated as "non-modifiable" by intermediate caches [HTTP][ 13.5.2]. These headers are Content-Location, Content-MD5, ETag, Last-Modified, Expires, Content-Range, and Content-Type;
  • integrity protection for the message entity-body, if accompanied by a digest directive.

The sender of a message computes and provides the message authentication code for that message. To validate it, the recipient of the message also computes its message authentication code and compares the received value with the computed value. If (1) they are strictly equal, and (2) the digest directive (if present) is confirmed to indeed equal the hash of the message entity-body, then the above authentication characteristics are considered to be established. If not, the message MUST be rejected. This two stage process permits computationally inexpensive invalidity checks to be performed before embarking on the potentially expensive process of computing the digest over an arbitrary length entity-body.