|
0 |
This patch is based on the 3 upstream commits described below.
|
|
1 |
|
0 | 2 |
From 81c0f195210df9d9a4c875cc03b84e6391b140b5 Mon Sep 17 00:00:00 2001
|
1 | 3 |
From: Luca BRUNO <luca.bruno@coreos.com>
|
2 | 4 |
Date: Thu, 11 Jun 2020 11:57:57 +0000
|
3 | 5 |
Subject: [PATCH] id128: update to new hmac API
|
4 | 6 |
|
5 | |
---
|
6 | |
src/id128.rs | 6 +++---
|
7 | |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
7 |
commit 67f4c3c306783c0a0758370abe1e918c74c237f9
|
|
8 |
Author: Zhang Jingqiang <zh_jq@outlook.com>
|
|
9 |
Date: Fri Dec 17 19:42:21 2021 +0800
|
8 | 10 |
|
9 | |
--- a/src/id128.rs
|
10 | |
+++ b/src/id128.rs
|
11 | |
@@ -37,13 +37,13 @@ impl Id128 {
|
12 | |
|
13 | |
/// Hash this ID with an application-specific ID.
|
14 | |
pub fn app_specific(&self, app: &Self) -> Result<Self> {
|
15 | |
- use hmac::{Hmac, Mac};
|
16 | |
+ use hmac::{Hmac, Mac, NewMac};
|
|
11 |
update sha2 and hmac to new version
|
|
12 |
|
|
13 |
commit 7c760aafee0408c6e7192bcbea1fb9ef6ed69fd9
|
|
14 |
Author: Luca BRUNO <luca.bruno@coreos.com>
|
|
15 |
Date: Tue Jun 1 08:47:35 2021 +0000
|
|
16 |
|
|
17 |
id128: update to new hmac API
|
|
18 |
|
|
19 |
Index: libsystemd/src/id128.rs
|
|
20 |
===================================================================
|
|
21 |
--- libsystemd.orig/src/id128.rs
|
|
22 |
+++ libsystemd/src/id128.rs
|
|
23 |
@@ -40,10 +40,10 @@ impl Id128 {
|
|
24 |
use hmac::{Hmac, Mac};
|
17 | 25 |
use sha2::Sha256;
|
18 | 26 |
|
19 | |
let mut mac = Hmac::<Sha256>::new_varkey(self.uuid_v4.as_bytes())
|
|
27 |
- let mut mac = Hmac::<Sha256>::new_varkey(self.uuid_v4.as_bytes())
|
|
28 |
+ let mut mac = Hmac::<Sha256>::new_from_slice(self.uuid_v4.as_bytes())
|
20 | 29 |
.map_err(|_| "failed to prepare HMAC")?;
|
21 | 30 |
- mac.input(app.uuid_v4.as_bytes());
|
22 | 31 |
- let mut hashed = mac.result().code();
|
|
25 | 34 |
|
26 | 35 |
ensure!(hashed.len() == 32, "short hash");
|
27 | 36 |
|
28 | |
--- a/Cargo.toml
|
29 | |
+++ b/Cargo.toml
|
|
37 |
Index: libsystemd/Cargo.toml
|
|
38 |
===================================================================
|
|
39 |
--- libsystemd.orig/Cargo.toml
|
|
40 |
+++ libsystemd/Cargo.toml
|
30 | 41 |
@@ -35,7 +35,7 @@ version = "^0.12.1"
|
31 | 42 |
default-features = false
|
32 | 43 |
|
33 | 44 |
[dependencies.hmac]
|
34 | 45 |
-version = "0.7"
|
35 | |
+version = "0.10"
|
|
46 |
+version = "0.12"
|
36 | 47 |
|
37 | 48 |
[dependencies.libc]
|
38 | 49 |
version = "0.2"
|