Re: Net-SNMP v5.8 and Darwin
Bart Van Assche <[email protected]>
| Newsgroups | gmane.network.net-snmp.devel |
|---|---|
| Message-ID | <[email protected]> |
On 04/22/18 08:35, Keith Mendoza wrote:
> Bart,
> I was actually working on this yesterday. This is what I know so far after a few hours of digging into this: It appears that there's an issue with getting to the memory address that EVP_sha512() returns when it's called in sc_get_openssl_hashfn(). Why this is so, I don't know. Below are details of what I've figured out so far:
>
> On my environment, I'm using OpenSSL 1.0.2o installed using mac ports. EVP_sha512() simply returns the address of a static const struct env_md_st instance once you expand the EVP_MD typedef (see the source here: https://github.com/openssl/openssl/blob/3ce7bc40a3c48da1c96c2d04c10045bd797c6aa3/crypto/evp/m_sha1.c#L216). When I was stepping through using the lldb debugger, when I inspect the value of hashfn after the call to EVP_sha512() it actually reports an error that the address is inaccessible. That one's got me stumped. In line 192, the call EVP_DigestInit() happens and the address returned by EVP_sha512() is passed as the 2nd parameter to that function. Kaboom for obvious reasons.
>
> I'm no expert on the rules of accessing memory space from dynamic libraries. Hopefully, someone else can chime in. My next step is to write a small test program to isolate the digest initialization code to see if I can replicate the issue outside of Net-SNMP.
Hello Keith,
Can you have a look at the openssl/evp.h header file? The following
warning appears in the OS/X build output, which is suspicious:
scapi.c:88:12: warning: implicit declaration of function 'EVP_sha224' is
invalid in C99 [-Wimplicit-function-declaration]
return EVP_sha224();
^
Thanks,
Bart.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot