提交 bd19d1aa 编写于 作者: D Dr. Stephen Henson

Clarify digest change in HMAC_Init_ex()

RT#4603
Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 3770b877
...@@ -79,13 +79,17 @@ function B<evp_md> and the key B<key> which is B<key_len> bytes ...@@ -79,13 +79,17 @@ function B<evp_md> and the key B<key> which is B<key_len> bytes
long. It is deprecated and only included for backward compatibility long. It is deprecated and only included for backward compatibility
with OpenSSL 0.9.6b. with OpenSSL 0.9.6b.
HMAC_Init_ex() initializes or reuses a B<HMAC_CTX> structure to use HMAC_Init_ex() initializes or reuses a B<HMAC_CTX> structure to use the hash
the function B<evp_md> and key B<key>. Either can be NULL, in which function B<evp_md> and key B<key>. If both are NULL (or B<evp_md> is the same
case the existing one will be reused. B<ctx> must have been created as the previous digest used by B<ctx> and B<key> is NULL) the existing key is
with HMAC_CTX_new() before the first use of an B<HMAC_CTX> in this reused. B<ctx> must have been created with HMAC_CTX_new() before the first use
function. B<N.B. HMAC_Init() had this undocumented behaviour in of an B<HMAC_CTX> in this function. B<N.B. HMAC_Init() had this undocumented
previous versions of OpenSSL - failure to switch to HMAC_Init_ex() in behaviour in previous versions of OpenSSL - failure to switch to HMAC_Init_ex()
programs that expect it will cause them to stop working>. in programs that expect it will cause them to stop working>.
B<NB: if HMAC_Init_ex() is called with B<key> NULL and B<evp_md> is not the
same as the previous digest used by B<ctx> then an error is returned
because reuse of an existing key with a different digest is not supported.>
HMAC_Update() can be called repeatedly with chunks of the message to HMAC_Update() can be called repeatedly with chunks of the message to
be authenticated (B<len> bytes at B<data>). be authenticated (B<len> bytes at B<data>).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册