2021-03-21 18:46:20 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
|
|
|
|
2021-07-17 19:37:27 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-03-21 18:46:20 +00:00
|
|
|
pname = "bearssl";
|
2021-07-17 19:37:27 +01:00
|
|
|
version = "0.6";
|
2021-03-21 18:46:20 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://www.bearssl.org/bearssl-${version}.tar.gz";
|
2021-07-17 19:37:27 +01:00
|
|
|
sha256 = "057zhgy9w4y8z2996r0pq5k2k39lpvmmvz4df8db8qa9f6hvn1b7";
|
2021-03-21 18:46:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "lib" "dev" "out" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-10-11 09:57:45 +01:00
|
|
|
makeFlags = [
|
|
|
|
"AR=${stdenv.cc.targetPrefix}ar"
|
|
|
|
"CC=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"LD=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"LDDLL=${stdenv.cc.targetPrefix}cc"
|
|
|
|
] ++ lib.optional stdenv.hostPlatform.isStatic "DLL=no";
|
|
|
|
|
2021-03-21 18:46:20 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
install -D build/brssl $bin/brssl
|
|
|
|
install -D build/testcrypto $bin/testcrypto
|
2021-10-11 09:57:45 +01:00
|
|
|
install -Dm644 -t $lib/lib build/libbearssl.*
|
2021-03-21 18:46:20 +00:00
|
|
|
install -Dm644 -t $dev/include inc/*.h
|
|
|
|
touch $out
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://www.bearssl.org/";
|
|
|
|
description = "An implementation of the SSL/TLS protocol written in C";
|
|
|
|
longDescription = ''
|
|
|
|
BearSSL is an implementation of the SSL/TLS protocol (RFC 5246)
|
|
|
|
written in C. It aims at offering the following features:
|
|
|
|
|
|
|
|
* Be correct and secure. In particular, insecure protocol versions and
|
|
|
|
choices of algorithms are not supported, by design; cryptographic
|
|
|
|
algorithm implementations are constant-time by default.
|
|
|
|
|
|
|
|
* Be small, both in RAM and code footprint. For instance, a minimal
|
|
|
|
server implementation may fit in about 20 kilobytes of compiled code
|
|
|
|
and 25 kilobytes of RAM.
|
|
|
|
|
|
|
|
* Be highly portable. BearSSL targets not only “big” operating systems
|
|
|
|
like Linux and Windows, but also small embedded systems and even
|
|
|
|
special contexts like bootstrap code.
|
|
|
|
|
|
|
|
* Be feature-rich and extensible. SSL/TLS has many defined cipher
|
|
|
|
suites and extensions; BearSSL should implement most of them, and
|
|
|
|
allow extra algorithm implementations to be added afterwards,
|
|
|
|
possibly from third parties.
|
|
|
|
'';
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
maintainers = [ lib.maintainers.Profpatsch ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|