aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/c_src/crypto.c
AgeCommit message (Collapse)Author
2013-06-12crypto: Supress some false positives from valgrindSverker Eriksson
2013-06-12crypto: Refactor remove resource for EC_KEYSverker Eriksson
The resource was not needed as it was never kept between external crypto calls.
2013-06-12crypto: Fix some compiler warningsSverker Eriksson
2013-06-11crypto: Fix bug with takover of EC resource typeSverker Eriksson
enif_open_resource_type() must be called even during repeated loading of same library. Otherwise the resource type will be deallocated when the old module instance is purged.
2013-06-07Teach crypto.c not to call enif_compute_timeslice with 0Patrik Nyblom
2013-06-05Add enif_consume_timeslice to appropriate crypto NIFsPatrik Nyblom
2013-06-04crypto: Avoid big binaries in nifsIngela Anderton Andin
2013-05-24crypto, public_key & ssl: Make more functions accept integer keysSverker Eriksson
2013-05-08crypto: Remove debug printoutsSverker Eriksson
2013-05-08ssl & crypto: Generalize the remaining crypto APIIngela Anderton Andin
2013-05-08crypto: Add generic functions generate_key and compute_keySverker Eriksson
and remove corresponding specific functions for srp and ecdh but leave dh_ functions for backward compatibility.
2013-05-08crypto: Fix ec_key resource to be upgradeableIngela Anderton Andin
2013-05-08crypto: Combine ec_key_new into ecdh_generate_keySverker Eriksson
and remove curve from the returned tuple.
2013-05-08crypto, public_key: Switch places of ecdh_compute_key argumentsSverker Eriksson
2013-05-08crypto, public_key & ssl: Change API to hide resource format for EC KEYSverker Eriksson
2013-05-08crypto: Allow integer keys for rsa_private/public_en/decryptSverker Eriksson
as well as mpint's for backward compatibility.
2013-05-08crypto: Introduce generic sign() and verify() functionsSverker Eriksson
for rsa, dss, and new ecdsa. No mpint's accepted.
2013-05-08crypto: Replaced all mpint's with normal binariesSverker Eriksson
2013-05-08CRYPTO: add support for Elliptic Curves to crypto appAndreas Schultz
Conflicts: lib/crypto/src/crypto.erl
2013-04-03crypto: New SRP APIIngela Anderton Andin
Adjust API to better fit in with similar funtions in crypto
2013-04-03CRYPTO: add algorithms/0 function that returns a list off compiled in crypto ↵Andreas Schultz
algorithms add algorithms/0 function that returns a list off compiled in crypto algorithms and make tests suites with SHA226, SHA256, SHA384 and SHA512 conditional based on that
2013-03-28CRYPTO: add support for RFC-2945 SRP-3 and RFC-5054 SRP-6a authenticationAndreas Schultz
2013-03-28crypto: Refactor mod_exp_nifSverker Eriksson
As a preparation for the new mod_exp_prime and in the quest to reduce to use of the old mpint format.
2012-12-19fix missing defines for RIPEMD160_CTX_LEN and RIPEMD160_LENMichael Loftis
A couple of #defines were missed in my previous patch.
2012-12-18add ripemd160 support to cryptoMichael Loftis
add ripemd160 message digest support to the crypto app, includes some test cases.
2012-12-04crypto: Let info_lib return header version instead of lib versionSverker Eriksson
2012-12-04crypto: Throw notsup for DES3 CFB encryption for old opensslSverker Eriksson
An attempt to enable the use of openssl 0.9.7
2012-10-22crypto: Link crypto_callback staticallySverker Eriksson
if static linking of openssl is used.
2012-10-22crypto: Add debug print macrosSverker Eriksson
2012-10-16crypto: Enable runtime upgrade of cryptoSverker Eriksson
2012-10-09crypto: Make unloading of crypto saferSverker Eriksson
Facts: crypto nif-lib registers callback functions that openssl uses for memory management and thread synchronization. The callback functions can only be set once, openssl does not allow changing the callback functions. Problem: If openssl is dynamicly linked to crypto, you might get s scenario where the crypto lib is unloaded while leaving openssl loaded with its old pointers to the unloaded crypto code intact. If crypto is then reloaded (by init:restart() for example), the crypto nif-lib might get relocated at a different address. crypto calls openssl which in turn calls the old invalid callback functions...kaboom. Solution: Break apart the callback functions into a separate dynamic lib that crypto loads with dlopen. When crypto is unloaded the callback lib is left in place to be reused if/when crypto is loaded again.
2012-08-29crypto: Fix buffer overflow bug in rsa_signSverker Eriksson
2012-08-23Merge branch 'ia/ssl/tls1.1and1.2' into maintIngela Anderton Andin
* ia/ssl/tls1.1and1.2: (46 commits) ssl: Clean up of code thanks to dialyzer ssl: Test suite adjustments ssl & public_key: Prepare for release ssl: Use crypto:strong_rand_bytes if possible ssl & public_key: Add use of more "sha-rsa oids" ssl: Fix inet header option to behave as in inet ssl: TLS 1.2: fix hash and signature handling ssl: TLS 1.2: fix Certificate Request list of Accepted Signatur/Hash combinations ssl: Add Signature Algorithms hello extension from TLS 1.2 ssl: Fix rizzo tests to run as intended ssl: TLS-1.1 and TLS-1.2 support should not be default until R16 ssl: Signture type bug ssl: Add crypto support check (TLS 1.2 require sha256 support) ssl: Dialyzer fixes ssl: IDEA cipher is deprecated by TLS 1.2 ssl: Run relevant tests for all SSL/TLS versions ssl: Add TLS version switches to openssl tests ssl: Enable TLS 1.2 ssl: Enable mac_hash for TLS 1.2 ssl: Implement TLS 1.2 signature support ...
2012-08-22crypto: Add sha224 for rsa sign/verifySverker Eriksson
2012-08-22crypto: Add sha224Sverker Eriksson
2012-08-22crypto: fix hmac_sha384 and add hmac test cases from RFC-4231Andreas Schultz
2012-08-22crypto: Add sha384Sverker Eriksson
2012-08-22crypto: Cleanup code for sha256 and sha512Sverker Eriksson
2012-08-22crypto: Add SHA256 and SHA512 based MACsAndreas Schultz
2012-08-22crypto: Redo interface for rsa and dss hash signingSverker Eriksson
Replace _hash functions with {digest,_} argument to existing sign/verify functions.
2012-08-22crypto: Add rsa and dss hash signing supportAndreas Schultz
2012-07-04crypto: Allow aes_cfb_128_{en|de}crypt to accept unaligned dataSverker Eriksson
Remove the need for padding up to 16-byte multiple.
2012-04-20crypto: Optimize RSA private key handlingSverker Eriksson
by using extra redundant information as part of the key that will speed things up for OpenSSL. Affects rsa_sign, rsa_private_encrypt and rsa_private_decrypt.
2011-11-30crypto: Add sha{256,384,512} to rsa_verifySverker Eriksson
2011-11-30crypto: Add sha256 and sha512Sverker Eriksson
No test and doc
2011-11-01Additions to crypto and public_key needed for full PKCS-8 supportIngela Anderton Andin
2011-10-18[crypto] Add DES and Triple DES cipher feedback (CFB) mode functionsPaul Guyot
2011-05-18Add true streaming AES (CTR) encryption and streaming HMAC operationsTravis Jensen
The current crypto module implementations require all of the data being encrypted or authenticated to be in memory at one time. When trying to encrypt or authenticate a large file (on order of GBs), this is problematic. The implementation of AES CTR uses the same underlying implementation as aes_ctr_[en|de]crypt, but hands the state back to the client after every operation. The HMAC implementation differs from the previous implementations of sha_mac and md5_mac. The old implementations did not utilize the OpenSSL HMAC implementation. In order to ensure that I didn't implement something incorrectly, I chose to use the OpenSSL HMAC implementation directly, since it handles streaming as well. This has the added side benefit of allowing other hash functions to be used as desired (for instances, I added support for ripemd160 hashing). While I haven't done this, it seems like the existing md5_mac and sha_mac functions could either be depricated or redefined in terms of the new hmac_ functions. Update AES CTR and HMAC streaming with code review input Ensure that memcpy operations in hmac operations are being size checked properly. Rename aes_ctr_XXX_with_state to aes_ctr_stream_XXX. Remove redundant hmac_init_[sha|md5|ripemd160] functions. Fix documentation for hmac_final_n. Fix possible error using negative value as a marker on an unsigned int Now, use a separate marker and add a unit test to test specifically for a case where HashLen is larger than the underlying resultant hash. Revert "Fix possible error using negative value as a marker on an unsigned int" This reverts commit 59cb177aa96444c0fd3ace6d01f7b8a70dd69cc9. Resolve buffer overflow posibility on an unsigned int. Change handling the marker for HashLen to use the fact that a second parameter that has to be the the HashLen was passed. Also, ensure that HashLen parameter is positive.
2011-04-19Renamed the function strong_rand_uniform to strong_rand_mpint.Niclas Eklund
Added some checks in crypto.erl and crypto.c. Changed ssh_bits to use strong_rand_mpint.
2011-04-15Adds NIFs for cryptographically strong random number generation.Niclas Eklund
Also adds documentation and unit tests. Thanks to Geoff Cant.