Project

General

Profile

Actions

Bug #1429

closed

Suppress openssl deprecation flags on OSX or replace openssl usage with CryptoPP equivalent

Added by Alex Afanasyev over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
-
Start date:
03/31/2014
Due date:
% Done:

100%

Estimated time:

Description

I believe this bug applies only to sec-tpm-memory.(hpp|cpp). My personal preference is to replace few usages of openssl with CryptoPP equivalent and completely remove dependency on openssl. But it would be sufficient just to ensure warning suppression.

Actions #1

Updated by Syed Amin over 11 years ago

Alex Afanasyev wrote:

I believe this bug applies only to sec-tpm-memory.(hpp|cpp). My personal preference is to replace few usages of openssl with CryptoPP equivalent and completely remove dependency on openssl. But it would be sufficient just to ensure warning suppression.

So how to avoid this error, as I just did a fresh pull and the code is not compiling. I am getting following errors:

[19/73] cxx: src/security/sec-tpm-file.cpp -> build/src/security/sec-tpm-file.cpp.1.o
[20/73] cxx: src/security/sec-tpm-memory.cpp -> build/src/security/sec-tpm-memory.cpp.1.o
../src/security/sec-tpm-memory.cpp:39:7: error: 'RSA_free' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
RSA_free(privateKey_);
^
/usr/include/openssl/rsa.h:282:6: note: 'RSA_free' declared here
void RSA_free (RSA *r) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
^
../src/security/sec-tpm-memory.cpp:121:3: error: 'SHA256_Init' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
SHA256_Init(&sha256);
^
/usr/include/openssl/sha.h:147:5: note: 'SHA256_Init' declared here
int SHA256_Init(SHA256_CTX *c) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
^
../src/security/sec-tpm-memory.cpp:122:3: error: 'SHA256_Update' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
SHA256_Update(&sha256, data, dataLength);
^
/usr/include/openssl/sha.h:148:5: note: 'SHA256_Update' declared here
int SHA256_Update(SHA256_CTX *c, const void *data, size_t len) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
^
../src/security/sec-tpm-memory.cpp:123:3: error: 'SHA256_Final' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
SHA256_Final(digest, &sha256);
^
/usr/include/openssl/sha.h:149:5: note: 'SHA256_Final' declared here
int SHA256_Final(unsigned char *md, SHA256_CTX *c) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
^
../src/security/sec-tpm-memory.cpp:126:27: error: 'RSA_size' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
signatureBuffer->resize(RSA_size(privateKey->second->getPrivateKey()));
^
/usr/include/openssl/rsa.h:256:5: note: 'RSA_size' declared here
int RSA_size(const RSA *) DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER;
^
../src/security/sec-tpm-memory.cpp:129:8: error: 'RSA_sign' is deprecated: first deprecated in OS X 10.7 [-Werror,-Wdeprecated-declarations]
if (!RSA_sign(NID_sha256, digest, sizeof(digest),
^
/usr/include/openssl/rsa.h:335:5: note: 'RSA_sign' declared here
int RSA_sign(int type, const unsigned char *m, unsigned int m_length,
^
6 errors generated.
Waf: Leaving directory `/Users/obaid/memphis-repos/ndn/nfd/ndn-cpp-dev/build'
Build failed
-> task in 'ndn-cpp-dev' failed (exit status 1):
{task 4366205328: cxx sec-tpm-memory.cpp -> sec-tpm-memory.cpp.1.o}
['/usr/bin/g++', '-O0', '-g3', '-Werror', '-Wall', '-fcolor-diagnostics', '-fPIC', '-I/usr/local/include', '-I/Users/obaid/memphis-repos/ndn/nfd/ndn-cpp-dev/build', '-I/Users/obaid/memphis-repos/ndn/nfd/ndn-cpp-dev', '-I/Users/obaid/memphis-repos/ndn/nfd/ndn-cpp-dev/build/src', '-I/Users/obaid/memphis-repos/ndn/nfd/ndn-cpp-dev/src', '-I/usr/local/include', '-I/usr/local/Cellar/sqlite/3.8.3/include', '../src/security/sec-tpm-memory.cpp', '-c', '-o', 'src/security/sec-tpm-memory.cpp.1.o']

Actions #2

Updated by Anonymous over 11 years ago

CXXFLAGS="-O0 -g3 -Wall -fcolor-diagnostics -Wno-deprecated" ./waf configure
Actions #3

Updated by Alex Afanasyev over 11 years ago

As of right now, yes, you can follow Steve's suggestion, with small modification:

CXXFLAGS="-O0 -g3 -Wall -fcolor-diagnostics -Wno-deprecated" ./waf configure --debug

(this is to compile with _DEBUG macro defined, which is used in a couple of places).

If you just

./waf configure

this would compile library in optimized mode without treating warnings as errors.

Actions #4

Updated by Alex Afanasyev over 11 years ago

  • Status changed from New to Code review
  • Assignee set to Alex Afanasyev
  • % Done changed from 0 to 100
Actions #5

Updated by Alex Afanasyev over 11 years ago

  • Status changed from Code review to Closed
Actions #6

Updated by Alex Afanasyev over 11 years ago

  • Status changed from Closed to In Progress

Actually, the problem still exists. So, I'm reopening this issue.

Actions #7

Updated by Alex Afanasyev over 11 years ago

After a few experiments, the only way I'm able to suppress the warning is to remove pop/push of diagnostics. Somehow, deprecated warnings are generated not the inclusion time, but at the time the method(s) is(are) used (most likely every time, not just a first use)

Actions #8

Updated by Alex Afanasyev over 11 years ago

  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF