New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify that hashing bytes are base-64 encoded and give examples #2447
Conversation
With Digest, the encoding of the digest value was based on the digest algorithm. For different algorithms, this varied between base64, hex encoding or decimal encoding. In this spec, we removed the variablilty by using SF Byte Sequence, which is always serialized as a base-64 encoding of the input bytes. All algorithms are now expected to use this format. This change tries to make it more clear that we expect the input of the Byte Sequence to be. For example, we really don't want people accidentally base-64'ing the textual hex represenation output of cksum - that can lead to interop pain. To help implementers further, add a new appendix with some samples that can be used as test vectors. Closes #2385
FWIW it would be nicer to have the examples rendered in a table. But the SHA-512 example is too long and makes the build whinge. I couldn't figure out any kramdown tricks for a multi-line table entry but if somebody else knows, I'd switch over. |
Also, I welcome anyone checking my working in generating these values. The old algorithms don't tend to be supported in any decent libraries that are easily available. So I used a hodgepodge of various tools and sources to come up with bytes that would run as input into the SF serialization. |
@@ -1291,6 +1321,11 @@ RFC 3230 could never communicate | |||
the digest of HTTP message content in the Digest field; | |||
Content-Digest now provides that capability. | |||
|
|||
RFC 3230 allowed algorithms to define their output encoding format for use with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@LPardue I like the example and I will check it. I am not sure that we should explain how Binary serialization work (e.g. base64 delimited by |
Since we had some feedback that some of the examples were incorrect, and I fixed that up, I'm going to go ahead and assume the rest are ok. The important part here is that we add some coverage over all the algorithms and and I have not heard any pushback to the proposal. So I'm going to merge. |
With Digest, the encoding of the digest value was based on the digest
algorithm. For different algorithms, this varied between base64, hex
encoding or decimal encoding.
In this spec, we removed the variablilty by using SF Byte Sequence,
which is always serialized as a base-64 encoding of the input bytes. All
algorithms are now expected to use this format.
This change tries to make it more clear that we expect the input of the
Byte Sequence to be. For example, we really don't want people accidentally
base-64'ing the textual hex represenation output of cksum - that can
lead to interop pain.
To help implementers further, add a new appendix with some samples that
can be used as test vectors.
Closes #2385