From eb7b7bf8478be66b4849f2d336dbffd6a8374284 Mon Sep 17 00:00:00 2001 From: Gleb Kozyrev Date: Sat, 10 Jan 2015 13:45:33 +0200 Subject: Change Hasher and HMAC APIs closer to std::hash model - Implement Clone and std::io::Writer. - Reduce the API to write() and finish(). Contrary to std::hash, finish() resets the hasher immediately. - Add hmac::hmac() convenience fn. - Replace hash::evpmd() with HashType methods. - Add assertions as a crude check for failed calls into openssl. - Add examples and some tests. [breaking-change] --- openssl-sys/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'openssl-sys/src') diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 9f80fb1c..b2e2d312 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -370,6 +370,7 @@ extern "C" { pub fn EVP_DigestFinal_ex(ctx: *mut EVP_MD_CTX, res: *mut u8, n: *mut u32) -> c_int; pub fn EVP_MD_CTX_create() -> *mut EVP_MD_CTX; + pub fn EVP_MD_CTX_copy_ex(dst: *mut EVP_MD_CTX, src: *const EVP_MD_CTX) -> c_int; pub fn EVP_MD_CTX_destroy(ctx: *mut EVP_MD_CTX); pub fn EVP_PKEY_new() -> *mut EVP_PKEY; @@ -383,6 +384,7 @@ extern "C" { pub fn HMAC_Final(ctx: *mut HMAC_CTX, output: *mut u8, len: *mut c_uint) -> c_int; pub fn HMAC_Update(ctx: *mut HMAC_CTX, input: *const u8, len: c_uint) -> c_int; pub fn HMAC_CTX_cleanup(ctx: *mut HMAC_CTX); + pub fn HMAC_CTX_copy(dst: *mut HMAC_CTX, src: *const HMAC_CTX) -> c_int; pub fn PEM_read_bio_X509(bio: *mut BIO, out: *mut *mut X509, callback: Option, -- cgit v1.2.3