Bring in compatibility glue for libsodium
The idea is untouched upstream sources live in sys/contrib/libsodium. sys/crypto/libsodium are support routines or compatibility headers to allow building unmodified upstream code. This is not yet integrated into the build system, so no functional change.
This commit is contained in:
parent
0ac341f145
commit
f36e41e20b
3
sys/crypto/libsodium/limits.h
Normal file
3
sys/crypto/libsodium/limits.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* This file is in the public domain */
|
||||
/* $FreeBSD$ */
|
||||
#include <sys/limits.h>
|
13
sys/crypto/libsodium/randombytes.c
Normal file
13
sys/crypto/libsodium/randombytes.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* This file is in the public domain. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
#include <sys/libkern.h>
|
||||
|
||||
#include <sodium/randombytes.h>
|
||||
|
||||
void
|
||||
randombytes_buf(void *buf, size_t size)
|
||||
{
|
||||
arc4random_buf(buf, size);
|
||||
}
|
3
sys/crypto/libsodium/stddef.h
Normal file
3
sys/crypto/libsodium/stddef.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* This file is in the public domain */
|
||||
/* $FreeBSD$ */
|
||||
#include <sys/types.h>
|
3
sys/crypto/libsodium/stdint.h
Normal file
3
sys/crypto/libsodium/stdint.h
Normal file
@ -0,0 +1,3 @@
|
||||
/* This file is in the public domain */
|
||||
/* $FreeBSD$ */
|
||||
#include <sys/stdint.h>
|
2
sys/crypto/libsodium/stdio.h
Normal file
2
sys/crypto/libsodium/stdio.h
Normal file
@ -0,0 +1,2 @@
|
||||
/* This file is in the public domain */
|
||||
/* $FreeBSD$ */
|
2
sys/crypto/libsodium/stdlib.h
Normal file
2
sys/crypto/libsodium/stdlib.h
Normal file
@ -0,0 +1,2 @@
|
||||
/* This file is in the public domain */
|
||||
/* $FreeBSD$ */
|
2
sys/crypto/libsodium/string.h
Normal file
2
sys/crypto/libsodium/string.h
Normal file
@ -0,0 +1,2 @@
|
||||
/* This file is in the public domain */
|
||||
/* $FreeBSD$ */
|
14
sys/crypto/libsodium/utils.c
Normal file
14
sys/crypto/libsodium/utils.c
Normal file
@ -0,0 +1,14 @@
|
||||
/* This file is in the public domain. */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
#include <sys/types.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <sodium/utils.h>
|
||||
|
||||
void
|
||||
sodium_memzero(void *b, size_t n)
|
||||
{
|
||||
explicit_bzero(b, n);
|
||||
}
|
Loading…
Reference in New Issue
Block a user