From owner-svn-src-head@freebsd.org Fri Aug 17 00:27:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFABD107BB04; Fri, 17 Aug 2018 00:27:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75523816A1; Fri, 17 Aug 2018 00:27:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52A8D20E9D; Fri, 17 Aug 2018 00:27:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7H0Rw0e027571; Fri, 17 Aug 2018 00:27:58 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7H0RuML027564; Fri, 17 Aug 2018 00:27:56 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201808170027.w7H0RuML027564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 17 Aug 2018 00:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337938 - head/sys/crypto/libsodium X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/libsodium X-SVN-Commit-Revision: 337938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Aug 2018 00:27:59 -0000 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 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 +__FBSDID("$FreeBSD$"); +#include + +#include + +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 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 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 +__FBSDID("$FreeBSD$"); +#include +#include + +#include + +void +sodium_memzero(void *b, size_t n) +{ + explicit_bzero(b, n); +}