Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Sep 2018 22:28:27 +0000 (UTC)
From:      =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= <dumbbell@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r480986 - in head/lang/rust: . files
Message-ID:  <201809302228.w8UMSRYx031500@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dumbbell
Date: Sun Sep 30 22:28:27 2018
New Revision: 480986
URL: https://svnweb.freebsd.org/changeset/ports/480986

Log:
  lang/rust: Add patches to support LibreSSL 2.8.1
  
  PR:		230470
  Reported by:	Charlie Li <ml+freebsd@vishwin.info>

Added:
  head/lang/rust/files/patch-src_vendor_openssl-sys_.cargo-checksum.json   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_build_cfgs.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_build_main.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_aes.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_asn1.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_bio.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_bn.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_cms.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_conf.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_crypto.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_dh.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_dsa.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_dtls1.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_ec.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_err.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_evp.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_hmac.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_lib.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_libressl_mod.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_libressl_v250.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_libressl_v251.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_libressl_v273.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_macros.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_obj__mac.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_object.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_ocsp.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_openssl_mod.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_openssl_v10x.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_openssl_v110.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_openssl_v111.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_ossl__typ.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_pem.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_pkcs12.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_rand.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_rsa.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_safestack.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_sha.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_srtp.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_ssl.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_ssl3.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_stack.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_tls1.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_x509.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_x509__vfy.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl-sys_src_x509v3.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl_build.rs   (contents, props changed)
  head/lang/rust/files/patch-src_vendor_openssl_src_ssl_callbacks.rs   (contents, props changed)
Modified:
  head/lang/rust/Makefile

Modified: head/lang/rust/Makefile
==============================================================================
--- head/lang/rust/Makefile	Sun Sep 30 21:41:44 2018	(r480985)
+++ head/lang/rust/Makefile	Sun Sep 30 22:28:27 2018	(r480986)
@@ -162,8 +162,7 @@ post-patch:
 # `.cargo-checksum.json` to reflect the new checksums verified by Cargo.
 	@for dir in "${WRKSRC}/src/vendor/libc" \
 	"${WRKSRC}/src/vendor/libgit2-sys" \
-	"${WRKSRC}/src/vendor/openssl" \
-	"${WRKSRC}/src/vendor/openssl-sys"; do \
+	"${WRKSRC}/src/vendor/openssl"; do \
 		if ! test -d "$$dir"; then \
 			continue; \
 		fi; \

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_.cargo-checksum.json
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_.cargo-checksum.json	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,6 @@
+--- src/vendor/openssl-sys/.cargo-checksum.json.orig	2018-09-11 04:49:55 UTC
++++ src/vendor/openssl-sys/.cargo-checksum.json
+@@ -1 +1 @@
+-{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"15b9e9f5255d11898d5f373ba8ac750d567155b1c81fa903f02e97b18cea5f18","Cargo.toml.orig":"3ec9308dd6326a80e0e30c076dd778f42cb1f1f616e666e924a210554681dd97","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"15b264aba47e69aa522c8cb37b320a156f0c3a3a72393338818046eac8ef4c3a","build/cfgs.rs":"b853b4100ed5421e4f4d436c3bb067f33c2a0349ff64ee121390bf23e1b769d5","build/main.rs":"bbb6b8a9b43fa47dc985c84ab6a5e64d7b77ae60c54b3038b68a4cef1a6759ab","src/lib.rs":"008a98eb5da8cb154b8f59904a9524a0a9cb22818ec734696c52d7ece384ab97","src/libressl/mod.rs":"412020ed9f0cbbb500f3f4d7157d8b2fc4a86eab6f6ba3293ca6ffd7bd0ac4f6","src/libressl/v250.rs":"8e64255d67e9e684b6d76184f96cfb8dca34c7f241fdbc08a982a221644257ea","src/libressl/v251.rs":"e823b2b5b103a9a2b3c307893f6fc8ca4213104fe3829b32fa3ce879bbc1ada9","src/libressl/v273.rs":"01492f8c44438a82466eac1b827dbed3213f21f0b5f
 6425259a0131e9e036aeb","src/openssl/mod.rs":"b63d420700cb96626e7795a10000e178477af90db6d6830c70a66f6d2b4e64d2","src/openssl/v10x.rs":"6b53ce40257a5ff8326ec5f0d6a83807c728c243ad5bde34b9782cdf8f157a21","src/openssl/v110.rs":"0e670f6af0bfbdb635012a3667b599a2b7c468e55ef29b289ab288e01c795e02","src/openssl/v111.rs":"26e5ef4c4faa628d8cec33cf77fc3736f9d01334227429114e91920439b65876"},"package":"912f301a749394e1025d9dcddef6106ddee9252620e6d0a0e5f8d0681de9b129"}
+\ No newline at end of file
++{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"15b9e9f5255d11898d5f373ba8ac750d567155b1c81fa903f02e97b18cea5f18","Cargo.toml.orig":"3ec9308dd6326a80e0e30c076dd778f42cb1f1f616e666e924a210554681dd97","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"15b264aba47e69aa522c8cb37b320a156f0c3a3a72393338818046eac8ef4c3a","build/cfgs.rs":"499f32ddaa16e3771dca2b70f1d4f66f91491456ffb3e1954901abd57bc64e10","build/main.rs":"2383c602ce6ab23e9980e0d1dcf808ae5fb953c3b6ec7d7ea406293ddde679fd","src/lib.rs":"d3cd894a42d59f3e3d19ef1a376f2287971b68227c3ce142b307c5c05e1b2840"},"package":"912f301a749394e1025d9dcddef6106ddee9252620e6d0a0e5f8d0681de9b129"}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_build_cfgs.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_build_cfgs.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,22 @@
+--- src/vendor/openssl-sys/build/cfgs.rs.orig	2018-09-11 04:49:55 UTC
++++ src/vendor/openssl-sys/build/cfgs.rs
+@@ -16,6 +16,9 @@ pub fn get(openssl_version: Option<u64>, libressl_vers
+         if libressl_version >= 0x2_07_03_00_0 {
+             cfgs.push("libressl273");
+         }
++        if libressl_version >= 0x2_08_00_00_0 {
++            cfgs.push("libressl280");
++        }
+     } else {
+         let openssl_version = openssl_version.unwrap();
+ 
+@@ -24,6 +27,9 @@ pub fn get(openssl_version: Option<u64>, libressl_vers
+         }
+         if openssl_version >= 0x1_00_02_00_0 {
+             cfgs.push("ossl102");
++        }
++        if openssl_version >= 0x1_00_02_06_0 {
++            cfgs.push("ossl102f");
+         }
+         if openssl_version >= 0x1_00_02_08_0 {
+             cfgs.push("ossl102h");

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_build_main.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_build_main.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,19 @@
+--- src/vendor/openssl-sys/build/main.rs.orig	2018-09-11 04:49:55 UTC
++++ src/vendor/openssl-sys/build/main.rs
+@@ -497,6 +497,7 @@ See rust-openssl README for more information:
+             (6, 2) => ('6', '2'),
+             (6, _) => ('6', 'x'),
+             (7, _) => ('7', 'x'),
++            (8, _) => ('8', 'x'),
+             _ => version_error(),
+         };
+ 
+@@ -537,7 +538,7 @@ fn version_error() -> ! {
+         "
+ 
+ This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5
+-through 2.7, but a different version of OpenSSL was found. The build is now aborting
++through 2.8, but a different version of OpenSSL was found. The build is now aborting
+ due to this version mismatch.
+ 
+ "

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_aes.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_aes.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,31 @@
+--- src/vendor/openssl-sys/src/aes.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/aes.rs
+@@ -0,0 +1,28 @@
++use libc::*;
++
++pub const AES_ENCRYPT: c_int = 1;
++pub const AES_DECRYPT: c_int = 0;
++
++pub const AES_MAXNR: c_int = 14;
++pub const AES_BLOCK_SIZE: c_int = 16;
++
++#[repr(C)]
++pub struct AES_KEY {
++    // There is some business with AES_LONG which is there to ensure the values here are 32 bits
++    rd_key: [u32; 4 * (AES_MAXNR as usize + 1)],
++    rounds: c_int,
++}
++
++extern "C" {
++    pub fn AES_set_encrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int;
++    pub fn AES_set_decrypt_key(userKey: *const c_uchar, bits: c_int, key: *mut AES_KEY) -> c_int;
++
++    pub fn AES_ige_encrypt(
++        in_: *const c_uchar,
++        out: *mut c_uchar,
++        length: size_t,
++        key: *const AES_KEY,
++        ivec: *mut c_uchar,
++        enc: c_int,
++    );
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_asn1.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_asn1.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,64 @@
+--- src/vendor/openssl-sys/src/asn1.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/asn1.rs
+@@ -0,0 +1,61 @@
++use libc::*;
++
++use *;
++
++pub const V_ASN1_UTCTIME: c_int = 23;
++pub const V_ASN1_GENERALIZEDTIME: c_int = 24;
++
++pub const MBSTRING_FLAG: c_int = 0x1000;
++pub const MBSTRING_UTF8: c_int = MBSTRING_FLAG;
++pub const MBSTRING_ASC: c_int = MBSTRING_FLAG | 1;
++pub const MBSTRING_BMP: c_int = MBSTRING_FLAG | 2;
++pub const MBSTRING_UNIV: c_int = MBSTRING_FLAG | 4;
++
++#[repr(C)]
++pub struct ASN1_ENCODING {
++    pub enc: *mut c_uchar,
++    pub len: c_long,
++    pub modified: c_int,
++}
++
++extern "C" {
++    pub fn ASN1_OBJECT_free(x: *mut ASN1_OBJECT);
++}
++
++stack!(stack_st_ASN1_OBJECT);
++
++extern "C" {
++    pub fn ASN1_STRING_type_new(ty: c_int) -> *mut ASN1_STRING;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn ASN1_STRING_get0_data(x: *const ASN1_STRING) -> *const c_uchar;
++    #[cfg(any(all(ossl101, not(ossl110)), libressl))]
++    pub fn ASN1_STRING_data(x: *mut ASN1_STRING) -> *mut c_uchar;
++
++    pub fn ASN1_BIT_STRING_free(x: *mut ASN1_BIT_STRING);
++
++    pub fn ASN1_STRING_free(x: *mut ASN1_STRING);
++    pub fn ASN1_STRING_length(x: *const ASN1_STRING) -> c_int;
++
++    pub fn ASN1_GENERALIZEDTIME_free(tm: *mut ASN1_GENERALIZEDTIME);
++    pub fn ASN1_GENERALIZEDTIME_print(b: *mut BIO, tm: *const ASN1_GENERALIZEDTIME) -> c_int;
++    pub fn ASN1_TIME_free(tm: *mut ASN1_TIME);
++    pub fn ASN1_TIME_print(b: *mut BIO, tm: *const ASN1_TIME) -> c_int;
++
++    pub fn ASN1_INTEGER_free(x: *mut ASN1_INTEGER);
++    pub fn ASN1_INTEGER_get(dest: *const ASN1_INTEGER) -> c_long;
++    pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int;
++    pub fn BN_to_ASN1_INTEGER(bn: *const BIGNUM, ai: *mut ASN1_INTEGER) -> *mut ASN1_INTEGER;
++    pub fn ASN1_INTEGER_to_BN(ai: *const ASN1_INTEGER, bn: *mut BIGNUM) -> *mut BIGNUM;
++}
++
++cfg_if! {
++    if #[cfg(any(ossl110, libressl280))] {
++        extern "C" {
++            pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: *const ASN1_STRING) -> c_int;
++        }
++    } else {
++        extern "C" {
++            pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: *mut ASN1_STRING) -> c_int;
++        }
++    }
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_bio.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_bio.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,153 @@
+--- src/vendor/openssl-sys/src/bio.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/bio.rs
+@@ -0,0 +1,150 @@
++use libc::*;
++
++use *;
++
++pub const BIO_TYPE_NONE: c_int = 0;
++
++pub const BIO_CTRL_EOF: c_int = 2;
++pub const BIO_CTRL_INFO: c_int = 3;
++pub const BIO_CTRL_FLUSH: c_int = 11;
++pub const BIO_C_SET_BUF_MEM_EOF_RETURN: c_int = 130;
++
++extern "C" {
++    pub fn BIO_set_flags(b: *mut BIO, flags: c_int);
++    pub fn BIO_clear_flags(b: *mut BIO, flags: c_int);
++}
++
++pub unsafe fn BIO_set_retry_read(b: *mut BIO) {
++    BIO_set_flags(b, BIO_FLAGS_READ | BIO_FLAGS_SHOULD_RETRY)
++}
++
++pub unsafe fn BIO_set_retry_write(b: *mut BIO) {
++    BIO_set_flags(b, BIO_FLAGS_WRITE | BIO_FLAGS_SHOULD_RETRY)
++}
++
++pub unsafe fn BIO_clear_retry_flags(b: *mut BIO) {
++    BIO_clear_flags(b, BIO_FLAGS_RWS | BIO_FLAGS_SHOULD_RETRY)
++}
++
++pub const BIO_FLAGS_READ: c_int = 0x01;
++pub const BIO_FLAGS_WRITE: c_int = 0x02;
++pub const BIO_FLAGS_IO_SPECIAL: c_int = 0x04;
++pub const BIO_FLAGS_RWS: c_int = BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL;
++pub const BIO_FLAGS_SHOULD_RETRY: c_int = 0x08;
++
++pub type bio_info_cb =
++    Option<unsafe extern "C" fn(*mut BIO, c_int, *const c_char, c_int, c_long, c_long)>;
++
++cfg_if! {
++    if #[cfg(any(ossl110, libressl280))] {
++        pub enum BIO_METHOD {}
++    } else {
++        #[repr(C)]
++        pub struct BIO_METHOD {
++            pub type_: c_int,
++            pub name: *const c_char,
++            pub bwrite: Option<unsafe extern "C" fn(*mut ::BIO, *const c_char, c_int) -> c_int>,
++            pub bread: Option<unsafe extern "C" fn(*mut ::BIO, *mut c_char, c_int) -> c_int>,
++            pub bputs: Option<unsafe extern "C" fn(*mut ::BIO, *const c_char) -> c_int>,
++            pub bgets: Option<unsafe extern "C" fn(*mut ::BIO, *mut c_char, c_int) -> c_int>,
++            pub ctrl: Option<unsafe extern "C" fn(*mut ::BIO, c_int, c_long, *mut c_void) -> c_long>,
++            pub create: Option<unsafe extern "C" fn(*mut ::BIO) -> c_int>,
++            pub destroy: Option<unsafe extern "C" fn(*mut ::BIO) -> c_int>,
++            pub callback_ctrl: Option<unsafe extern "C" fn(*mut ::BIO, c_int, ::bio_info_cb) -> c_long>,
++        }
++    }
++}
++
++pub unsafe fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long {
++    BIO_ctrl(b, BIO_CTRL_INFO, 0, pp as *mut c_void)
++}
++
++cfg_if! {
++    if #[cfg(any(ossl110, libressl280))] {
++        extern "C" {
++            pub fn BIO_s_file() -> *const BIO_METHOD;
++            pub fn BIO_new(type_: *const BIO_METHOD) -> *mut BIO;
++        }
++    } else {
++        extern "C" {
++            pub fn BIO_s_file() -> *mut BIO_METHOD;
++            pub fn BIO_new(type_: *mut BIO_METHOD) -> *mut BIO;
++        }
++    }
++}
++extern "C" {
++    pub fn BIO_new_fp(stream: *mut FILE, close_flag: c_int) -> *mut BIO;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_set_data(a: *mut ::BIO, data: *mut c_void);
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_get_data(a: *mut ::BIO) -> *mut c_void;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_set_init(a: *mut ::BIO, init: c_int);
++    pub fn BIO_write(b: *mut BIO, buf: *const c_void, len: c_int) -> c_int;
++    pub fn BIO_read(b: *mut BIO, buf: *mut c_void, len: c_int) -> c_int;
++    pub fn BIO_ctrl(b: *mut BIO, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long;
++    pub fn BIO_free_all(b: *mut BIO);
++}
++
++cfg_if! {
++    if #[cfg(any(ossl110, libressl280))] {
++        extern "C" {
++            pub fn BIO_s_mem() -> *const BIO_METHOD;
++        }
++    } else {
++        extern "C" {
++            pub fn BIO_s_mem() -> *mut BIO_METHOD;
++        }
++    }
++}
++cfg_if! {
++    if #[cfg(any(ossl102, libressl280))] {
++        extern "C" {
++            pub fn BIO_new_mem_buf(buf: *const c_void, len: c_int) -> *mut BIO;
++        }
++    } else {
++        extern "C" {
++            pub fn BIO_new_mem_buf(buf: *mut c_void, len: c_int) -> *mut BIO;
++        }
++    }
++}
++
++extern "C" {
++    pub fn BIO_new_socket(sock: c_int, close_flag: c_int) -> *mut BIO;
++
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_meth_new(type_: c_int, name: *const c_char) -> *mut BIO_METHOD;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_meth_free(biom: *mut BIO_METHOD);
++    // FIXME should wrap in Option
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_meth_set_write(
++        biom: *mut BIO_METHOD,
++        write: unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int,
++    ) -> c_int;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_meth_set_read(
++        biom: *mut BIO_METHOD,
++        read: unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int,
++    ) -> c_int;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_meth_set_puts(
++        biom: *mut BIO_METHOD,
++        read: unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int,
++    ) -> c_int;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_meth_set_ctrl(
++        biom: *mut BIO_METHOD,
++        read: unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long,
++    ) -> c_int;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_meth_set_create(
++        biom: *mut BIO_METHOD,
++        create: unsafe extern "C" fn(*mut BIO) -> c_int,
++    ) -> c_int;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn BIO_meth_set_destroy(
++        biom: *mut BIO_METHOD,
++        destroy: unsafe extern "C" fn(*mut BIO) -> c_int,
++    ) -> c_int;
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_bn.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_bn.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,163 @@
+--- src/vendor/openssl-sys/src/bn.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/bn.rs
+@@ -0,0 +1,160 @@
++use libc::*;
++
++use *;
++
++#[cfg(target_pointer_width = "64")]
++pub type BN_ULONG = c_ulonglong;
++#[cfg(target_pointer_width = "32")]
++pub type BN_ULONG = c_uint;
++
++extern "C" {
++    pub fn BN_CTX_new() -> *mut BN_CTX;
++    pub fn BN_CTX_free(ctx: *mut BN_CTX);
++    pub fn BN_rand(r: *mut BIGNUM, bits: c_int, top: c_int, bottom: c_int) -> c_int;
++    pub fn BN_pseudo_rand(r: *mut BIGNUM, bits: c_int, top: c_int, bottom: c_int) -> c_int;
++    pub fn BN_rand_range(r: *mut BIGNUM, range: *const BIGNUM) -> c_int;
++    pub fn BN_pseudo_rand_range(r: *mut BIGNUM, range: *const BIGNUM) -> c_int;
++    pub fn BN_new() -> *mut BIGNUM;
++    pub fn BN_num_bits(bn: *const BIGNUM) -> c_int;
++    pub fn BN_clear_free(bn: *mut BIGNUM);
++    pub fn BN_bin2bn(s: *const u8, size: c_int, ret: *mut BIGNUM) -> *mut BIGNUM;
++    pub fn BN_bn2bin(a: *const BIGNUM, to: *mut u8) -> c_int;
++    pub fn BN_sub(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
++    pub fn BN_add(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
++    pub fn BN_mul(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
++    pub fn BN_sqr(r: *mut BIGNUM, a: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
++    pub fn BN_set_negative(bn: *mut BIGNUM, n: c_int);
++    #[cfg(ossl110)]
++    pub fn BN_is_negative(b: *const ::BIGNUM) -> c_int;
++
++    pub fn BN_div(
++        dv: *mut BIGNUM,
++        rem: *mut BIGNUM,
++        a: *const BIGNUM,
++        b: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++    pub fn BN_nnmod(
++        rem: *mut BIGNUM,
++        a: *const BIGNUM,
++        m: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++    pub fn BN_mod_add(
++        r: *mut BIGNUM,
++        a: *const BIGNUM,
++        b: *const BIGNUM,
++        m: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++    pub fn BN_mod_sub(
++        r: *mut BIGNUM,
++        a: *const BIGNUM,
++        b: *const BIGNUM,
++        m: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++    pub fn BN_mod_mul(
++        r: *mut BIGNUM,
++        a: *const BIGNUM,
++        b: *const BIGNUM,
++        m: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++    pub fn BN_mod_sqr(
++        r: *mut BIGNUM,
++        a: *const BIGNUM,
++        m: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn BN_mod_word(r: *const BIGNUM, w: BN_ULONG) -> BN_ULONG;
++    pub fn BN_div_word(r: *mut BIGNUM, w: BN_ULONG) -> BN_ULONG;
++    pub fn BN_mul_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
++    pub fn BN_add_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
++    pub fn BN_sub_word(r: *mut BIGNUM, w: BN_ULONG) -> c_int;
++    pub fn BN_set_word(bn: *mut BIGNUM, n: BN_ULONG) -> c_int;
++
++    pub fn BN_cmp(a: *const BIGNUM, b: *const BIGNUM) -> c_int;
++    pub fn BN_free(bn: *mut BIGNUM);
++    pub fn BN_is_bit_set(a: *const BIGNUM, n: c_int) -> c_int;
++    pub fn BN_lshift(r: *mut BIGNUM, a: *const BIGNUM, n: c_int) -> c_int;
++    pub fn BN_lshift1(r: *mut BIGNUM, a: *const BIGNUM) -> c_int;
++    pub fn BN_exp(r: *mut BIGNUM, a: *const BIGNUM, p: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
++
++    pub fn BN_mod_exp(
++        r: *mut BIGNUM,
++        a: *const BIGNUM,
++        p: *const BIGNUM,
++        m: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn BN_mask_bits(a: *mut BIGNUM, n: c_int) -> c_int;
++    pub fn BN_rshift(r: *mut BIGNUM, a: *const BIGNUM, n: c_int) -> c_int;
++    pub fn BN_rshift1(r: *mut BIGNUM, a: *const BIGNUM) -> c_int;
++    pub fn BN_bn2hex(a: *const BIGNUM) -> *mut c_char;
++    pub fn BN_bn2dec(a: *const BIGNUM) -> *mut c_char;
++    pub fn BN_hex2bn(a: *mut *mut BIGNUM, s: *const c_char) -> c_int;
++    pub fn BN_dec2bn(a: *mut *mut BIGNUM, s: *const c_char) -> c_int;
++    pub fn BN_gcd(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
++    pub fn BN_mod_inverse(
++        r: *mut BIGNUM,
++        a: *const BIGNUM,
++        n: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> *mut BIGNUM;
++    pub fn BN_clear(bn: *mut BIGNUM);
++    pub fn BN_dup(n: *const BIGNUM) -> *mut BIGNUM;
++    pub fn BN_ucmp(a: *const BIGNUM, b: *const BIGNUM) -> c_int;
++    pub fn BN_set_bit(a: *mut BIGNUM, n: c_int) -> c_int;
++    pub fn BN_clear_bit(a: *mut BIGNUM, n: c_int) -> c_int;
++
++    pub fn BN_generate_prime_ex(
++        r: *mut BIGNUM,
++        bits: c_int,
++        safe: c_int,
++        add: *const BIGNUM,
++        rem: *const BIGNUM,
++        cb: *mut BN_GENCB,
++    ) -> c_int;
++    pub fn BN_is_prime_ex(
++        p: *const BIGNUM,
++        checks: c_int,
++        ctx: *mut BN_CTX,
++        cb: *mut BN_GENCB,
++    ) -> c_int;
++    pub fn BN_is_prime_fasttest_ex(
++        p: *const BIGNUM,
++        checks: c_int,
++        ctx: *mut BN_CTX,
++        do_trial_division: c_int,
++        cb: *mut BN_GENCB,
++    ) -> c_int;
++}
++
++cfg_if! {
++    if #[cfg(ossl110)] {
++        extern "C" {
++            pub fn BN_get_rfc2409_prime_768(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn BN_get_rfc2409_prime_1024(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn BN_get_rfc3526_prime_1536(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn BN_get_rfc3526_prime_2048(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn BN_get_rfc3526_prime_3072(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn BN_get_rfc3526_prime_4096(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn BN_get_rfc3526_prime_6144(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn BN_get_rfc3526_prime_8192(bn: *mut BIGNUM) -> *mut BIGNUM;
++        }
++    } else {
++        extern "C" {
++            pub fn get_rfc2409_prime_768(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn get_rfc2409_prime_1024(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn get_rfc3526_prime_1536(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn get_rfc3526_prime_2048(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn get_rfc3526_prime_3072(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn get_rfc3526_prime_4096(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn get_rfc3526_prime_6144(bn: *mut BIGNUM) -> *mut BIGNUM;
++            pub fn get_rfc3526_prime_8192(bn: *mut BIGNUM) -> *mut BIGNUM;
++        }
++    }
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_cms.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_cms.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,82 @@
+--- src/vendor/openssl-sys/src/cms.rs.orig	2018-09-16 23:52:55 UTC
++++ src/vendor/openssl-sys/src/cms.rs
+@@ -0,0 +1,79 @@
++use libc::*;
++
++pub enum CMS_ContentInfo {}
++
++extern "C" {
++    #[cfg(ossl101)]
++    pub fn CMS_ContentInfo_free(cms: *mut ::CMS_ContentInfo);
++    #[cfg(ossl101)]
++    pub fn i2d_CMS_ContentInfo(a: *mut ::CMS_ContentInfo, pp: *mut *mut c_uchar) -> c_int;
++}
++
++#[cfg(ossl101)]
++pub const CMS_TEXT: c_uint = 0x1;
++#[cfg(ossl101)]
++pub const CMS_NOCERTS: c_uint = 0x2;
++#[cfg(ossl101)]
++pub const CMS_NO_CONTENT_VERIFY: c_uint = 0x4;
++#[cfg(ossl101)]
++pub const CMS_NO_ATTR_VERIFY: c_uint = 0x8;
++#[cfg(ossl101)]
++pub const CMS_NOSIGS: c_uint = 0x4 | 0x8;
++#[cfg(ossl101)]
++pub const CMS_NOINTERN: c_uint = 0x10;
++#[cfg(ossl101)]
++pub const CMS_NO_SIGNER_CERT_VERIFY: c_uint = 0x20;
++#[cfg(ossl101)]
++pub const CMS_NOVERIFY: c_uint = 0x20;
++#[cfg(ossl101)]
++pub const CMS_DETACHED: c_uint = 0x40;
++#[cfg(ossl101)]
++pub const CMS_BINARY: c_uint = 0x80;
++#[cfg(ossl101)]
++pub const CMS_NOATTR: c_uint = 0x100;
++#[cfg(ossl101)]
++pub const CMS_NOSMIMECAP: c_uint = 0x200;
++#[cfg(ossl101)]
++pub const CMS_NOOLDMIMETYPE: c_uint = 0x400;
++#[cfg(ossl101)]
++pub const CMS_CRLFEOL: c_uint = 0x800;
++#[cfg(ossl101)]
++pub const CMS_STREAM: c_uint = 0x1000;
++#[cfg(ossl101)]
++pub const CMS_NOCRL: c_uint = 0x2000;
++#[cfg(ossl101)]
++pub const CMS_PARTIAL: c_uint = 0x4000;
++#[cfg(ossl101)]
++pub const CMS_REUSE_DIGEST: c_uint = 0x8000;
++#[cfg(ossl101)]
++pub const CMS_USE_KEYID: c_uint = 0x10000;
++#[cfg(ossl101)]
++pub const CMS_DEBUG_DECRYPT: c_uint = 0x20000;
++#[cfg(ossl102)]
++pub const CMS_KEY_PARAM: c_uint = 0x40000;
++#[cfg(ossl110)]
++pub const CMS_ASCIICRLF: c_uint = 0x80000;
++
++extern "C" {
++    #[cfg(ossl101)]
++    pub fn SMIME_read_CMS(bio: *mut ::BIO, bcont: *mut *mut ::BIO) -> *mut ::CMS_ContentInfo;
++
++    #[cfg(ossl101)]
++    pub fn CMS_sign(
++        signcert: *mut ::X509,
++        pkey: *mut ::EVP_PKEY,
++        certs: *mut ::stack_st_X509,
++        data: *mut ::BIO,
++        flags: c_uint,
++    ) -> *mut ::CMS_ContentInfo;
++
++    #[cfg(ossl101)]
++    pub fn CMS_decrypt(
++        cms: *mut ::CMS_ContentInfo,
++        pkey: *mut ::EVP_PKEY,
++        cert: *mut ::X509,
++        dcont: *mut ::BIO,
++        out: *mut ::BIO,
++        flags: c_uint,
++    ) -> c_int;
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_conf.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_conf.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,10 @@
+--- src/vendor/openssl-sys/src/conf.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/conf.rs
+@@ -0,0 +1,7 @@
++use *;
++
++extern "C" {
++    pub fn NCONF_new(meth: *mut CONF_METHOD) -> *mut CONF;
++    pub fn NCONF_default() -> *mut CONF_METHOD;
++    pub fn NCONF_free(conf: *mut CONF);
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_crypto.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_crypto.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,125 @@
+--- src/vendor/openssl-sys/src/crypto.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/crypto.rs
+@@ -0,0 +1,122 @@
++use libc::*;
++
++use *;
++
++#[cfg(not(ossl110))]
++pub const CRYPTO_LOCK_X509: c_int = 3;
++#[cfg(not(ossl110))]
++pub const CRYPTO_LOCK_SSL_CTX: c_int = 12;
++#[cfg(not(ossl110))]
++pub const CRYPTO_LOCK_SSL_SESSION: c_int = 14;
++
++stack!(stack_st_void);
++
++cfg_if! {
++    if #[cfg(ossl110)] {
++        pub const CRYPTO_EX_INDEX_SSL: c_int = 0;
++        pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 1;
++
++        extern "C" {
++            pub fn OpenSSL_version_num() -> c_ulong;
++            pub fn OpenSSL_version(key: c_int) -> *const c_char;
++        }
++        pub const OPENSSL_VERSION: c_int = 0;
++        pub const OPENSSL_CFLAGS: c_int = 1;
++        pub const OPENSSL_BUILT_ON: c_int = 2;
++        pub const OPENSSL_PLATFORM: c_int = 3;
++        pub const OPENSSL_DIR: c_int = 4;
++    } else {
++        extern "C" {
++            pub fn SSLeay() -> c_ulong;
++            pub fn SSLeay_version(key: c_int) -> *const c_char;
++        }
++        pub const SSLEAY_VERSION: c_int = 0;
++        pub const SSLEAY_CFLAGS: c_int = 2;
++        pub const SSLEAY_BUILT_ON: c_int = 3;
++        pub const SSLEAY_PLATFORM: c_int = 4;
++        pub const SSLEAY_DIR: c_int = 5;
++    }
++}
++
++// FIXME should be options
++pub type CRYPTO_EX_new = unsafe extern "C" fn(
++    parent: *mut c_void,
++    ptr: *mut c_void,
++    ad: *const CRYPTO_EX_DATA,
++    idx: c_int,
++    argl: c_long,
++    argp: *const c_void,
++) -> c_int;
++pub type CRYPTO_EX_dup = unsafe extern "C" fn(
++    to: *mut CRYPTO_EX_DATA,
++    from: *mut CRYPTO_EX_DATA,
++    from_d: *mut c_void,
++    idx: c_int,
++    argl: c_long,
++    argp: *mut c_void,
++) -> c_int;
++pub type CRYPTO_EX_free = unsafe extern "C" fn(
++    parent: *mut c_void,
++    ptr: *mut c_void,
++    ad: *mut CRYPTO_EX_DATA,
++    idx: c_int,
++    argl: c_long,
++    argp: *mut c_void,
++);
++extern "C" {
++    #[cfg(ossl110)]
++    pub fn CRYPTO_get_ex_new_index(
++        class_index: c_int,
++        argl: c_long,
++        argp: *mut c_void,
++        new_func: Option<CRYPTO_EX_new>,
++        dup_func: Option<CRYPTO_EX_dup>,
++        free_func: Option<CRYPTO_EX_free>,
++    ) -> c_int;
++}
++
++pub const CRYPTO_LOCK: c_int = 1;
++
++extern "C" {
++    #[cfg(not(ossl110))]
++    pub fn CRYPTO_num_locks() -> c_int;
++    #[cfg(not(ossl110))]
++    pub fn CRYPTO_set_locking_callback(
++        func: unsafe extern "C" fn(mode: c_int, n: c_int, file: *const c_char, line: c_int),
++    );
++
++    #[cfg(not(ossl110))]
++    pub fn CRYPTO_set_id_callback(func: unsafe extern "C" fn() -> c_ulong);
++
++    #[cfg(not(ossl110))]
++    pub fn CRYPTO_add_lock(
++        pointer: *mut c_int,
++        amount: c_int,
++        type_: c_int,
++        file: *const c_char,
++        line: c_int,
++    ) -> c_int;
++}
++
++cfg_if! {
++    if #[cfg(ossl110)] {
++        extern "C" {
++            pub fn CRYPTO_malloc(num: size_t, file: *const c_char, line: c_int) -> *mut c_void;
++            pub fn CRYPTO_free(buf: *mut c_void, file: *const c_char, line: c_int);
++        }
++    } else {
++        extern "C" {
++            pub fn CRYPTO_malloc(num: c_int, file: *const c_char, line: c_int) -> *mut c_void;
++            pub fn CRYPTO_free(buf: *mut c_void);
++        }
++    }
++}
++
++extern "C" {
++    #[cfg(ossl101)]
++    pub fn FIPS_mode() -> c_int;
++    #[cfg(ossl101)]
++    pub fn FIPS_mode_set(onoff: c_int) -> c_int;
++
++    pub fn CRYPTO_memcmp(a: *const c_void, b: *const c_void, len: size_t) -> c_int;
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_dh.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_dh.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,27 @@
+--- src/vendor/openssl-sys/src/dh.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/dh.rs
+@@ -0,0 +1,24 @@
++use *;
++
++extern "C" {
++    pub fn DH_new() -> *mut DH;
++    pub fn DH_free(dh: *mut DH);
++
++    pub fn d2i_DHparams(k: *mut *mut DH, pp: *mut *const c_uchar, length: c_long) -> *mut DH;
++    pub fn i2d_DHparams(dh: *const DH, pp: *mut *mut c_uchar) -> c_int;
++
++    #[cfg(ossl102)]
++    pub fn DH_get_1024_160() -> *mut DH;
++    #[cfg(ossl102)]
++    pub fn DH_get_2048_224() -> *mut DH;
++    #[cfg(ossl102)]
++    pub fn DH_get_2048_256() -> *mut DH;
++
++    #[cfg(any(ossl110, libressl273))]
++    pub fn DH_set0_pqg(
++        dh: *mut DH,
++        p: *mut BIGNUM,
++        q: *mut BIGNUM,
++        g: *mut BIGNUM,
++    ) -> c_int;
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_dsa.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_dsa.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,69 @@
+--- src/vendor/openssl-sys/src/dsa.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/dsa.rs
+@@ -0,0 +1,66 @@
++use libc::*;
++
++use *;
++
++extern "C" {
++    pub fn DSA_new() -> *mut DSA;
++    pub fn DSA_free(dsa: *mut DSA);
++    pub fn DSA_size(dsa: *const DSA) -> c_int;
++    pub fn DSA_sign(
++        dummy: c_int,
++        dgst: *const c_uchar,
++        len: c_int,
++        sigret: *mut c_uchar,
++        siglen: *mut c_uint,
++        dsa: *mut DSA,
++    ) -> c_int;
++    pub fn DSA_verify(
++        dummy: c_int,
++        dgst: *const c_uchar,
++        len: c_int,
++        sigbuf: *const c_uchar,
++        siglen: c_int,
++        dsa: *mut DSA,
++    ) -> c_int;
++
++    pub fn d2i_DSAPublicKey(a: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long) -> *mut DSA;
++    pub fn d2i_DSAPrivateKey(a: *mut *mut DSA, pp: *mut *const c_uchar, length: c_long)
++        -> *mut DSA;
++
++    pub fn DSA_generate_parameters_ex(
++        dsa: *mut DSA,
++        bits: c_int,
++        seed: *const c_uchar,
++        seed_len: c_int,
++        counter_ref: *mut c_int,
++        h_ret: *mut c_ulong,
++        cb: *mut BN_GENCB,
++    ) -> c_int;
++
++    pub fn DSA_generate_key(dsa: *mut DSA) -> c_int;
++    pub fn i2d_DSAPublicKey(a: *const DSA, pp: *mut *mut c_uchar) -> c_int;
++    pub fn i2d_DSAPrivateKey(a: *const DSA, pp: *mut *mut c_uchar) -> c_int;
++
++    #[cfg(any(ossl110, libressl273))]
++    pub fn DSA_get0_pqg(
++        d: *const DSA,
++        p: *mut *const BIGNUM,
++        q: *mut *const BIGNUM,
++        q: *mut *const BIGNUM,
++    );
++    #[cfg(any(ossl110, libressl273))]
++    pub fn DSA_set0_pqg(
++        d: *mut DSA,
++        p: *mut BIGNUM,
++        q: *mut BIGNUM,
++        q: *mut BIGNUM,
++    ) -> c_int;
++    #[cfg(any(ossl110, libressl273))]
++    pub fn DSA_get0_key(
++        d: *const DSA,
++        pub_key: *mut *const BIGNUM,
++        priv_key: *mut *const BIGNUM,
++    );
++    #[cfg(any(ossl110, libressl273))]
++    pub fn DSA_set0_key(d: *mut DSA, pub_key: *mut BIGNUM, priv_key: *mut BIGNUM) -> c_int;
++}

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_dtls1.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_dtls1.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,6 @@
+--- src/vendor/openssl-sys/src/dtls1.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/dtls1.rs
+@@ -0,0 +1,3 @@
++use libc::*;
++
++pub const DTLS1_COOKIE_LENGTH: c_uint = 256;

Added: head/lang/rust/files/patch-src_vendor_openssl-sys_src_ec.rs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/rust/files/patch-src_vendor_openssl-sys_src_ec.rs	Sun Sep 30 22:28:27 2018	(r480986)
@@ -0,0 +1,206 @@
+--- src/vendor/openssl-sys/src/ec.rs.orig	2018-09-16 20:29:19 UTC
++++ src/vendor/openssl-sys/src/ec.rs
+@@ -0,0 +1,203 @@
++use libc::*;
++
++use *;
++
++#[repr(C)]
++#[derive(Copy, Clone)]
++pub enum point_conversion_form_t {
++    POINT_CONVERSION_COMPRESSED = 2,
++    POINT_CONVERSION_UNCOMPRESSED = 4,
++    POINT_CONVERSION_HYBRID = 6,
++}
++
++pub enum EC_METHOD {}
++pub enum EC_GROUP {}
++pub enum EC_POINT {}
++
++pub const OPENSSL_EC_NAMED_CURVE: c_int = 1;
++
++extern "C" {
++    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
++    pub fn EC_GF2m_simple_method() -> *const EC_METHOD;
++
++    pub fn EC_GROUP_new(meth: *const EC_METHOD) -> *mut EC_GROUP;
++
++    pub fn EC_GROUP_free(group: *mut EC_GROUP);
++
++    pub fn EC_GROUP_get_order(
++        group: *const EC_GROUP,
++        order: *mut BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn EC_GROUP_set_asn1_flag(key: *mut EC_GROUP, flag: c_int);
++
++    pub fn EC_GROUP_get_curve_GFp(
++        group: *const EC_GROUP,
++        p: *mut BIGNUM,
++        a: *mut BIGNUM,
++        b: *mut BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
++    pub fn EC_GROUP_get_curve_GF2m(
++        group: *const EC_GROUP,
++        p: *mut BIGNUM,
++        a: *mut BIGNUM,
++        b: *mut BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn EC_GROUP_get_degree(group: *const EC_GROUP) -> c_int;
++
++    pub fn EC_GROUP_new_curve_GFp(
++        p: *const BIGNUM,
++        a: *const BIGNUM,
++        b: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> *mut EC_GROUP;
++
++    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
++    pub fn EC_GROUP_new_curve_GF2m(
++        p: *const BIGNUM,
++        a: *const BIGNUM,
++        b: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> *mut EC_GROUP;
++
++    pub fn EC_GROUP_new_by_curve_name(nid: c_int) -> *mut EC_GROUP;
++
++    pub fn EC_POINT_new(group: *const EC_GROUP) -> *mut EC_POINT;
++
++    pub fn EC_POINT_free(point: *mut EC_POINT);
++
++    pub fn EC_POINT_get_affine_coordinates_GFp(
++        group: *const EC_GROUP,
++        p: *const EC_POINT,
++        x: *mut BIGNUM,
++        y: *mut BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    #[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
++    pub fn EC_POINT_get_affine_coordinates_GF2m(
++        group: *const EC_GROUP,
++        p: *const EC_POINT,
++        x: *mut BIGNUM,
++        y: *mut BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn EC_POINT_point2oct(
++        group: *const EC_GROUP,
++        p: *const EC_POINT,
++        form: point_conversion_form_t,
++        buf: *mut c_uchar,
++        len: size_t,
++        ctx: *mut BN_CTX,
++    ) -> size_t;
++
++    pub fn EC_POINT_oct2point(
++        group: *const EC_GROUP,
++        p: *mut EC_POINT,
++        buf: *const c_uchar,
++        len: size_t,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn EC_POINT_add(
++        group: *const EC_GROUP,
++        r: *mut EC_POINT,
++        a: *const EC_POINT,
++        b: *const EC_POINT,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn EC_POINT_invert(group: *const EC_GROUP, r: *mut EC_POINT, ctx: *mut BN_CTX) -> c_int;
++
++    pub fn EC_POINT_cmp(
++        group: *const EC_GROUP,
++        a: *const EC_POINT,
++        b: *const EC_POINT,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn EC_POINT_mul(
++        group: *const EC_GROUP,
++        r: *mut EC_POINT,
++        n: *const BIGNUM,
++        q: *const EC_POINT,
++        m: *const BIGNUM,
++        ctx: *mut BN_CTX,
++    ) -> c_int;
++
++    pub fn EC_KEY_new() -> *mut EC_KEY;
++
++    pub fn EC_KEY_new_by_curve_name(nid: c_int) -> *mut EC_KEY;
++
++    pub fn EC_KEY_free(key: *mut EC_KEY);
++
++    pub fn EC_KEY_dup(key: *const EC_KEY) -> *mut EC_KEY;
++
++    pub fn EC_KEY_up_ref(key: *mut EC_KEY) -> c_int;
++
++    pub fn EC_KEY_get0_group(key: *const EC_KEY) -> *const EC_GROUP;
++
++    pub fn EC_KEY_set_group(key: *mut EC_KEY, group: *const EC_GROUP) -> c_int;
++
++    pub fn EC_KEY_get0_private_key(key: *const EC_KEY) -> *const BIGNUM;
++
++    pub fn EC_KEY_set_private_key(key: *mut EC_KEY, key: *const BIGNUM) -> c_int;
++
++    pub fn EC_KEY_get0_public_key(key: *const EC_KEY) -> *const EC_POINT;
++
++    pub fn EC_KEY_set_public_key(key: *mut EC_KEY, key: *const EC_POINT) -> c_int;
++
++    pub fn EC_KEY_generate_key(key: *mut EC_KEY) -> c_int;
++
++    pub fn EC_KEY_check_key(key: *const EC_KEY) -> c_int;
++
++    pub fn EC_KEY_set_public_key_affine_coordinates(
++        key: *mut EC_KEY,
++        x: *mut BIGNUM,
++        y: *mut BIGNUM,
++    ) -> c_int;
++}

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809302228.w8UMSRYx031500>