Add a CI job to run 'cargo test' with rustc/cargo from debian stable.
Minor fixes so that the code compiles with rustc 1.48
This commit is contained in:
parent
454d50eb45
commit
fdac0de34f
3 changed files with 19 additions and 8 deletions
|
@ -1,8 +1,6 @@
|
|||
# SPDX-FileCopyrightText: 2021 Heiko Schaefer <heiko@schaefer.name>
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
image: rust:latest
|
||||
|
||||
reuse:
|
||||
image:
|
||||
name: fsfe/reuse:latest
|
||||
|
@ -12,15 +10,28 @@ reuse:
|
|||
|
||||
cargo-test:
|
||||
stage: test
|
||||
image: rust:latest
|
||||
before_script:
|
||||
- mkdir -p /run/user/$UID
|
||||
- apt update -y -qq
|
||||
- apt install -y -qq --no-install-recommends git clang make pkg-config nettle-dev libssl-dev capnproto ca-certificates libpcsclite-dev
|
||||
- apt clean
|
||||
script:
|
||||
- cargo test
|
||||
|
||||
cargo-test-debian-stable:
|
||||
stage: test
|
||||
image: debian:stable
|
||||
before_script:
|
||||
- mkdir -p /run/user/$UID
|
||||
- apt update -y -qq
|
||||
- apt install -y -qq --no-install-recommends git rustc cargo clang make pkg-config nettle-dev libssl-dev capnproto ca-certificates libpcsclite-dev
|
||||
- apt clean
|
||||
script:
|
||||
- cargo test
|
||||
- cargo test
|
||||
|
||||
cargo-fmt:
|
||||
image: rust:latest
|
||||
script:
|
||||
- rustup component add rustfmt
|
||||
- cargo fmt -- --check
|
||||
|
|
|
@ -30,12 +30,12 @@ pub(crate) fn upload_subkeys(
|
|||
) -> Result<Vec<(String, KeyGenerationTime)>> {
|
||||
let mut out = vec![];
|
||||
|
||||
for kt in [
|
||||
for kt in &[
|
||||
KeyType::Signing,
|
||||
KeyType::Decryption,
|
||||
KeyType::Authentication,
|
||||
] {
|
||||
let vka = get_subkey(cert, kt)?;
|
||||
let vka = get_subkey(cert, *kt)?;
|
||||
|
||||
// store fingerprint as return-value
|
||||
let fp = vka.fingerprint().to_hex();
|
||||
|
@ -50,7 +50,7 @@ pub(crate) fn upload_subkeys(
|
|||
|
||||
// upload key
|
||||
let cuk = vka_as_uploadable_key(vka, None);
|
||||
let _ = ca.upload_key(cuk, kt)?;
|
||||
ca.upload_key(cuk, *kt)?;
|
||||
}
|
||||
|
||||
Ok(out)
|
||||
|
|
|
@ -309,12 +309,12 @@ impl CardUploadableKey for SequoiaKey {
|
|||
|
||||
let secret_key_material = unenc.map(|mpis| mpis.clone());
|
||||
|
||||
match (&self.public, secret_key_material) {
|
||||
match (self.public.clone(), secret_key_material) {
|
||||
(
|
||||
mpi::PublicKey::RSA { e, n },
|
||||
mpi::SecretKeyMaterial::RSA { d: _, p, q, u: _ },
|
||||
) => {
|
||||
let sq_rsa = SqRSA::new(e.clone(), n.clone(), p, q);
|
||||
let sq_rsa = SqRSA::new(e, n, p, q);
|
||||
|
||||
Ok(PrivateKeyMaterial::R(Box::new(sq_rsa)))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue