mirror of
git://git.gnupg.org/gnupg.git
synced 2024-10-31 20:08:43 +01:00
scd:p15: Shorten the displayed s/n of RSCS cards
* scd/app-p15.c (get_dispserialno): Add dedicated handling for RSCS. -- In fact we fix the display of the s/n because the s/n was taken from a certificate. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
3cbc66410d
commit
21e3f750bd
@ -4895,11 +4895,19 @@ static char *
|
||||
get_dispserialno (app_t app, prkdf_object_t prkdf)
|
||||
{
|
||||
char *serial;
|
||||
size_t n;
|
||||
|
||||
/* We prefer the SerialNumber RDN from the Subject-DN but we don't
|
||||
* use it if it features a percent sign (special character in pin
|
||||
* prompts) or has any control character. */
|
||||
if (prkdf && prkdf->serial_number && *prkdf->serial_number
|
||||
if (app->app_local->card_product == CARD_PRODUCT_RSCS)
|
||||
{
|
||||
/* We use only the rigght 8 hex digits. */
|
||||
serial = app_get_serialno (app);
|
||||
if (serial && (n=strlen (serial)) > 8)
|
||||
memmove (serial, serial + n - 8, 9);
|
||||
}
|
||||
else if (prkdf && prkdf->serial_number && *prkdf->serial_number
|
||||
&& !strchr (prkdf->serial_number, '%')
|
||||
&& !any_control_or_space (prkdf->serial_number))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user