SHA256
1
0
forked from pool/parsec
Dominique Leuenberger 2021-04-30 22:46:54 +00:00 committed by Git OBS Bridge
commit d084f86259
3 changed files with 61 additions and 0 deletions

53
parsec-fix-old-rust.patch Normal file
View File

@ -0,0 +1,53 @@
From f9688c44319c1733586d6fbc3b3c24a403deaed8 Mon Sep 17 00:00:00 2001
From: Hugues de Valon <hugues.devalon@arm.com>
Date: Fri, 30 Apr 2021 10:48:37 +0100
Subject: [PATCH] Make it compile for Rust 1.43.1
The From trait was not implemented for that version of Rust. Uses the
to_vec method which achieves the same thing.
Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
---
src/providers/pkcs11/key_management.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/providers/pkcs11/key_management.rs b/src/providers/pkcs11/key_management.rs
index 6bc5e06..73ce607 100644
--- a/src/providers/pkcs11/key_management.rs
+++ b/src/providers/pkcs11/key_management.rs
@@ -27,7 +27,7 @@ impl Provider {
key_id: u32,
key_type: KeyPairType,
) -> Result<ObjectHandle> {
- let mut template = vec![Attribute::Id(key_id.to_be_bytes().into())];
+ let mut template = vec![Attribute::Id(key_id.to_be_bytes().to_vec())];
match key_type {
KeyPairType::PublicKey => template.push(Attribute::Class(ObjectClass::PUBLIC_KEY)),
@@ -103,7 +103,7 @@ impl Provider {
let key_id = self.create_key_id();
let mut pub_template = vec![
- Attribute::Id(key_id.to_be_bytes().into()),
+ Attribute::Id(key_id.to_be_bytes().to_vec()),
Attribute::Token(true.into()),
Attribute::AllowedMechanisms(vec![Mechanism::try_from(
key_attributes.policy.permitted_algorithms,
@@ -122,7 +122,7 @@ impl Provider {
let mech = match key_attributes.key_type {
Type::RsaKeyPair => {
pub_template.push(Attribute::Private(false.into()));
- pub_template.push(Attribute::PublicExponent(utils::PUBLIC_EXPONENT.into()));
+ pub_template.push(Attribute::PublicExponent(utils::PUBLIC_EXPONENT.to_vec()));
pub_template.push(Attribute::ModulusBits(
key_attributes.bits.try_into().map_err(to_response_status)?,
));
@@ -225,7 +225,7 @@ impl Provider {
template.push(Attribute::PublicExponent(exponent_object.into()));
template.push(Attribute::Verify(true.into()));
template.push(Attribute::Encrypt(true.into()));
- template.push(Attribute::Id(key_id.to_be_bytes().into()));
+ template.push(Attribute::Id(key_id.to_be_bytes().to_vec()));
template.push(Attribute::Private(false.into()));
template.push(Attribute::AllowedMechanisms(vec![MechanismType::RSA_PKCS]));

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Apr 30 11:36:56 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Fix build with old rust used in Leap 15.3/SLE15-SP3.
* parsec-fix-old-rust.patch
-------------------------------------------------------------------
Wed Apr 14 14:54:32 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>

View File

@ -35,6 +35,8 @@ Source3: parsec.service
Source4: config.toml
Source5: parsec.conf
Source6: system-user-parsec.conf
# Fix build with old rust used in Leap 15.3/SLE15-SP3 - https://github.com/parallaxsecond/parsec/issues/409
Patch1: parsec-fix-old-rust.patch
BuildRequires: cargo
BuildRequires: clang-devel
BuildRequires: cmake