Fix assert on base64 crypto final call without buf (#517)

This commit is contained in:
Florian Märkl 2021-02-04 11:26:31 +01:00 committed by GitHub
parent 4b9e575cac
commit 7408e30cba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -46,6 +46,9 @@ static bool update(RzCrypto *cry, const ut8 *buf, int len) {
}
static bool final(RzCrypto *cry, const ut8 *buf, int len) {
if (!buf) {
return true;
}
return update(cry, buf, len);
}

View file

@ -83,18 +83,21 @@ NAME=rz-hash -D base64 -s "YWRtaW4="
FILE=-
CMDS=!rz-hash -D base64 -s "YWRtaW4="
EXPECT=admin
EXPECT_ERR=
RUN
NAME=rz-hash -E base64 -s "admin"
FILE=-
CMDS=!rz-hash -E base64 -s "admin"
EXPECT=YWRtaW4=
EXPECT_ERR=
RUN
NAME=rz-hash -E base64 -x "61646d696e"
FILE=-
CMDS=!rz-hash -E base64 -x "61646d696e"
EXPECT=YWRtaW4=
EXPECT_ERR=
RUN
NAME=rz-hash -a md5 -x "61646d696e"