Skip to content

Commit 3acc5bb

Browse files
authored
Merge pull request sfackler#1807 from alex/edition-2018-sys
Migrate the openssl-sys crate to the 2018 edition
2 parents 11797d9 + dc976d7 commit 3acc5bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+250
-255
lines changed

openssl-macros/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::uninlined_format_args)]
2+
13
use proc_macro::TokenStream;
24
use proc_macro2::Ident;
35
use quote::quote;

openssl-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ readme = "README.md"
1212
categories = ["cryptography", "external-ffi-bindings"]
1313
links = "openssl"
1414
build = "build/main.rs"
15+
edition = "2018"
1516

1617
[features]
1718
vendored = ['openssl-src']

openssl-sys/build/find_normal.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use pkg_config;
21
use std::ffi::OsString;
32
use std::path::{Path, PathBuf};
43
use std::process::{self, Command};

openssl-sys/build/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
#![allow(clippy::inconsistent_digit_grouping, clippy::unusual_byte_groupings)]
1+
#![allow(
2+
clippy::inconsistent_digit_grouping,
3+
clippy::uninlined_format_args,
4+
clippy::unusual_byte_groupings
5+
)]
26

37
extern crate autocfg;
48
#[cfg(feature = "bindgen")]

openssl-sys/src/asn1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use libc::*;
22

3-
use *;
3+
use super::*;
44

55
// ASN.1 tag values
66
pub const V_ASN1_EOC: c_int = 0;

openssl-sys/src/bio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use libc::*;
22

3-
use *;
3+
use super::*;
44

55
pub const BIO_TYPE_NONE: c_int = 0;
66

openssl-sys/src/bn.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use libc::*;
22

3-
use *;
4-
53
#[cfg(target_pointer_width = "64")]
64
pub type BN_ULONG = c_ulonglong;
75
#[cfg(target_pointer_width = "32")]

openssl-sys/src/cms.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use libc::*;
2-
use *;
32

43
#[cfg(ossl101)]
54
pub const CMS_TEXT: c_uint = 0x1;

openssl-sys/src/crypto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::*;
12
use libc::*;
2-
use *;
33

