fork of boring2 with prefix patch
Go to file
Valerii Hiora 59b843517d BN_is_zero as a Rust function
Although wrapping was relatively easy it basically meant
that we depend on C compilation which becomes nightmare
as soon as multiple platforms are used. I’ve got a huge pain
once iOS was involved with 3 device archs and 2 simulator 
arches to support, not mentioning different set of include 
and lib flags.

So there are 2 different approaches:

- continue this way, maintaining all compilation issues like
  like managing correct flags, providing correct paths and so
  on. This way our Makefile will grow extremely fast and will
  actually take more efforts to maintain.

- doing it pure Rust way. In this case we provide all the 
  macros expansions inside our wrappers and there should be
  no other way to access raw data other than through those 
  wrappers. It might be fragile if OpenSSL internal data 
  structures will ever change, but I think (or hope) it is 
  pretty stable and wouldn’t change anytime soon.

This PR eliminates `BN_is_zero` at all from public API. It’s
functionality is implemented in `BigNum.is_zero` and should 
be enough. 

Additional notes:

1. I’ve moved BIGNUM into `bn` so it could access fields
   directly and keep it as an opaque structure for everyone 
   else

2. I’ve kept empty Makefile as I hope to land `feature-matrix`
   branch soon and I don’t like merging deleted/added file 
   conflicts.
2014-10-09 19:25:07 +03:00
native Add a dummy bn_is_zero C dependency to wrap BN_is_zero 2014-10-04 18:18:02 -07:00
src BN_is_zero as a Rust function 2014-10-09 19:25:07 +03:00
test Integrate everything 2013-12-28 18:39:07 -07:00
.gitignore Shift directory structure 2014-08-03 19:16:09 -07:00
.travis.yml Ignore stderr from openssl s_server 2014-10-05 13:49:47 -07:00
Cargo.toml BN_is_zero as a Rust function 2014-10-09 19:25:07 +03:00
LICENSE Update copyright date 2014-01-15 21:43:09 -08:00
Makefile BN_is_zero as a Rust function 2014-10-09 19:25:07 +03:00
README.md Update README.md 2014-09-09 22:56:05 -07:00

README.md

rust-openssl Build Status

See the rustdoc output.

Building

rust-openssl needs to link against the OpenSSL devleopment libraries on your system. It's very easy to get them on Linux.
For some reason, the OpenSSL distribution for Windows is structured differently, so it's a little more involved, but it is possible to build rust-openssl successfully on Windows.

###Linux

  1. Run sudo apt-get install libssl-dev.
  2. Run cargo build.

###Windows

  1. Grab the latest Win32 OpenSSL installer here. At the time of this writing, it's v1.0.1i. If you're using 64-bit Rust (coming to Windows soon), then you should get the Win64 installer instead.
  2. Run the installer, making note of where it's installing OpenSSL. The option to copy the libraries to the Windows system directory or [OpenSSL folder]/bin is your choice. The latter is probably preferable, and the default.
  3. Navigate to [OpenSSL folder]/lib/MinGW/, and copy libeay32.a and ssleay32.a (If 64-bit, then they will have 64 instead of 32.) to your Rust install's libs folder. The default should be:
  • 32-bit: C:\Program Files (x86)\Rust\bin\rustlib\i686-pc-mingw32\lib
  • 64-bit: TODO
  1. Rename libeay32.a and ssleay32.a to libcrypto.a and libssl.a, respectively.
  2. Run cargo build.

###Testing Several tests expect a local test server to be running to bounce requests off of. It's easy to do this. Open a separate terminal window and cd to the rust-openssl directory. Then run one of the following commands:

  • Windows: openssl s_server -accept 15418 -www -cert test/cert.pem -key test/key.pem > NUL
  • Linux: openssl s_server -accept 15418 -www -cert test/cert.pem -key test/key.pem >/dev/null

Then in the original terminal, run cargo test. If everything is set up correctly, all tests should pass. You might get some warnings in the openssl s_server window. Those aren't anything to worry about. You can stop the server using Control-C.