Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
paulofaria committed May 24, 2017
1 parent 39b8f44 commit 57d24c5
Show file tree
Hide file tree
Showing 12 changed files with 1,096 additions and 1,098 deletions.
6 changes: 3 additions & 3 deletions Sources/CDsock/tls/compat/arc4random.c
Expand Up @@ -65,6 +65,8 @@ static inline int _rs_allocate(struct _rs **, struct _rsx **);
static inline void _rs_forkdetect(void);
#include "arc4random.h"

int getentropy(void *buf, size_t len);

static inline void _rs_rekey(u_char *dat, size_t datlen);

static inline void
Expand All @@ -82,9 +84,7 @@ _rs_init(u_char *buf, size_t n)
chacha_ivsetup(&rsx->rs_chacha, buf + KEYSZ);
}

static void
_rs_stir(void)
{
static void _rs_stir(void) {
u_char rnd[KEYSZ + IVSZ];

if (getentropy(rnd, sizeof rnd) == -1)
Expand Down
11 changes: 3 additions & 8 deletions Sources/CDsock/tls/compat/explicit_bzero.c
Expand Up @@ -6,16 +6,11 @@

#include <string.h>

__attribute__((optimize("O0")))
__attribute__((weak)) void
__explicit_bzero_hook(void *buf, size_t len)
{
__attribute__((weak))
void __explicit_bzero_hook(void *buf, size_t len) {
}

__attribute__((optimize("O0")))
void
explicit_bzero(void *buf, size_t len)
{
void explicit_bzero(void *buf, size_t len) {
memset(buf, 0, len);
__explicit_bzero_hook(buf, len);
}

0 comments on commit 57d24c5

Please sign in to comment.