Re: SIGSEGV from EVP_MAC_CTX_get_mac_size()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the quick response.

james@xxxxxxxxxxx said:
> Would you be able to open an issue for this? 

SIGSEGV from EVP_MAC_CTX_get_mac_size() #22842
  https://github.com/openssl/openssl/issues/22842

> It is unusual to call EVP_MAC_CTX_get_mac_size() without first calling
> EVP_MAC_init(), but the code should handle that (and return 0, as per  the
> documentation). 

The context is setting up a shared key for NTP.  I'm trying to do some sanity 
checking when reading the keys file -- long before they get used.

--------

>From your previous message:
> Note that EVP_MAC_CTX_get_mac_size() does not seem to be called in the
> back-trace you listed. 

Here is the code from crypto/evp/mac_lib.c
size_t EVP_MAC_CTX_get_mac_size(EVP_MAC_CTX *ctx)
{
    return get_size_t_ctx_param(ctx, OSSL_MAC_PARAM_SIZE);
}

I'm not a compiler wizard.  I think that pattern is a special case.  It's returning the result of a procedure call so it can throw away the current frame, setup the return address and jump to the target routine which will return directly to the caller.  That saves a stack frame which can be a huge win with retursive code.  It probably saves a few cycles and helps the working set.



-- 
These are my opinions.  I hate spam.






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux