Skip to content

Commit

Permalink
Merge branch 'my-temp-work'
Browse files Browse the repository at this point in the history
  • Loading branch information
bvinc committed Nov 7, 2017
2 parents b23e5b5 + 5eea316 commit 4a6fe97
Show file tree
Hide file tree
Showing 11 changed files with 517 additions and 139 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ job: &JOB
steps:
- checkout
- run: apt-get update
- run: apt-get remove -y libssl-dev
- run: ./test/add_target.sh
- *RESTORE_REGISTRY
- run: cargo generate-lockfile
Expand Down Expand Up @@ -68,10 +69,10 @@ job: &JOB

openssl_110: &OPENSSL_110
LIBRARY: openssl
VERSION: 1.1.0f
VERSION: 1.1.0g
openssl_102: &OPENSSL_102
LIBRARY: openssl
VERSION: 1.0.2l
VERSION: 1.0.2m
openssl_101: &OPENSSL_101
LIBRARY: openssl
VERSION: 1.0.1u
Expand Down
12 changes: 4 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ environment:
- TARGET: i686-pc-windows-gnu
BITS: 32
MSYS2: 1
OPENSSL_VERSION: 1_1_0f
OPENSSL_VERSION: 1_1_0g
- TARGET: x86_64-pc-windows-msvc
BITS: 64
OPENSSL_VERSION: 1_1_0f
OPENSSL_VERSION: 1_1_0g
OPENSSL_DIR: C:\OpenSSL

# 1.0.2, 64/32 bit
- TARGET: x86_64-pc-windows-gnu
BITS: 64
MSYS2: 1
OPENSSL_VERSION: 1_0_2L
OPENSSL_VERSION: 1_0_2m
- TARGET: i686-pc-windows-msvc
BITS: 32
OPENSSL_VERSION: 1_0_2L
OPENSSL_VERSION: 1_0_2m
OPENSSL_DIR: C:\OpenSSL
- TARGET: x86_64-pc-windows-msvc
VCPKG_DEFAULT_TRIPLET: x64-windows
Expand Down Expand Up @@ -48,7 +48,3 @@ build: false
test_script:
- cargo run --manifest-path systest/Cargo.toml --target %TARGET%
- cargo test --manifest-path openssl/Cargo.toml --target %TARGET%

cache:
- target
- C:\Users\appveyor\.cargo\registry
2 changes: 1 addition & 1 deletion openssl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ tempdir = "0.3"
winapi = "0.2"
ws2_32-sys = "0.2"
hex = "0.2"
data-encoding = "1.2"
data-encoding = "2.0"
2 changes: 1 addition & 1 deletion openssl/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2011 Google Inc.
Copyright 2011-2017 Google Inc.
2013 Jack Lloyd
2013-2014 Steven Fackler

Expand Down
15 changes: 7 additions & 8 deletions openssl/examples/mk_certs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
extern crate openssl;

use openssl::asn1::Asn1Time;
use openssl::bn::BigNum;
use openssl::bn::{BigNum, MSB_MAYBE_ZERO};
use openssl::error::ErrorStack;
use openssl::hash::MessageDigest;
use openssl::pkey::{PKey, PKeyRef};
use openssl::rand::rand_bytes;
use openssl::rsa::Rsa;
use openssl::x509::{X509, X509Ref};
use openssl::x509::{X509NameBuilder, X509Req, X509ReqBuilder};
Expand All @@ -30,9 +29,9 @@ fn mk_ca_cert() -> Result<(X509, PKey), ErrorStack> {
let mut cert_builder = X509::builder()?;
cert_builder.set_version(2)?;
let serial_number = {
let mut buf = [0;20];
rand_bytes(&mut buf)?;
BigNum::from_slice(&buf)?.to_asn1_integer()?
let mut serial = BigNum::new()?;
serial.rand(159, MSB_MAYBE_ZERO, false)?;
serial.to_asn1_integer()?
};
cert_builder.set_serial_number(&serial_number)?;
cert_builder.set_subject_name(&x509_name)?;
Expand Down Expand Up @@ -88,9 +87,9 @@ fn mk_ca_signed_cert(ca_cert: &X509Ref, ca_privkey: &PKeyRef) -> Result<(X509, P
let mut cert_builder = X509::builder()?;
cert_builder.set_version(2)?;
let serial_number = {
let mut buf = [0;20];
rand_bytes(&mut buf)?;
BigNum::from_slice(&buf)?.to_asn1_integer()?
let mut serial = BigNum::new()?;
serial.rand(159, MSB_MAYBE_ZERO, false)?;
serial.to_asn1_integer()?
};
cert_builder.set_serial_number(&serial_number)?;
cert_builder.set_subject_name(req.subject_name())?;
Expand Down
Loading

0 comments on commit 4a6fe97

Please sign in to comment.