Fix text name of hmac-sha1-96-buggy.

I carefully set up separate mechanisms for the "-96" suffix on the
hash name and the "bug-compatible" in parens after it, so that the
latter could share its parens with annotations from the underlying
hash. And then I forgot to _use_ the second mechanism!

Also added ssh2_mac_text_name to the testcrypt API so I could check it
easily. The result before this fix:

>>> ssh2_mac_text_name(ssh2_mac_new("hmac_sha1_96_buggy", None))
'HMAC-SHA-1-96 (bug-compatible) (unaccelerated)'

And after, which is what I intended all along:

>>> ssh2_mac_text_name(ssh2_mac_new("hmac_sha1_96_buggy", None))
'HMAC-SHA-1-96 (bug-compatible, unaccelerated)'
This commit is contained in:
Simon Tatham 2020-01-26 16:46:16 +00:00
Родитель 404f558705
Коммит 600bf247d3
2 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -195,7 +195,7 @@ const ssh2_macalg ssh_hmac_sha1_96 = {
};
const struct hmac_extra ssh_hmac_sha1_buggy_extra = {
&ssh_sha1, " (bug-compatible)"
&ssh_sha1, "", "bug-compatible"
};
const ssh2_macalg ssh_hmac_sha1_buggy = {
@ -206,7 +206,7 @@ const ssh2_macalg ssh_hmac_sha1_buggy = {
};
const struct hmac_extra ssh_hmac_sha1_96_buggy_extra = {
&ssh_sha1, "-96 (bug-compatible)"
&ssh_sha1, "-96", "bug-compatible"
};
const ssh2_macalg ssh_hmac_sha1_96_buggy = {

Просмотреть файл

@ -138,6 +138,7 @@ FUNC2(void, ssh2_mac_setkey, val_mac, val_string_ptrlen)
FUNC1(void, ssh2_mac_start, val_mac)
FUNC2(void, ssh2_mac_update, val_mac, val_string_ptrlen)
FUNC1(val_string, ssh2_mac_genresult, val_mac)
FUNC1(val_string_asciz_const, ssh2_mac_text_name, val_mac)
/*
* The ssh_key abstraction. All the uses of BinarySink and