Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile errors on Mac OS #1

Open
max-mapper opened this issue May 5, 2015 · 1 comment
Open

compile errors on Mac OS #1

max-mapper opened this issue May 5, 2015 · 1 comment

Comments

@max-mapper
Copy link

gcc -DHAVE_CONFIG_H -I. -I.. -I../src    -g -O2 -Werror -MT hash_md5.o -MD -MP -MF .deps/hash_md5.Tpo -c -o hash_md5.o hash_md5.c
hash_md5.c:35:9: error: 'MD5_Init' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
        MD5_Init(&mdctx);
        ^
/usr/include/openssl/md5.h:113:5: note: 'MD5_Init' has been explicitly marked deprecated here
int MD5_Init(MD5_CTX *c) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
    ^
hash_md5.c:43:9: error: 'MD5_Update' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
        MD5_Update(&mdctx, rp->block_addr, rp->block_size);
        ^
/usr/include/openssl/md5.h:114:5: note: 'MD5_Update' has been explicitly marked deprecated here
int MD5_Update(MD5_CTX *c, const void *data, size_t len) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
    ^
hash_md5.c:44:9: error: 'MD5_Final' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
        MD5_Final(digest, &mdctx);
        ^
/usr/include/openssl/md5.h:115:5: note: 'MD5_Final' has been explicitly marked deprecated here
int MD5_Final(unsigned char *md, MD5_CTX *c) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
    ^
3 errors generated.
make[2]: *** [hash_md5.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

from googling it seems openssl APIs are deprecated on mac os > 10.7

@stevegt
Copy link
Owner

stevegt commented Nov 22, 2015

Thanks Max, and sorry it took me so long to notice your note. I don't have any mac os boxes, so wouldn't be able to test a fix for this by myself. If you or anyone else can rework it and would like to submit a pull request, I'll at least be able to test it on Linux.

Likely what's needed is to simply use some other library for an MD5 hash function. A quick grep tells me that the only place we're using openssl is in that test case and in ./examples/benchmark.c, not in the rabinpoly library itself.

Hints for anyone wanting to tackle this: Apparently Apple wants folks to use Apple's Common Crypto stuff instead of openssl: http://stackoverflow.com/questions/7406946/why-is-apple-deprecating-openssl-in-macos-10-7-lion

The CC_MD5* functions in Common Crypto appear to be the ones we'd want: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/CC_MD5.3cc.html#//apple_ref/doc/man/3cc/CC_MD5

This would all need to go in an ifdef block etc. of course, so other platforms can keep using openssl. (My autotools fu is no longer good enough to recall how to do this properly, but that needs to be looked at.)

A better way might be to just find another hashing library for these test cases, one that's neither openssl nor Common Crypto, so we don't need the ifdef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants