Handshake authentication proofs

Test vectors: Handshake authentication proofs. Shown here as it is in conformance/vectors/auth.json.

Generated at build time from conformance/vectors/auth.json.

Protocol 0.1. Covers: SPEC.md section 5.

Download auth.json: the file itself, as the conformance suite reads it.

How to use it #

For each case compute HMAC-SHA256(key, peerInput) and HMAC-SHA256(key, hubInput) over UTF-8 bytes, base64url; compare with peerProof and hubProof. The third case has a non-ASCII kid.

Formula #

Text
proof = b64url(HMAC-SHA256(key, context + "\n" + role + "\n" + kid + "\n" + nonce + "\n" + cnonce)); context "reins.v1.auth" for hello.auth.proof, "reins.v1.hub" for welcome.proof

Notes #

b64url is RFC 4648 base64url without padding. The HMAC key is the UTF-8 bytes of the secret and the message the UTF-8 bytes of the string, as SPEC 5 states; the third case has a non-ASCII kid. Nonces and keys here are fixed stand-ins for the random values.

cases #

3 cases.

JSON
[
  {
    "name": "agent, kid default",
    "key": "HebNZMN9EImpyoAZxAMca3WUyq-yG5DAkpSIfXpS294",
    "role": "agent",
    "kid": "default",
    "nonce": "X4jwsNU4ZbyLfcfpTAjqL6YTHwJFRJnhOkaAiob2bbU",
    "cnonce": "WI8VBFzQHSRrn0GqeV7pEYkNsGcnJACIX8XysTe0wuc",
    "peerInput": "reins.v1.auth\nagent\ndefault\nX4jwsNU4ZbyLfcfpTAjqL6YTHwJFRJnhOkaAiob2bbU\nWI8VBFzQHSRrn0GqeV7pEYkNsGcnJACIX8XysTe0wuc",
    "peerProof": "nD89mHMkpZjv1bORaBzPNGoMXilSlR-6cu-JIzNjpZs",
    "hubInput": "reins.v1.hub\nagent\ndefault\nX4jwsNU4ZbyLfcfpTAjqL6YTHwJFRJnhOkaAiob2bbU\nWI8VBFzQHSRrn0GqeV7pEYkNsGcnJACIX8XysTe0wuc",
    "hubProof": "BYpxxhfA4x9Xak04Rvey74cSQOaBtXiYKY7E3A7N3R0"
  },
  {
    "name": "surface, kid is the app id",
    "key": "FO-ikHNJ95mJbBEoY0q2lieeFYayKu8mwfwwQEceMmY",
    "role": "surface",
    "kid": "brew-kiosk",
    "nonce": "dXbDGOg_fDjihidOA5RNJpIRZacNP0YSMuxRUBPGyzM",
    "cnonce": "S10kawlC7XlnPgVAAU1y-u823W28VD-AkfZ3xmkF_cM",
    "peerInput": "reins.v1.auth\nsurface\nbrew-kiosk\ndXbDGOg_fDjihidOA5RNJpIRZacNP0YSMuxRUBPGyzM\nS10kawlC7XlnPgVAAU1y-u823W28VD-AkfZ3xmkF_cM",
    "peerProof": "C0QwKOTVLE7aF5JKtbRLUHS8K0JtYK4WbTUDkpkbUvU",
    "hubInput": "reins.v1.hub\nsurface\nbrew-kiosk\ndXbDGOg_fDjihidOA5RNJpIRZacNP0YSMuxRUBPGyzM\nS10kawlC7XlnPgVAAU1y-u823W28VD-AkfZ3xmkF_cM",
    "hubProof": "ZTzTBKraZKexSn6NyBZ8Ig2usYXcCXxg056U7z75ufU"
  },
  {
    "name": "agent, non-ASCII kid",
    "key": "HebNZMN9EImpyoAZxAMca3WUyq-yG5DAkpSIfXpS294",
    "role": "agent",
    "kid": "kiosk-ü",
    "nonce": "cUzStV4mJ83ZSkNnmt3PaPHO2dAaHSpWVHLYV69eVrI",
    "cnonce": "oqGWA6LiZedrc9d5J6k8lqXCXBrob3ie9NVrGjY8lkM",
    "peerInput": "reins.v1.auth\nagent\nkiosk-ü\ncUzStV4mJ83ZSkNnmt3PaPHO2dAaHSpWVHLYV69eVrI\noqGWA6LiZedrc9d5J6k8lqXCXBrob3ie9NVrGjY8lkM",
    "peerProof": "7TKpRg8ngXDFYqD-jAykBH-eMYZ4U3dSf9Y6qP1i0U4",
    "hubInput": "reins.v1.hub\nagent\nkiosk-ü\ncUzStV4mJ83ZSkNnmt3PaPHO2dAaHSpWVHLYV69eVrI\noqGWA6LiZedrc9d5J6k8lqXCXBrob3ie9NVrGjY8lkM",
    "hubProof": "kIJQ7cAA6M6YaEVmrBTRDIevIxiYJv3AiHmdtrgSx0c"
  }
]

Generated by conformance/tools/make-vectors.mjs from the formulas in the specification, with node:crypto only.