Skip to content

Commit

Permalink
Fix string.h, strings.h and stdio.h include in crypto backend.
Browse files Browse the repository at this point in the history
String.h and stdbool.h are already included in main backend header,
no need to include them again.

Stdio.h is missing for OpenSSL and NSS backed (for sprintf).

Strings.h is missing for cipher_generic, gcrypt and OpoenSSL (strcasecmp).

Fixes: #885
  • Loading branch information
mbroz committed May 23, 2024
1 parent bd8cfe1 commit 6859993
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 11 deletions.
3 changes: 1 addition & 2 deletions lib/crypto_backend/cipher_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include <strings.h>
#include "crypto_backend.h"

struct cipher_alg {
Expand Down
2 changes: 0 additions & 2 deletions lib/crypto_backend/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
*
*/

#include <stdio.h>

#include "crypto_backend.h"

static const uint32_t crc32_tab[] = {
Expand Down
2 changes: 0 additions & 2 deletions lib/crypto_backend/crypto_cipher_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>
#include <sys/socket.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto_backend/crypto_gcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <strings.h>
#include <gcrypt.h>
#include <pthread.h>
#include "crypto_backend_internal.h"
Expand Down
1 change: 0 additions & 1 deletion lib/crypto_backend/crypto_kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
Expand Down
1 change: 0 additions & 1 deletion lib/crypto_backend/crypto_nettle.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
*/

#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <nettle/sha.h>
#include <nettle/sha3.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/crypto_backend/crypto_nss.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <nss.h>
#include <pk11pub.h>
Expand Down
3 changes: 2 additions & 1 deletion lib/crypto_backend/crypto_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
* for all of the code used other than OpenSSL.
*/

#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <limits.h>
#include <strings.h>
#include <openssl/crypto.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
Expand Down

0 comments on commit 6859993

Please sign in to comment.