44
extern "C" {
55
#[deprecated(note = "use CRYPTO_set_locking_callback__fixed_rust instead")]

openssl-sys/src/ec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use libc::*;
22
use std::ptr;
33

4-
use *;
4+
use super::*;
55

66
pub const OPENSSL_EC_NAMED_CURVE: c_int = 1;
77

openssl-sys/src/evp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::*;
12
use libc::*;
2-
use *;
33

44
pub const EVP_MAX_MD_SIZE: c_uint = 64;
55

openssl-sys/src/handwritten/aes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
#[repr(C)]
55
pub struct AES_KEY {

openssl-sys/src/handwritten/asn1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
#[repr(C)]
55
pub struct ASN1_ENCODING {

openssl-sys/src/handwritten/bio.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
extern "C" {
55
pub fn BIO_set_flags(b: *mut BIO, flags: c_int);
@@ -17,14 +17,14 @@ cfg_if! {
1717
pub struct BIO_METHOD {
1818
pub type_: c_int,
1919
pub name: *const c_char,
20-
pub bwrite: Option<unsafe extern "C" fn(*mut ::BIO, *const c_char, c_int) -> c_int>,
21-
pub bread: Option<unsafe extern "C" fn(*mut ::BIO, *mut c_char, c_int) -> c_int>,
22-
pub bputs: Option<unsafe extern "C" fn(*mut ::BIO, *const c_char) -> c_int>,
23-
pub bgets: Option<unsafe extern "C" fn(*mut ::BIO, *mut c_char, c_int) -> c_int>,
24-
pub ctrl: Option<unsafe extern "C" fn(*mut ::BIO, c_int, c_long, *mut c_void) -> c_long>,
25-
pub create: Option<unsafe extern "C" fn(*mut ::BIO) -> c_int>,
26-
pub destroy: Option<unsafe extern "C" fn(*mut ::BIO) -> c_int>,
27-
pub callback_ctrl: Option<unsafe extern "C" fn(*mut ::BIO, c_int, ::bio_info_cb) -> c_long>,
20+
pub bwrite: Option<unsafe extern "C" fn(*mut BIO, *const c_char, c_int) -> c_int>,
21+
pub bread: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>,
22+
pub bputs: Option<unsafe extern "C" fn(*mut BIO, *const c_char) -> c_int>,
23+
pub bgets: Option<unsafe extern "C" fn(*mut BIO, *mut c_char, c_int) -> c_int>,
24+
pub ctrl: Option<unsafe extern "C" fn(*mut BIO, c_int, c_long, *mut c_void) -> c_long>,
25+
pub create: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
26+
pub destroy: Option<unsafe extern "C" fn(*mut BIO) -> c_int>,
27+
pub callback_ctrl: Option<unsafe extern "C" fn(*mut BIO, c_int, bio_info_cb) -> c_long>,
2828
}
2929
}
3030
}
@@ -39,11 +39,11 @@ extern "C" {
3939
#[cfg(not(osslconf = "OPENSSL_NO_STDIO"))]
4040
pub fn BIO_new_fp(stream: *mut FILE, close_flag: c_int) -> *mut BIO;
4141
#[cfg(any(ossl110, libressl273))]
42-
pub fn BIO_set_data(a: *mut ::BIO, data: *mut c_void);
42+
pub fn BIO_set_data(a: *mut BIO, data: *mut c_void);
4343
#[cfg(any(ossl110, libressl273))]
44-
pub fn BIO_get_data(a: *mut ::BIO) -> *mut c_void;
44+
pub fn BIO_get_data(a: *mut BIO) -> *mut c_void;
4545
#[cfg(any(ossl110, libressl273))]
46-
pub fn BIO_set_init(a: *mut ::BIO, init: c_int);
46+
pub fn BIO_set_init(a: *mut BIO, init: c_int);
4747
pub fn BIO_write(b: *mut BIO, buf: *const c_void, len: c_int) -> c_int;
4848
pub fn BIO_read(b: *mut BIO, buf: *mut c_void, len: c_int) -> c_int;
4949
pub fn BIO_ctrl(b: *mut BIO, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long;

openssl-sys/src/handwritten/bn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
extern "C" {
55
pub fn BN_CTX_new() -> *mut BN_CTX;
@@ -31,7 +31,7 @@ extern "C" {
3131
pub fn BN_sqr(r: *mut BIGNUM, a: *const BIGNUM, ctx: *mut BN_CTX) -> c_int;
3232
pub fn BN_set_negative(bn: *mut BIGNUM, n: c_int);
3333
#[cfg(any(ossl110, libressl350))]
34-
pub fn BN_is_negative(b: *const ::BIGNUM) -> c_int;
34+
pub fn BN_is_negative(b: *const BIGNUM) -> c_int;
3535

3636
pub fn BN_div(
3737
dv: *mut BIGNUM,

openssl-sys/src/handwritten/cms.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
pub enum CMS_ContentInfo {}
55

66
extern "C" {
77
#[cfg(ossl101)]
8-
pub fn CMS_ContentInfo_free(cms: *mut ::CMS_ContentInfo);
8+
pub fn CMS_ContentInfo_free(cms: *mut CMS_ContentInfo);
99
}
1010

1111
const_ptr_api! {
@@ -18,38 +18,38 @@ const_ptr_api! {
1818
extern "C" {
1919
#[cfg(ossl101)]
2020
pub fn d2i_CMS_ContentInfo(
21-
a: *mut *mut ::CMS_ContentInfo,
21+
a: *mut *mut CMS_ContentInfo,
2222
pp: *mut *const c_uchar,
2323
length: c_long,
24-
) -> *mut ::CMS_ContentInfo;
24+
) -> *mut CMS_ContentInfo;
2525

2626
#[cfg(ossl101)]
27-
pub fn SMIME_read_CMS(bio: *mut ::BIO, bcont: *mut *mut ::BIO) -> *mut ::CMS_ContentInfo;
27+
pub fn SMIME_read_CMS(bio: *mut BIO, bcont: *mut *mut BIO) -> *mut CMS_ContentInfo;
2828

2929
#[cfg(ossl101)]
3030
pub fn CMS_sign(
31-
signcert: *mut ::X509,
32-
pkey: *mut ::EVP_PKEY,
33-
certs: *mut ::stack_st_X509,
34-
data: *mut ::BIO,
31+
signcert: *mut X509,
32+
pkey: *mut EVP_PKEY,
33+
certs: *mut stack_st_X509,
34+
data: *mut BIO,
3535
flags: c_uint,
36-
) -> *mut ::CMS_ContentInfo;
36+
) -> *mut CMS_ContentInfo;
3737

3838
#[cfg(ossl101)]
3939
pub fn CMS_encrypt(
4040
certs: *mut stack_st_X509,
41-
data: *mut ::BIO,
41+
data: *mut BIO,
4242
cipher: *const EVP_CIPHER,
4343
flags: c_uint,
44-
) -> *mut ::CMS_ContentInfo;
44+
) -> *mut CMS_ContentInfo;
4545

4646
#[cfg(ossl101)]
4747
pub fn CMS_decrypt(
48-
cms: *mut ::CMS_ContentInfo,
49-
pkey: *mut ::EVP_PKEY,
50-
cert: *mut ::X509,
51-
dcont: *mut ::BIO,
52-
out: *mut ::BIO,
48+
cms: *mut CMS_ContentInfo,
49+
pkey: *mut EVP_PKEY,
50+
cert: *mut X509,
51+
dcont: *mut BIO,
52+
out: *mut BIO,
5353
flags: c_uint,
5454
) -> c_int;
5555
}

openssl-sys/src/handwritten/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use *;
1+
use super::super::*;
22

33
extern "C" {
44
pub fn NCONF_new(meth: *mut CONF_METHOD) -> *mut CONF;

openssl-sys/src/handwritten/crypto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
stack!(stack_st_void);
55

openssl-sys/src/handwritten/dh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use *;
1+
use super::super::*;
22

33
extern "C" {
44
pub fn DH_new() -> *mut DH;

openssl-sys/src/handwritten/dsa.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use libc::*;
22

3-
use *;
3+
use super::super::*;
44

55
cfg_if! {
66
if #[cfg(any(ossl110, libressl280))] {

openssl-sys/src/handwritten/ec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
#[repr(C)]
55
#[derive(Copy, Clone)]

openssl-sys/src/handwritten/err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
#[repr(C)]
55
pub struct ERR_STRING_DATA {

openssl-sys/src/handwritten/evp.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
cfg_if! {
55
if #[cfg(ossl300)] {
@@ -344,9 +344,9 @@ extern "C" {
344344
#[cfg(ossl110)]
345345
pub fn EVP_aes_256_ocb() -> *const EVP_CIPHER;
346346
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
347-
pub fn EVP_chacha20() -> *const ::EVP_CIPHER;
347+
pub fn EVP_chacha20() -> *const EVP_CIPHER;
348348
#[cfg(all(ossl110, not(osslconf = "OPENSSL_NO_CHACHA")))]
349-
pub fn EVP_chacha20_poly1305() -> *const ::EVP_CIPHER;
349+
pub fn EVP_chacha20_poly1305() -> *const EVP_CIPHER;
350350
#[cfg(not(osslconf = "OPENSSL_NO_SEED"))]
351351
pub fn EVP_seed_cbc() -> *const EVP_CIPHER;
352352
#[cfg(not(osslconf = "OPENSSL_NO_SEED"))]

openssl-sys/src/handwritten/hmac.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use libc::*;
22

3-
use *;
3+
use super::super::*;
44

55
cfg_if! {
66
if #[cfg(any(ossl110, libressl350))] {

openssl-sys/src/handwritten/kdf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
cfg_if! {
55
if #[cfg(ossl300)] {

openssl-sys/src/handwritten/object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use libc::*;
22

3-
use *;
3+
use super::super::*;
44

55
extern "C" {
66
pub fn OBJ_nid2ln(nid: c_int) -> *const c_char;

openssl-sys/src/handwritten/ocsp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
pub enum OCSP_CERTID {}
55

openssl-sys/src/handwritten/pem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
pub type pem_password_cb = Option<
55
unsafe extern "C" fn(

openssl-sys/src/handwritten/pkcs12.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use libc::*;
22

3-
use *;
3+
use super::super::*;
44

55
pub enum PKCS12 {}
66

openssl-sys/src/handwritten/pkcs7.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
pub enum PKCS7_SIGNED {}
55
pub enum PKCS7_ENVELOPE {}

openssl-sys/src/handwritten/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use super::super::*;
12
use libc::*;
2-
use *;
33

44
extern "C" {
55
#[cfg(ossl300)]

0 commit comments

Comments
 (0)