1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-22 14:57:02 +01:00

scd:openpgp: Very minor refactoring

* scd/app-openpgp.c (app_select_openpgp): Move AID definition to ...
(openpgp_aid): new.
This commit is contained in:
Werner Koch 2023-10-10 11:55:25 +02:00
parent 7f8cac5cec
commit 24033dc8ae
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -52,7 +52,6 @@
#include <time.h> #include <time.h>
#include "scdaemon.h" #include "scdaemon.h"
#include "../common/util.h" #include "../common/util.h"
#include "../common/i18n.h" #include "../common/i18n.h"
#include "iso7816.h" #include "iso7816.h"
@ -64,6 +63,9 @@
#define KDF_DATA_LENGTH_MIN 90 #define KDF_DATA_LENGTH_MIN 90
#define KDF_DATA_LENGTH_MAX 110 #define KDF_DATA_LENGTH_MAX 110
/* The AID of this application. */
static char const openpgp_aid[] = { 0xD2, 0x76, 0x00, 0x01, 0x24, 0x01 };
/* A table describing the DOs of the card. */ /* A table describing the DOs of the card. */
static struct { static struct {
int tag; int tag;
@ -5594,7 +5596,6 @@ parse_algorithm_attribute (app_t app, int keyno)
gpg_error_t gpg_error_t
app_select_openpgp (app_t app) app_select_openpgp (app_t app)
{ {
static char const aid[] = { 0xD2, 0x76, 0x00, 0x01, 0x24, 0x01 };
int slot = app_get_slot (app); int slot = app_get_slot (app);
gpg_error_t err; gpg_error_t err;
unsigned char *buffer; unsigned char *buffer;
@ -5603,7 +5604,8 @@ app_select_openpgp (app_t app)
/* Note that the card can't cope with P2=0xCO, thus we need to pass a /* Note that the card can't cope with P2=0xCO, thus we need to pass a
special flag value. */ special flag value. */
err = iso7816_select_application (slot, aid, sizeof aid, 0x0001); err = iso7816_select_application (slot,
openpgp_aid, sizeof openpgp_aid, 0x0001);
if (!err) if (!err)
{ {
unsigned int manufacturer; unsigned int manufacturer;