krb5/Fix-minor-errors-in-softpkcs11.patch
Robbie Harwood 1404656ded Use OpenSSL's backported KDFs
Restore MD4 in FIPS mode (for samba)
2019-11-19 14:45:23 -05:00

42 lines
1.3 KiB
Diff

From df5026b47d2f90729b76071fd7cae48d46c4d1f6 Mon Sep 17 00:00:00 2001
From: Robbie Harwood <rharwood@redhat.com>
Date: Fri, 8 Nov 2019 14:28:56 -0500
Subject: [PATCH] Fix minor errors in softpkcs11
Fix a printf type mismatch in attributes_match() reported by Coverity,
and a possible uninitizlied use of key_type in add_certificate()
reported by clang.
[ghudson@mit.edu: squashed commits and rewrote commit message]
(cherry picked from commit 560e48fee9a192ed4eb1b6cbd62c119087b53948)
---
src/tests/softpkcs11/main.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/tests/softpkcs11/main.c b/src/tests/softpkcs11/main.c
index a4c3ae78e..1cccdfb43 100644
--- a/src/tests/softpkcs11/main.c
+++ b/src/tests/softpkcs11/main.c
@@ -261,7 +261,7 @@ attributes_match(const struct st_object *obj,
}
}
if (match == 0) {
- st_logf("type %d attribute have no match\n", attributes[i].type);
+ st_logf("type %lu attribute have no match\n", attributes[i].type);
return 0;
}
}
@@ -553,8 +553,9 @@ add_certificate(char *label,
key_type = CKK_DSA;
break;
default:
- /* XXX */
- break;
+ st_logf("invalid key_type\n");
+ ret = CKR_GENERAL_ERROR;
+ goto out;
}
c = CKO_CERTIFICATE;