summaryrefslogtreecommitdiff
path: root/sys/include/libsec.h
AgeCommit message (Collapse)Author
2020-03-01libsec: move AES XTS function prototypes to AES definition section in the ↵cinap_lenrek
header file
2020-03-01libsec: remove hash pickle functions, document ripemd160, cleanup sechash(2) ↵cinap_lenrek
manpage
2019-08-30auth/rsa2asn1: implement private key export with -a flag (thanks kvik)cinap_lenrek
kvik writes: I needed to convert the RSA private key that was laying around in secstore into a format understood by UNIX® tools like SSH. With asn12rsa(8) we can go from the ASN.1/DER to Plan 9 format, but not back - so I wrote the libsec function asn1encodeRSApriv(2) and used it in rsa2asn1(8) by adding the -a flag which causes the full private key to be encoded and output.
2018-01-06libsec: remove asn1toDSApriv()cinap_lenrek
2017-12-30libsec: implement SPKI fingerprinting for okCertificate()cinap_lenrek
Instead of only using a hash over the whole certificate for white/black-listing, now we can also use a hash over the Subject Public Key Info (SPKI) field of the certificate which contians the public key algorithm and the public key itself. This allows certificates to be renewed independendtly of the public key. X509dump() now prints the public key thumbprint in addition to the certificate thumbprint. tlsclient will print the certificate when run with -D flag. okCertificate() will print the public key thumbprint in its error string when no match has been found.
2017-11-12libsec: AES-NI support for amd64cinap_lenrek
Add assembler versions for aes_encrypt/aes_decrypt and the key setup using AES-NI instruction set. This makes aes_encrypt and aes_decrypt into function pointers which get initialized by the first call to setupAESstate(). Note that the expanded round key words are *NOT* stored in big endian order as with the portable implementation. For that reason the AESstate.ekey and AESstate.dkey fields have been changed to void* forcing an error when someone is accessing the roundkey words. One offender was aesXCBmac, which doesnt appear to be used and the code looks horrible so it has been deleted. The AES-NI implementation is for amd64 only as it requires the kernel to save/restore the FPU state across syscalls and pagefaults.
2017-10-29libsec: rewrite aex_xts_encrypt()/aes_xts_decrypt()cinap_lenrek
the previous implementation was not portable at all, assuming little endian in gf_mulx() and that one can cast unaligned pointers to ulong in xor128(). also the error code is likely to be ignored, so better abort() when the length is not a multiple of the AES block size. we also pass in full AESstate structures now instead of the expanded key longs, so that we do not need to hardcode the number of rounds. this allows each indiviaul keys to be bigger than 128 bit.
2017-10-17libsec: make sectorNumber argument for aes_xts routines uvlongcinap_lenrek
2017-10-17libsec: add AES CFB and AES OFB stream cipherscinap_lenrek
2017-10-06libsec: export asn1encodedigest(), asn1encodeRSApub(), asn1toRSApub(), ↵cinap_lenrek
pkcs1padbuf() and pkcs1unpadbuf()
2017-04-23libsec: sha256 support for thumbprint files, use it in ssh as wellcinap_lenrek
initThumbprints() now takes an application tag argument so x509 and ssh can coexist. the thumbprint entries can now hold both sha1 and sha256 hashes. okThumbprint() now takes a len argument for the hash length used. the new function okCertificate() hashes the certificate with both and checks for any matches. on failure, okCertificate() returns 0 and sets error string. we also check for include loops now in thumbfiles, limiting the number of includes to 8.
2017-02-10ec(2), rsa(2): document X509toECpub(), X509ecdsaverify(), ↵cinap_lenrek
X509ecdsaverifydigest(), X509rsaverifydigest()
2017-02-10libsec: make X509toECpub() return CN name like X509toRSApub()cinap_lenrek
2017-01-12libsec: implement extended 192-bit nonce xchacha variant and hchacha functioncinap_lenrek
2016-10-30libsec: add secp384r1 curve parameters for tlscinap_lenrek
2016-07-10libsec: add scrypt password based key derivation functioncinap_lenrek
2016-04-20libsec: implement elliptic curve group operations in jacobian coordinate systemcinap_lenrek
2016-03-23add portable AES-GCM (Galois/Counter Mode) implementation to libsec and devtlscinap_lenrek
2016-02-28libsec: have 16 32-bit words in DigestState to avoid out of bounds warnings ↵cinap_lenrek
for poly1305
2016-02-01libsec: ecdsa client support for tlshand, cleanupscinap_lenrek
2016-01-19libsec: add salsa20 stream ciphercinap_lenrek
2015-12-25libsec: implement TLS-PSK for tlsClient()/tlsServer()cinap_lenrek
2015-11-26libsec: add chacha20 poly1305 aead, allow 64 bit iv's for chacha, add tsmemcmp()cinap_lenrek
chacha20 comes in two variants: ietf rfc7539, using 96 bit iv and 32 bit counter and draft-agl-tls-chacha20poly1305 using 64 bit iv and a 64 bit counter. so setupChachastate() now takes a ivlen argument which sets the mode. add ccpoly_encrypt()/ccpoly_decrypt() routines. to implement timing safe ccpoly_decrypt(), a constant time memcmp was needed, so adding tsmemcmp() to libsec.
2015-10-22libsec: add chacha cipher (from charles forsyth)cinap_lenrek
2015-10-22libsec: add poly1305cinap_lenrek
2015-09-22libsec: implement dh parameter signature verification, stop lying about ↵cinap_lenrek
non-rsa ciphers, fix memory leaks in X509 code actually verify the diffie hellman parameter signature, this comes in two flavours. TLS1.2 uses X509 signature with a single hash specified by the signature algorithm field in the signature itself and pre TLS1.2 where md5+sha1 hashes of the signed blob are pkcs1 padded and encrypted with the rsa private key. stop advertizing non-rsa cipher suits (DSS and ECDSA), as we have not implmenented them. fix some memory leaks in X509 code while we'r at it.
2015-09-02libsec: add rfc5869 hmac-based key derivation function hkdf_x()cinap_lenrek
2015-09-02libsec: generalize pbkdf2_hmac_sha1() to pbkdf2_x() passing the hmac as an ↵cinap_lenrek
argument
2015-09-01libsec: add curve25519 diffie hellmancinap_lenrek
2015-09-01libsec: remove flawed aes() digest and hmac_aes() implementations (thanks aiju)cinap_lenrek
2015-08-28libsec: add curve25519() from http://code.google.com/p/curve25519-donna/cinap_lenrek
this is a portable version of curve25519() by google.
2015-08-26libsec: add q parameter to dh_new() for subgroup support, sanitize dh parameterscinap_lenrek
2015-08-25fix fuckupglenda
2015-08-25import E script from bell labsmischief
2015-08-20libsec: add pbkdf2_hmac_sha1() (from wpapsk factotum module)cinap_lenrek
2015-05-21libsec: implement tlsClient support for RFC6066 server name identification (SNI)cinap_lenrek
tlsClient() now can optionally send the server_name in the ClientHello message by setting the TLSconn.serverName. This is required for some https sites.
2015-04-29libsec: remove aesCTRencrypt()/aesCTRdecrypt() (thanks mischief and qrstuv)cinap_lenrek
as mischief and qrstuv point out, these functions are not very usefull and are even implemented wrong (incrementCTR()), so deleting the code.
2014-09-14libsec: add diffie-hellman functionscinap_lenrek
2012-06-06added ecdsa to factotumaiju
2012-06-04added elliptic curve stuff and RIPEMD-160aiju
2011-05-24devfs crypto code - alpha versiontaruti
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso image - sys/includeTaru Karttunen