Blame SOURCES/opencryptoki-3.16.0-5824364d995e5d2418f885ee57e377e11d1b3302.patch
|
|
c87d79 |
commit 5824364d995e5d2418f885ee57e377e11d1b3302
|
|
|
c87d79 |
Author: Ingo Franzki <ifranzki@linux.ibm.com>
|
|
|
c87d79 |
Date: Wed Jul 7 13:44:46 2021 +0200
|
|
|
c87d79 |
|
|
|
c87d79 |
pkcstok_migrate: Quote strings with spaces in opencryptoki.conf
|
|
|
c87d79 |
|
|
|
c87d79 |
When modifying opencryptoki.conf during token migration, put quotes
|
|
|
c87d79 |
around strings that contain spaces, e.g. for the slot description and
|
|
|
c87d79 |
manufacturer.
|
|
|
c87d79 |
|
|
|
c87d79 |
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
|
|
|
c87d79 |
|
|
|
c87d79 |
diff --git a/usr/sbin/pkcstok_migrate/pkcstok_migrate.c b/usr/sbin/pkcstok_migrate/pkcstok_migrate.c
|
|
|
c87d79 |
index 94fd1196..3df1596e 100644
|
|
|
c87d79 |
--- a/usr/sbin/pkcstok_migrate/pkcstok_migrate.c
|
|
|
c87d79 |
+++ b/usr/sbin/pkcstok_migrate/pkcstok_migrate.c
|
|
|
c87d79 |
@@ -2107,7 +2107,10 @@ static int parseupdate_key_str(void *private, int tok, const char *val)
|
|
|
c87d79 |
{
|
|
|
c87d79 |
struct parseupdate *u = (struct parseupdate *)private;
|
|
|
c87d79 |
|
|
|
c87d79 |
- if (tok != KW_TOKVERSION)
|
|
|
c87d79 |
+ if (tok != KW_HWVERSION && tok != KW_FWVERSION &&
|
|
|
c87d79 |
+ strchr(val, ' ') != NULL)
|
|
|
c87d79 |
+ fprintf(u->f, " %s = \"%s\"", keyword_token_to_str(tok), val);
|
|
|
c87d79 |
+ else if (tok != KW_TOKVERSION)
|
|
|
c87d79 |
fprintf(u->f, " %s = %s", keyword_token_to_str(tok), val);
|
|
|
c87d79 |
return 0;
|
|
|
c87d79 |
}
|