diff options
| author | Mathijs van de Nes <[email protected]> | 2014-09-12 15:36:00 +0200 |
|---|---|---|
| committer | Mathijs van de Nes <[email protected]> | 2014-09-12 15:36:00 +0200 |
| commit | 7685a8349c2d022667ca53f9e3fb07e6c6f676e9 (patch) | |
| tree | 30fb23e39d0a6e9c88ef48efb5cdfb21c0d8ff88 /src | |
| parent | Switch PKey load/save functions to RSA specific (diff) | |
| download | rust-openssl-7685a8349c2d022667ca53f9e3fb07e6c6f676e9.tar.xz rust-openssl-7685a8349c2d022667ca53f9e3fb07e6c6f676e9.zip | |
Switch to the more sane RSA PUBKEY function
For differences, see:
http://openssl.6102.n7.nabble.com/difference-between-i2d-PUBKEY-and-i2d-PublicKey-td43869.html
This will break loading of *public* keys generated before this commit
Diffstat (limited to 'src')
| -rw-r--r-- | src/crypto/pkey.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/crypto/pkey.rs b/src/crypto/pkey.rs index b1925293..4eb9bf40 100644 --- a/src/crypto/pkey.rs +++ b/src/crypto/pkey.rs @@ -18,8 +18,8 @@ extern { fn EVP_PKEY_get1_RSA(k: *mut EVP_PKEY) -> *mut RSA; fn EVP_PKEY_set1_RSA(k: *mut EVP_PKEY, r: *mut RSA) -> c_int; - fn i2d_RSAPublicKey(k: *mut RSA, buf: *const *mut u8) -> c_int; - fn d2i_RSAPublicKey(k: *const *mut RSA, buf: *const *const u8, len: c_uint) -> *mut RSA; + fn i2d_RSA_PUBKEY(k: *mut RSA, buf: *const *mut u8) -> c_int; + fn d2i_RSA_PUBKEY(k: *const *mut RSA, buf: *const *const u8, len: c_uint) -> *mut RSA; fn i2d_RSAPrivateKey(k: *mut RSA, buf: *const *mut u8) -> c_int; fn d2i_RSAPrivateKey(k: *const *mut RSA, buf: *const *const u8, len: c_uint) -> *mut RSA; @@ -136,14 +136,14 @@ impl PKey { * Returns a serialized form of the public key, suitable for load_pub(). */ pub fn save_pub(&self) -> Vec<u8> { - self._tostr(i2d_RSAPublicKey) + self._tostr(i2d_RSA_PUBKEY) } /** * Loads a serialized form of the public key, as produced by save_pub(). */ pub fn load_pub(&mut self, s: &[u8]) { - self._fromstr(s, d2i_RSAPublicKey); + self._fromstr(s, d2i_RSA_PUBKEY); self.parts = Public; } |