<html><head></head><body><div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">It is defined in RFC7515<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">Quote: <br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">Base64url Encoding <br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; ">Base64 encoding using the URL- and filename-safe character set defined in Section 5 of RFC 4648 [RFC4648], with all trailing '=' characters omitted (as permitted by Section 3.2) and without the inclusion of any line breaks, whitespace, or other additional characters. Note that the base64url encoding of the empty octet sequence is the empty string. (See Appendix C for notes on implementing base64url encoding without padding.) <br>
<br>
<br>
</div>
<div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; "><div dir="auto" style="direction: ltr; margin: 0; padding: 0; font-family: sans-serif; font-size: 11pt; color: black; "><a href="https://aka.ms/ghei36">Outlook for Android</a> γ‹γ‚‰ε–εΎ—</div>
<br>
</div>
<br><br><br>
<div class="gmail_quote">On Wed, Feb 7, 2018 at 9:56 AM +0900, "Joseph Heenan" <span dir="ltr"><<a href="mailto:joseph@authlete.com" target="_blank">joseph@authlete.com</a>></span> wrote:<br>
<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="3D"ltr"">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">Hi Nat,<div class=""><br class=""></div><div class="">As per discussion on the FAPI WG call, I'm struggling to understand where in the specs it says that the base64url encoding of s_hash (and c_hash and at_hash) are not padded with '='.</div><div class=""><br class=""></div><div class="">I fully accept that for all practical purposes these should not be padded, but I can't find where in the specs it says that. One vendor is padding s_hash and believes they are compliant with the spec as written.</div><div class=""><br class=""></div><div class=""><a href="http://openid.net/specs/openid-connect-core-1_0.html" class="">http://openid.net/specs/openid-connect-core-1_0.html</a> says simply "base64url encoded". It doesn't appear to reference any specific spec for base64url.</div><div class=""><br class=""></div><div class="">The canonical reference for base64url is I believe <a href="https://tools.ietf.org/html/rfc4648#section-5" class="">https://tools.ietf.org/html/rfc4648#section-5</a></div><div class=""><br class=""></div><div class="">This states:</div><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;">   The pad character "=" is typically percent-encoded when used in an
   URI [<a href="https://tools.ietf.org/html/rfc4648#ref-9" title=""Uniform Resource Identifier (URI): Generic Syntax"" class="">9</a>], but if the data length is known implicitly, this can be
   avoided by skipping the padding; see <a href="https://tools.ietf.org/html/rfc4648#section-3.2" class="">section 3.2</a>.
</pre></blockquote></div><div class=""><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;"><br class=""></pre><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;"><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class="">and section 3.2 states:</div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><blockquote type="cite" class=""><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;">   Implementations MUST include appropriate pad characters at the end of
   encoded data unless the specification referring to this document
   explicitly states otherwise.
</pre></blockquote><div class=""><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;"><br class=""></pre></div></div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class="">This clearly states the value should be padded, as OIDC does not explicitly say padding should be skipped.</div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class="">I searched further and found <a href="https://tools.ietf.org/html/rfc7515" class="">https://tools.ietf.org/html/rfc7515</a>. This does explicitly state:</div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><blockquote type="cite" class=""><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;">   Base64url Encoding
      Base64 encoding using the URL- and filename-safe character set
      defined in <a href="https://tools.ietf.org/html/rfc4648#section-5" class="">Section 5 of RFC 4648</a> [<a href="https://tools.ietf.org/html/rfc4648" title=""The Base16, Base32, and Base64 Data Encodings"" class="">RFC4648</a>], with all trailing '='
      characters omitted (as permitted by <a href="https://tools.ietf.org/html/rfc7515#section-3.2" class="">Section 3.2</a>) and without the
      inclusion of any line breaks, whitespace, or other additional
      characters.  Note that the base64url encoding of the empty octet
      sequence is the empty string.  (See <a href="https://tools.ietf.org/html/rfc7515#appendix-C" class="">Appendix C</a> for notes on
      implementing base64url encoding without padding.)
</pre></blockquote><div class=""><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;"><br class=""></pre><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;"><br class=""></pre><pre class="newpage" style="font-size: 13.333333015441895px; margin-top: 0px; margin-bottom: 0px; break-before: page;"><pre class="newpage" style="margin-top: 0px; margin-bottom: 0px; break-before: page;"><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class="">So it appears we have two RFCs, which defines base64url differently.</div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class="">OIDC Core does not appear to explicitly state which definition of base64url it is using - can you point at anything I've missed?</div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class="">I think perhaps the FAPI definition of s_hash should explicitly reference rfc7515's definition.</div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class="">Thanks</div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class="">Joseph</div><div style="font-family: Helvetica; font-size: 12px; white-space: normal;" class=""><br class=""></div><div class=""><br class=""></div></pre></pre></div></div></pre></div>
</div>

</blockquote>
</div>
</body></html>