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

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

Description of the change

opencryptoki-sru-lp1915517-focal
    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

088fa5d... by Frank Heimes

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

3304a59... 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 9df2e91..67f5b75 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+opencryptoki (3.13.0+dfsg-0ubuntu5.1) focal; 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> Tue, 02 Mar 2021 14:09:59 +0100
13+
14 opencryptoki (3.13.0+dfsg-0ubuntu5) focal; urgency=medium
15
16 * Enable locks by default, on all architectures, which is the new
17diff --git a/debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch b/debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch
18new file mode 100644
19index 0000000..3df63d5
20--- /dev/null
21+++ b/debian/patches/f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch
22@@ -0,0 +1,55 @@
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-02
38+
39+---
40+ usr/sbin/pkcscca/pkcscca.c | 14 --------------
41+ 1 file changed, 14 deletions(-)
42+
43+diff --git a/usr/sbin/pkcscca/pkcscca.c b/usr/sbin/pkcscca/pkcscca.c
44+index c09f16b3..aa74eeb8 100644
45+--- a/usr/sbin/pkcscca/pkcscca.c
46++++ b/usr/sbin/pkcscca/pkcscca.c
47+@@ -1142,7 +1142,6 @@ int migrate_wrapped_keys(CK_SLOT_ID slot_id, char *userpin, int masterkey)
48+ {
49+ CK_FUNCTION_LIST *funcs;
50+ CK_KEY_TYPE key_type = 0;
51+- CK_ULONG slot_count;
52+ CK_SESSION_HANDLE sess;
53+ CK_RV rv;
54+ struct key_count count = { 0, 0, 0, 0, 0, 0, 0 };
55+@@ -1154,19 +1153,6 @@ int migrate_wrapped_keys(CK_SLOT_ID slot_id, char *userpin, int masterkey)
56+ return 2;
57+ }
58+
59+- rv = funcs->C_GetSlotList(TRUE, NULL_PTR, &slot_count);
60+- if (rv != CKR_OK) {
61+- p11_error("C_GetSlotList", rv);
62+- exit_code = 3;
63+- goto finalize;
64+- }
65+-
66+- if (slot_id >= slot_count) {
67+- print_error("%lu is not a valid slot ID.", slot_id);
68+- exit_code = 4;
69+- goto finalize;
70+- }
71+-
72+ rv = funcs->C_OpenSession(slot_id, CKF_RW_SESSION |
73+ CKF_SERIAL_SESSION, NULL_PTR, NULL_PTR, &sess);
74+ if (rv != CKR_OK) {
75+--
76+2.25.1
77+
78diff --git a/debian/patches/series b/debian/patches/series
79index 58aa2da..89f2729 100644
80--- a/debian/patches/series
81+++ b/debian/patches/series
82@@ -2,3 +2,4 @@
83 03-dlopen-soname.patch
84 04-pkcsslotd-cmdline-args.patch
85
86+f1f176cbb4183bcb8a0f7b4d7f649d84a731dd43.patch

Subscribers

People subscribed via source and target branches