mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/openssl] hmac: fix wrong usage of EVP_DigestSignFinal()
According to the manpage, the "siglen" parameter must be initialized beforehand. https://github.com/ruby/openssl/commit/6a60c7b2e7
This commit is contained in:
parent
cfcdd2b4bd
commit
c1a7c6df18
1 changed files with 2 additions and 2 deletions
|
@ -175,7 +175,7 @@ static VALUE
|
|||
ossl_hmac_digest(VALUE self)
|
||||
{
|
||||
EVP_MD_CTX *ctx;
|
||||
size_t buf_len;
|
||||
size_t buf_len = EVP_MAX_MD_SIZE;
|
||||
VALUE ret;
|
||||
|
||||
GetHMAC(self, ctx);
|
||||
|
@ -200,7 +200,7 @@ ossl_hmac_hexdigest(VALUE self)
|
|||
{
|
||||
EVP_MD_CTX *ctx;
|
||||
unsigned char buf[EVP_MAX_MD_SIZE];
|
||||
size_t buf_len;
|
||||
size_t buf_len = EVP_MAX_MD_SIZE;
|
||||
VALUE ret;
|
||||
|
||||
GetHMAC(self, ctx);
|
||||
|
|
Loading…
Add table
Reference in a new issue