Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Aug 2018 00:27:56 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r337938 - head/sys/crypto/libsodium
Message-ID:  <201808170027.w7H0RuML027564@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Fri Aug 17 00:27:56 2018
New Revision: 337938
URL: https://svnweb.freebsd.org/changeset/base/337938

Log:
  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.

Added:
  head/sys/crypto/libsodium/
  head/sys/crypto/libsodium/limits.h   (contents, props changed)
  head/sys/crypto/libsodium/randombytes.c   (contents, props changed)
  head/sys/crypto/libsodium/stddef.h   (contents, props changed)
  head/sys/crypto/libsodium/stdint.h   (contents, props changed)
  head/sys/crypto/libsodium/stdio.h   (contents, props changed)
  head/sys/crypto/libsodium/stdlib.h   (contents, props changed)
  head/sys/crypto/libsodium/string.h   (contents, props changed)
  head/sys/crypto/libsodium/utils.c   (contents, props changed)

Added: head/sys/crypto/libsodium/limits.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/libsodium/limits.h	Fri Aug 17 00:27:56 2018	(r337938)
@@ -0,0 +1,3 @@
+/* This file is in the public domain */
+/* $FreeBSD$ */
+#include <sys/limits.h>

Added: head/sys/crypto/libsodium/randombytes.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/libsodium/randombytes.c	Fri Aug 17 00:27:56 2018	(r337938)
@@ -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);
+}

Added: head/sys/crypto/libsodium/stddef.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/libsodium/stddef.h	Fri Aug 17 00:27:56 2018	(r337938)
@@ -0,0 +1,3 @@
+/* This file is in the public domain */
+/* $FreeBSD$ */
+#include <sys/types.h>

Added: head/sys/crypto/libsodium/stdint.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/libsodium/stdint.h	Fri Aug 17 00:27:56 2018	(r337938)
@@ -0,0 +1,3 @@
+/* This file is in the public domain */
+/* $FreeBSD$ */
+#include <sys/stdint.h>

Added: head/sys/crypto/libsodium/stdio.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/libsodium/stdio.h	Fri Aug 17 00:27:56 2018	(r337938)
@@ -0,0 +1,2 @@
+/* This file is in the public domain */
+/* $FreeBSD$ */

Added: head/sys/crypto/libsodium/stdlib.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/libsodium/stdlib.h	Fri Aug 17 00:27:56 2018	(r337938)
@@ -0,0 +1,2 @@
+/* This file is in the public domain */
+/* $FreeBSD$ */

Added: head/sys/crypto/libsodium/string.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/libsodium/string.h	Fri Aug 17 00:27:56 2018	(r337938)
@@ -0,0 +1,2 @@
+/* This file is in the public domain */
+/* $FreeBSD$ */

Added: head/sys/crypto/libsodium/utils.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/libsodium/utils.c	Fri Aug 17 00:27:56 2018	(r337938)
@@ -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);
+}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808170027.w7H0RuML027564>