[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
@ -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…
x
Reference in New Issue
Block a user