Blame SOURCES/opencryptoki-3.16.0-5824364d995e5d2418f885ee57e377e11d1b3302.patch

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