Implement Base64URL-encoded SHA512 checksums
commit3ce2ac3109f7acb38491b74bd48751ef76eae42c
authorAchim Gratz <Stromeko@Stromeko.DE>
Sun, 7 Jun 2015 07:10:13 +0000 (7 09:10 +0200)
committerAchim Gratz <Stromeko@Stromeko.DE>
Sun, 7 Jun 2015 08:42:51 +0000 (7 10:42 +0200)
tree863914611d591d7166af6aa9842561724af7c428
parent8648b05caf47865394d76822dea7b37e5cc1282e
Implement Base64URL-encoded SHA512 checksums

* ini.h: Add macros for use within the implementation of the
checksum parsers.  Hexdigest requires a 2-to-1 and Base64 a 4-to-3
conversion.  Base64 uses the filename and URL safe alphabet from
RFC4648.  It would be trivial to additionally process the normal
Base64 alphabet but we don't want to allow that in order to be
able to use the checksums as filenames without further conversion.
(hexnibble, b64url): Process single input character to input value.
(nibbled1): Convert 2 processed input values into 1 output value.
(b64d1, b64d2, b64d3): Convert 4 input values into 3 output
values.
* iniparse.yy: Add SHA512B64URL checksum in addition to MD5 and
SHA512.  Keep symmetry with MD5LINE and also define SHA512LINE
syntax.
* inilex.ll: Implement existing MD5 and SHA512 checksum parsers
using new macros.  Implement new SHA512B64URL parser using new
macros.  Enforce Base64 alphabet as defined in RFC4648 with no
padding to enable direct use of checksum values as filenames.
Implement SHA512LINE parser.
ChangeLog
ini.h
inilex.ll
iniparse.yy