Re: Net-SNMP v5.8 and Darwin

Bart Van Assche <[email protected]>
Newsgroups gmane.network.net-snmp.devel
Message-ID <[email protected]>
On 04/23/18 00:34, Keith Mendoza wrote:
> Even with the -std=c89 flag the issue is still present. I was able to replicate the issue with the following code:
> 
> === BEGIN C CODE ===
> #include <stdio.h>
> #define OPENSSL_NO_SHA512
> #include <openssl/evp.h>
> 
> const EVP_MD *getType()
> {
>      const EVP_MD *ret;
>      ret = (const EVP_MD *)EVP_sha512();
> 
>      return ret;
> }
> 
> int main()
> {
>      EVP_MD_CTX ctx;
>      const EVP_MD *type = NULL;
>      int retVal = 0;
> 
>      OpenSSL_add_all_digests();
> 
>      type = getType();
>      if(!EVP_DigestInit(&ctx, type))
>      {
>          fprintf(stderr, "Failed to init digest\n");
>          retVal = 1;
>          goto drop;
>      }
>      else
>          printf("Digest initialized\n");
> 
> drop:
>      EVP_cleanup();
>      return 0;
> }
> === END C CODE ===
> 
> Note the #define right before #include <openssl/evp.h>. The darwin*.h files that I mention earlier are only referenced in INCLUDESUBDIRHEADERS variable in net-snmp/Makefile.in file. However, after removing those from the list and running autoreconf, the warning about EVP_sha512 being undeclared--and the crash--are all still occurring. The only think I can think of at this point is some header that has #define OPENSSL_NO_SHA512 is in play somewhere.
> 
> Hope this helps narrow things down.

Thanks Keith, that helps a lot. Based on this feedback I checked in a 
new patch on the v5.7 and master branches. With that patch applied all 
tests pass on Travis for Darwin except the full MIB walk.

Bart.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.