Remove use of OpenSSL for RSA PKCS1 encryption (#12). Closes #2

* Add handwritten RSA PKCS1 encryption using num-bigint and simple_asn1

* Add more logging to compare OpenSSL with/without side-by-side

* Log message and ciphertext in hex

* Print N and e as hexadecimal integers

* Fix bad encryption caused by zeros in PKCS1 padding

PS field in https://tools.ietf.org/html/rfc8017#section-7.2.1
Must be nonzero

* Use rand fill instead of rand_bytes

* Remove OpenSSL!

* Update CI scripts and docs to not install OpenSSL

* Remove copying OpenSSL DLLs (libeay and ssleay) in AppVeyor script

* Change rsa_public_encrypt_pkcs1 to return a Result<Vec<u8>, String>

* Add error checking, returning Err<String> on failure; RFC comments

* Add the required message representative range checking

* Use expect() instead of unwrap() on from_der

* Map the ASN.1 error to a String to return it from rsa_public_encrypt_pkcs1() instead of panicking

* Move RSA to a new crate, rsa_public_encrypt_pkcs1

https://github.com/iceiix/rsa_public_encrypt_pkcs1

* Update to rsa_public_encrypt_pkcs1 with simple_asn 0.1.0

https://github.com/iceiix/rsa_public_encrypt_pkcs1/issues/1

* Update to published version of rsa_public_encrypt_pkcs1, 0.1.0

* Remove unnecessarily added blank line

* Remove libssl-dev from .travis.yml
This commit is contained in:
iceiix 2018-11-04 09:40:51 -08:00 committed by GitHub
parent 38543feae7
commit 2be7a2ba6b
1 changed files with 0 additions and 10 deletions

View File

@ -19,7 +19,6 @@ use cfb8::Cfb8;
use cfb8::stream_cipher::{NewStreamCipher, StreamCipher};
use serde_json;
use reqwest;
use openssl;
pub mod mojang;
@ -694,7 +693,6 @@ pub enum Error {
IOError(io::Error),
Json(serde_json::Error),
Reqwest(reqwest::Error),
OpenSSL(openssl::error::ErrorStack),
}
impl convert::From<io::Error> for Error {
@ -715,12 +713,6 @@ impl convert::From<reqwest::Error> for Error {
}
}
impl convert::From<openssl::error::ErrorStack> for Error {
fn from(e: openssl::error::ErrorStack) -> Error {
Error::OpenSSL(e)
}
}
impl ::std::error::Error for Error {
fn description(&self) -> &str {
match *self {
@ -729,7 +721,6 @@ impl ::std::error::Error for Error {
Error::IOError(ref e) => e.description(),
Error::Json(ref e) => e.description(),
Error::Reqwest(ref e) => e.description(),
Error::OpenSSL(ref e) => e.description(),
}
}
}
@ -742,7 +733,6 @@ impl ::std::fmt::Display for Error {
Error::IOError(ref e) => e.fmt(f),
Error::Json(ref e) => e.fmt(f),
Error::Reqwest(ref e) => e.fmt(f),
Error::OpenSSL(ref e) => e.fmt(f),
}
}
}