mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
[ruby/openssl] hmac: fix wrong usage of EVP_DigestSignFinal()
According to the manpage, the "siglen" parameter must be initialized
beforehand.
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)
|
ossl_hmac_digest(VALUE self)
|
||||||
{
|
{
|
||||||
EVP_MD_CTX *ctx;
|
EVP_MD_CTX *ctx;
|
||||||
size_t buf_len;
|
size_t buf_len = EVP_MAX_MD_SIZE;
|
||||||
VALUE ret;
|
VALUE ret;
|
||||||
|
|
||||||
GetHMAC(self, ctx);
|
GetHMAC(self, ctx);
|
||||||
|
@ -200,7 +200,7 @@ ossl_hmac_hexdigest(VALUE self)
|
||||||
{
|
{
|
||||||
EVP_MD_CTX *ctx;
|
EVP_MD_CTX *ctx;
|
||||||
unsigned char buf[EVP_MAX_MD_SIZE];
|
unsigned char buf[EVP_MAX_MD_SIZE];
|
||||||
size_t buf_len;
|
size_t buf_len = EVP_MAX_MD_SIZE;
|
||||||
VALUE ret;
|
VALUE ret;
|
||||||
|
|
||||||
GetHMAC(self, ctx);
|
GetHMAC(self, ctx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue