Blame SOURCES/opensc-0.20.0-label-padding.patch

176fa0
commit 8d4af9eb0b799f22b25783e8e1b7af329b5a917b
176fa0
Author: Frank Morgner <frankmorgner@gmail.com>
176fa0
Date:   Fri Jan 31 12:15:53 2020 +0100
176fa0
176fa0
    pkcs11: fixed right padding of token label with ' '
176fa0
    
176fa0
    fixes https://github.com/OpenSC/OpenSC/issues/1922
176fa0
176fa0
diff --git a/src/pkcs11/framework-pkcs15.c b/src/pkcs11/framework-pkcs15.c
176fa0
index e94eeeff..a1951c2e 100644
176fa0
--- a/src/pkcs11/framework-pkcs15.c
176fa0
+++ b/src/pkcs11/framework-pkcs15.c
176fa0
@@ -1122,9 +1122,10 @@ pkcs15_init_slot(struct sc_pkcs15_card *p15card, struct sc_pkcs11_slot *slot,
176fa0
 							max_tokeninfo_len);
176fa0
 					slot->token_info.label[max_tokeninfo_len]           = ' ';
176fa0
 					slot->token_info.label[max_tokeninfo_len+1]         = '(';
176fa0
-					slot->token_info.label[max_tokeninfo_len+2+pin_len] = ')';
176fa0
 					strcpy_bp(slot->token_info.label+max_tokeninfo_len+2,
176fa0
 							auth->label, pin_len);
176fa0
+					strcpy_bp(slot->token_info.label+max_tokeninfo_len+2+pin_len,
176fa0
+							")", 32 - max_tokeninfo_len-2-pin_len);
176fa0
 				}
176fa0
 			} else {
176fa0
 				/* PIN label is empty or just says non-useful "PIN",