Merge ~fheimes/ubuntu/+source/opencryptoki:opencryptoki-sru-lp1915517-groovy into ubuntu/+source/opencryptoki:ubuntu/groovy-devel

Proposed by Frank Heimes
Status: Needs review
Proposed branch: ~fheimes/ubuntu/+source/opencryptoki:opencryptoki-sru-lp1915517-groovy
Merge into: ubuntu/+source/opencryptoki:ubuntu/groovy-devel
Diff against target: 85 lines (+63/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch (+54/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Canonical Foundations Team Pending
Review via email: mp+398908@code.launchpad.net

Description of the change

opencryptoki-sru-lp1915517-groovy
    debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch
    Fix failed pkcscca migration with usr/sb2 is not a valid slot ID.
    Added patch f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43
    (now caa4bbba51cf470986944820ea773163084da0b7) from > 3.15.1
    for fixing migration of master key from OLD register to CURRENT register.
    (LP: #1915517)

Test build is available here:
https://launchpad.net/~fheimes/+archive/ubuntu/lp1915517

To post a comment you must log in.

Unmerged commits

a45a876... by Frank Heimes

  * debian/changelog for debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch

16152e9... by Frank Heimes

  * debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch
    fixing migration of master key from OLD register to CURRENT register (from > 3.15.1)
    Thanks to Patrick Steuer (LP: #1915517)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 706cb36..070c947 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+opencryptoki (3.14.0+dfsg-0ubuntu3.1) groovy; urgency=medium
7+
8+ * debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch
9+ fixing migration of master key from OLD register to CURRENT register (from > 3.15.1)
10+ Thanks to Patrick Steuer (LP: #1915517)
11+
12+ -- Frank Heimes <frank.heimes@canonical.com> Mon, 01 Mar 2021 18:58:02 +0100
13+
14 opencryptoki (3.14.0+dfsg-0ubuntu3) groovy; urgency=medium
15
16 * Fix token migration and conversion LP: #1893216
17diff --git a/debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch b/debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch
18new file mode 100644
19index 0000000..4351ade
20--- /dev/null
21+++ b/debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch
22@@ -0,0 +1,54 @@
23+From caa4bbba51cf470986944820ea773163084da0b7 Mon Sep 17 00:00:00 2001
24+From: Patrick Steuer <patrick.steuer@de.ibm.com>
25+Date: Tue, 19 Jan 2021 14:29:57 +0100
26+Subject: [PATCH] A slot ID has nothing to do with the number of slots
27+
28+Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
29+
30+Author: Patrick Steuer <patrick.steuer@de.ibm.com>
31+Origin: upstream, https://github.com/opencryptoki/opencryptoki/commit/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43
32+ (now https://github.com/opencryptoki/opencryptoki/commit/caa4bbba51cf470986944820ea773163084da0b7)
33+Bug-IBM: Bugzilla 191527
34+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1915517
35+Applied-Upstream: > v3.15.1
36+Reviewed-by: Frank Heimes <frank.heimes@canonical.com>
37+Last-Update: 2021-03-01
38+
39+---
40+ usr/sbin/pkcscca/pkcscca.c | 14 --------------
41+ 1 file changed, 14 deletions(-)
42+diff --git a/usr/sbin/pkcscca/pkcscca.c b/usr/sbin/pkcscca/pkcscca.c
43+index c09f16b3..aa74eeb8 100644
44+--- a/usr/sbin/pkcscca/pkcscca.c
45++++ b/usr/sbin/pkcscca/pkcscca.c
46+@@ -1142,7 +1142,6 @@ int migrate_wrapped_keys(CK_SLOT_ID slot_id, char *userpin, int masterkey)
47+ {
48+ CK_FUNCTION_LIST *funcs;
49+ CK_KEY_TYPE key_type = 0;
50+- CK_ULONG slot_count;
51+ CK_SESSION_HANDLE sess;
52+ CK_RV rv;
53+ struct key_count count = { 0, 0, 0, 0, 0, 0, 0 };
54+@@ -1154,19 +1153,6 @@ int migrate_wrapped_keys(CK_SLOT_ID slot_id, char *userpin, int masterkey)
55+ return 2;
56+ }
57+
58+- rv = funcs->C_GetSlotList(TRUE, NULL_PTR, &slot_count);
59+- if (rv != CKR_OK) {
60+- p11_error("C_GetSlotList", rv);
61+- exit_code = 3;
62+- goto finalize;
63+- }
64+-
65+- if (slot_id >= slot_count) {
66+- print_error("%lu is not a valid slot ID.", slot_id);
67+- exit_code = 4;
68+- goto finalize;
69+- }
70+-
71+ rv = funcs->C_OpenSession(slot_id, CKF_RW_SESSION |
72+ CKF_SERIAL_SESSION, NULL_PTR, NULL_PTR, &sess);
73+ if (rv != CKR_OK) {
74+--
75+2.25.1
76+
77diff --git a/debian/patches/series b/debian/patches/series
78index af09246..93b89ff 100644
79--- a/debian/patches/series
80+++ b/debian/patches/series
81@@ -13,3 +13,4 @@ ba1e0c730a6eadfc61d4d6d159de1d01f9f7489b.patch
82 d06e4170378ec165aaa67246aba34a74e372c3a9.patch
83 228e1ef36b4b2b47f4310b2730e1c9b67bd4274b.patch
84 d15736b3d586518bfa2359e7eb28b90837b5de22.patch
85+f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch

Subscribers

People subscribed via source and target branches