Skip to content

Commit

Permalink
Suppress OpenSSL deprecated function warnings
Browse files Browse the repository at this point in the history
Many ENGINE, EVP_PKEY and EC functions are deprecated in OpenSSL 3.0.
Excessive warnings make it hard to spot issues that really require
our attention.
  • Loading branch information
mtrojnar committed Jul 11, 2023
1 parent 9307508 commit c600d06
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <libp11.h>

#define RANDOM_SOURCE "/dev/urandom"
Expand Down
4 changes: 4 additions & 0 deletions examples/decrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#endif
#include <stdio.h>
#include <string.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <libp11.h>

#define RANDOM_SOURCE "/dev/urandom"
Expand Down
3 changes: 3 additions & 0 deletions tests/check-privkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#include <unistd.h>
#include <string.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <openssl/engine.h>
#include <openssl/conf.h>
#include <openssl/evp.h>
Expand Down
3 changes: 3 additions & 0 deletions tests/dup-key.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <unistd.h>
#include <string.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <openssl/engine.h>
#include <openssl/conf.h>
#include <openssl/evp.h>
Expand Down
4 changes: 4 additions & 0 deletions tests/evp-sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#include <getopt.h>
#include <err.h>
#include <arpa/inet.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <openssl/evp.h>
#include <openssl/pem.h>
#include <openssl/err.h>
Expand Down
3 changes: 3 additions & 0 deletions tests/fork-change-slot.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
#include <unistd.h>
#include <signal.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <openssl/evp.h>
#include <openssl/conf.h>
#include <openssl/engine.h>
Expand Down
4 changes: 4 additions & 0 deletions tests/rsa-oaep.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <openssl/rsa.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
Expand Down
4 changes: 4 additions & 0 deletions tests/rsa-pss-sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <openssl/rsa.h>
#include <openssl/evp.h>
#include <openssl/pem.h>
Expand Down
6 changes: 5 additions & 1 deletion tests/store-cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#include <string.h>

/* this code extensively uses deprecated features, so warnings are useless */
#define OPENSSL_SUPPRESS_DEPRECATED

#include <libp11.h>
#include <openssl/conf.h>
#include <openssl/engine.h>
#include <openssl/pem.h>
#include <string.h>

static void
usage(char* argv[])
Expand Down

0 comments on commit c600d06

Please sign in to comment.