aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2016-06-22 21:51:43 +0200
committerJonas Schievink <[email protected]>2016-06-26 18:25:54 +0200
commitc1b7cd2420c679b611c7ff28024db10cb0ffb8b5 (patch)
tree0dfec2acf761fbaaf45409ad81c4c156b8ae22a1 /openssl/src
parentAdd RSA::private_key_from_pem_cb (diff)
downloadrust-openssl-c1b7cd2420c679b611c7ff28024db10cb0ffb8b5.tar.xz
rust-openssl-c1b7cd2420c679b611c7ff28024db10cb0ffb8b5.zip
Make the callback take a `&mut [c_char]`
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/crypto/pkey.rs4
-rw-r--r--openssl/src/crypto/rsa.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/openssl/src/crypto/pkey.rs b/openssl/src/crypto/pkey.rs
index 605aed42..238c1b9e 100644
--- a/openssl/src/crypto/pkey.rs
+++ b/openssl/src/crypto/pkey.rs
@@ -1,4 +1,4 @@
-use libc::{c_int, c_uint, c_ulong, c_void};
+use libc::{c_int, c_uint, c_ulong, c_void, c_char};
use std::io;
use std::io::prelude::*;
use std::iter::repeat;
@@ -100,7 +100,7 @@ impl PKey {
/// The callback will be passed the password buffer and should return the number of characters
/// placed into the buffer.
pub fn private_key_from_pem_cb<R, F>(reader: &mut R, pass_cb: F) -> Result<PKey, SslError>
- where R: Read, F: FnMut(&mut [i8]) -> usize
+ where R: Read, F: FnMut(&mut [c_char]) -> usize
{
let mut cb = CallbackState::new(pass_cb);
diff --git a/openssl/src/crypto/rsa.rs b/openssl/src/crypto/rsa.rs
index d451aab6..c7f5cfaf 100644
--- a/openssl/src/crypto/rsa.rs
+++ b/openssl/src/crypto/rsa.rs
@@ -3,7 +3,7 @@ use std::fmt;
use ssl::error::{SslError, StreamError};
use std::ptr;
use std::io::{self, Read, Write};
-use libc::{c_int, c_void};
+use libc::{c_int, c_void, c_char};
use bn::BigNum;
use bio::MemBio;
@@ -79,7 +79,7 @@ impl RSA {
/// Reads an RSA private key from PEM formatted data and supplies a password callback.
pub fn private_key_from_pem_cb<R, F>(reader: &mut R, pass_cb: F) -> Result<RSA, SslError>
- where R: Read, F: FnMut(&mut [i8]) -> usize
+ where R: Read, F: FnMut(&mut [c_char]) -> usize
{
let mut cb = CallbackState::new(pass_cb);