OpenPGP: use pgp_new_blob() to setup MF blob

Use the standard way to create blobs, pgp_new_blob(), also for the MF.

Signed-off-by: Peter Marschall <peter@adpm.de>
This commit is contained in:
Peter Marschall 2011-05-31 18:34:41 +02:00
parent 4ddec5d384
commit da5a223e26
1 changed files with 7 additions and 10 deletions

View File

@ -276,12 +276,6 @@ pgp_init(sc_card_t *card)
return SC_ERROR_OUT_OF_MEMORY;
card->drv_data = priv;
priv->mf = calloc(1, sizeof(struct blob));
if (!priv->mf) {
pgp_finish(card);
return SC_ERROR_OUT_OF_MEMORY;
}
card->cla = 0x00;
/* set pointer to correct list of card objects */
@ -309,12 +303,15 @@ pgp_init(sc_card_t *card)
card->serialnr.len = 6;
}
/* change file path to MF for re-use in MF */
sc_format_path("3f00", &file->path);
file->type = SC_FILE_TYPE_DF;
file->id = 0x3f00;
priv->mf->file = file;
priv->mf->id = 0x3F00;
/* set up the root of our fake file tree */
priv->mf = pgp_new_blob(card, NULL, 0x3f00, file);
if (!priv->mf) {
pgp_finish(card);
return SC_ERROR_OUT_OF_MEMORY;
}
/* select MF */
priv->current = priv->mf;