Run rustfmt on github actions
This commit is contained in:
parent
72048765c7
commit
406031991f
|
|
@ -0,0 +1,25 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- github-actions
|
||||
|
||||
env:
|
||||
RUSTFLAGS: -Dwarnings
|
||||
RUST_BACKTRACE: 1
|
||||
|
||||
jobs:
|
||||
rustfmt:
|
||||
name: rustfmt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Install Rust
|
||||
run: rustup update stable && rustup default stable
|
||||
- name: Check formatting
|
||||
run: cargo fmt --all -- --check
|
||||
|
|
@ -207,10 +207,7 @@ fn try_vcpkg() {
|
|||
.find_package("openssl");
|
||||
|
||||
if let Err(e) = lib {
|
||||
println!(
|
||||
"note: vcpkg did not find openssl: {}",
|
||||
e
|
||||
);
|
||||
println!("note: vcpkg did not find openssl: {}", e);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ extern "C" {
|
|||
pub fn EVP_DecryptFinal_ex(
|
||||
ctx: *mut EVP_CIPHER_CTX,
|
||||
outm: *mut c_uchar,
|
||||
outl: *mut c_int
|
||||
outl: *mut c_int,
|
||||
) -> c_int;
|
||||
}
|
||||
cfg_if! {
|
||||
|
|
|
|||
|
|
@ -142,9 +142,7 @@ extern "C" {
|
|||
buf: *mut *const u8,
|
||||
length: c_long,
|
||||
) -> *mut PKCS8_PRIV_KEY_INFO;
|
||||
pub fn PKCS8_PRIV_KEY_INFO_free(
|
||||
p8inf: *mut PKCS8_PRIV_KEY_INFO,
|
||||
);
|
||||
pub fn PKCS8_PRIV_KEY_INFO_free(p8inf: *mut PKCS8_PRIV_KEY_INFO);
|
||||
|
||||
pub fn PEM_read_bio_PKCS7(
|
||||
bio: *mut BIO,
|
||||
|
|
|
|||
|
|
@ -527,10 +527,7 @@ impl PKey<Private> {
|
|||
/// Deserializes a DER-formatted PKCS#8 unencrypted private key.
|
||||
///
|
||||
/// This method is mainly for interoperability reasons. Encrypted keyfiles should be preferred.
|
||||
pub fn private_key_from_pkcs8(
|
||||
der: &[u8],
|
||||
) -> Result<PKey<Private>, ErrorStack>
|
||||
{
|
||||
pub fn private_key_from_pkcs8(der: &[u8]) -> Result<PKey<Private>, ErrorStack> {
|
||||
unsafe {
|
||||
ffi::init();
|
||||
let len = der.len().min(c_long::max_value() as usize) as c_long;
|
||||
|
|
@ -539,8 +536,7 @@ impl PKey<Private> {
|
|||
&mut der.as_ptr(),
|
||||
len,
|
||||
))?;
|
||||
let res = cvt_p(ffi::EVP_PKCS82PKEY(p8inf))
|
||||
.map(|p| PKey::from_ptr(p));
|
||||
let res = cvt_p(ffi::EVP_PKCS82PKEY(p8inf)).map(|p| PKey::from_ptr(p));
|
||||
ffi::PKCS8_PRIV_KEY_INFO_free(p8inf);
|
||||
res
|
||||
}
|
||||
|
|
|
|||
|
|
@ -354,7 +354,11 @@ impl<'a> Signer<'a> {
|
|||
///
|
||||
/// [`EVP_DigestSign`]: https://www.openssl.org/docs/man1.1.1/man3/EVP_DigestSign.html
|
||||
#[cfg(ossl111)]
|
||||
pub fn sign_oneshot(&mut self, sig_buf: &mut [u8], data_buf: &[u8]) -> Result<usize, ErrorStack> {
|
||||
pub fn sign_oneshot(
|
||||
&mut self,
|
||||
sig_buf: &mut [u8],
|
||||
data_buf: &[u8],
|
||||
) -> Result<usize, ErrorStack> {
|
||||
unsafe {
|
||||
let mut sig_len = sig_buf.len();
|
||||
cvt(ffi::EVP_DigestSign(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use ffi::{
|
||||
self, BIO_clear_retry_flags, BIO_new, BIO_set_retry_read, BIO_set_retry_write, BIO,
|
||||
BIO_CTRL_FLUSH, BIO_CTRL_DGRAM_QUERY_MTU,
|
||||
BIO_CTRL_DGRAM_QUERY_MTU, BIO_CTRL_FLUSH,
|
||||
};
|
||||
use libc::{c_char, c_int, c_long, c_void, strlen};
|
||||
use std::any::Any;
|
||||
|
|
|
|||
|
|
@ -320,9 +320,9 @@ impl Cipher {
|
|||
/// Determines whether the cipher is using OCB mode
|
||||
#[cfg(ossl110)]
|
||||
fn is_ocb(&self) -> bool {
|
||||
*self == Cipher::aes_128_ocb() ||
|
||||
*self == Cipher::aes_192_ocb() ||
|
||||
*self == Cipher::aes_256_ocb()
|
||||
*self == Cipher::aes_128_ocb()
|
||||
|| *self == Cipher::aes_192_ocb()
|
||||
|| *self == Cipher::aes_256_ocb()
|
||||
}
|
||||
|
||||
#[cfg(not(ossl110))]
|
||||
|
|
|
|||
Loading…
Reference in New Issue