forked from pool/parsec
Accepting request 889538 from security
OBS-URL: https://build.opensuse.org/request/show/889538 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/parsec?expand=0&rev=5
This commit is contained in:
commit
d084f86259
53
parsec-fix-old-rust.patch
Normal file
53
parsec-fix-old-rust.patch
Normal 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]));
|
||||||
|
|
@ -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>
|
Wed Apr 14 14:54:32 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ Source3: parsec.service
|
|||||||
Source4: config.toml
|
Source4: config.toml
|
||||||
Source5: parsec.conf
|
Source5: parsec.conf
|
||||||
Source6: system-user-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: cargo
|
||||||
BuildRequires: clang-devel
|
BuildRequires: clang-devel
|
||||||
BuildRequires: cmake
|
BuildRequires: cmake
|
||||||
|
Loading…
Reference in New Issue
Block a user