Changeset View
Changeset View
Standalone View
Standalone View
scd/app-openpgp.c
| Context not available. | |||||
| (void)ctrl; | (void)ctrl; | ||||
| /* An extra check which should not be necessary because the caller | /* All Card can be reselectioned without any problem | ||||
| * should have made sure that a re-select is only called for | * This can slow down operation but if is bad applet | ||||
| * appropriate cards. */ | * it's OK because slow is more acceptable than error */ | ||||
| if (APP_CARD(app)->cardtype != CARDTYPE_YUBIKEY) | |||||
| return gpg_error (GPG_ERR_NOT_SUPPORTED); | |||||
| /* Note that the card can't cope with P2=0xCO, thus we need to pass | /* Note that the card can't cope with P2=0xCO, thus we need to pass | ||||
| * a special flag value. */ | * a special flag value. */ | ||||
| Context not available. | |||||
| } | } | ||||
| /* Check if AID is the correct one. */ | |||||
| static gpg_error_t | |||||
| do_check_aid (app_t app, ctrl_t ctrl, const unsigned char *aid, size_t aidlen) | |||||
| { | |||||
| if (aidlen >= sizeof openpgp_aid | |||||
| && memcmp (aid, openpgp_aid, sizeof openpgp_aid) == 0) | |||||
| return 0; | |||||
| return gpg_error (GPG_ERR_WRONG_CARD); | |||||
| } | |||||
| /* Select the OpenPGP application on the card in SLOT. This function | /* Select the OpenPGP application on the card in SLOT. This function | ||||
| must be used before any other OpenPGP application functions. */ | must be used before any other OpenPGP application functions. */ | ||||
| gpg_error_t | gpg_error_t | ||||
| Context not available. | |||||
| app->fnc.change_pin = do_change_pin; | app->fnc.change_pin = do_change_pin; | ||||
| app->fnc.check_pin = do_check_pin; | app->fnc.check_pin = do_check_pin; | ||||
| app->fnc.with_keygrip = do_with_keygrip; | app->fnc.with_keygrip = do_with_keygrip; | ||||
| app->fnc.check_aid = do_check_aid; | |||||
| } | } | ||||
| leave: | leave: | ||||
| Context not available. | |||||