OpenCrypto: Convert sessions to opaque handles instead of integersTrack session objects in the framework, and pass handles between theframework (OCF), consumers, and drivers. Avoid redundancy and
OpenCrypto: Convert sessions to opaque handles instead of integersTrack session objects in the framework, and pass handles between theframework (OCF), consumers, and drivers. Avoid redundancy and complexity inindividual drivers by allocating session memory in the framework andproviding it to drivers in ::newsession().Session handles are no longer integers with information encoded in varioushigh bits. Use of the CRYPTO_SESID2FOO() macros should be replaced with theappropriate crypto_ses2foo() function on the opaque session handle.Convert OCF drivers (in particular, cryptosoft, as well as myriad others) tothe opaque handle interface. Discard existing session tracking as much aspossible (quick pass). There may be additional code ripe for deletion.Convert OCF consumers (ipsec, geom_eli, krb5, cryptodev) to handle-styleinterface. The conversion is largely mechnical.The change is documented in crypto.9.Inspired byhttps://lists.freebsd.org/pipermail/freebsd-arch/2018-January/018835.html .No objection from: ae (ipsec portion)Reported by: jhb
show more ...
MFV: libb2: use native calls for secure memory clearanceDrop our local patch and restore full vanilla upstream code incontrib/libb2.No functional change intended. explicit_bzero() should contin
MFV: libb2: use native calls for secure memory clearanceDrop our local patch and restore full vanilla upstream code incontrib/libb2.No functional change intended. explicit_bzero() should continue to be used.Obtained from: libb2 b4b241a34824b51956a7866606329a065d397525Sponsored by: Dell EMC Isilon
Import Blake2 algorithms (blake2b, blake2s) from libb2The upstream repository is on github BLAKE2/libb2. Files landed insys/contrib/libb2 are the unmodified upstream files, except for onediffere
Import Blake2 algorithms (blake2b, blake2s) from libb2The upstream repository is on github BLAKE2/libb2. Files landed insys/contrib/libb2 are the unmodified upstream files, except for onedifference: secure_zero_memory's contents have been replaced withexplicit_bzero() only because the previous implementation broke powerpclink. Preferential use of explicit_bzero() is in progress upstream, soit is anticipated we will be able to drop this diff in the future.sys/crypto/blake2 contains the source files needed to port libb2 to ourbuild system, a wrapped (limited) variant of the algorithm to match the APIof our auth_transform softcrypto abstraction, incorporation into the OpenCrypto Framework (OCF) cryptosoft(4) driver, as well as an x86 SSE/AVXaccelerated OCF driver, blake2(4).Optimized variants of blake2 are compiled for a number of x86 machines(anything from SSE2 to AVX + XOP). On those machines, FPU context will needto be explicitly saved before using blake2(4)-provided algorithms directly.Use via cryptodev / OCF saves FPU state automatically, and use via theauth_transform softcrypto abstraction does not use FPU.The intent of the OCF driver is mostly to enable testing in userspace via/dev/crypto. ATF tests are added with published KAT test vectors tovalidate correctness.Reviewed by: jhb, markjObtained from: github BLAKE2/libb2Differential Revision: https://reviews.freebsd.org/D14662