diff options
author | NIIBE Yutaka <[email protected]> | 2016-11-04 04:45:57 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2016-11-04 04:45:57 +0000 |
commit | f9da935c3eb302e75a80def51128fb6f669661d7 (patch) | |
tree | 85cb84c7aea26666af853cdc71481f5015c75fae /scd/app-nks.c | |
parent | agent: Extend the PINENTRY_LAUNCHED inquiry and status. (diff) | |
download | gnupg-f9da935c3eb302e75a80def51128fb6f669661d7.tar.gz gnupg-f9da935c3eb302e75a80def51128fb6f669661d7.zip |
scd: Add --advanced option for READKEY.
* scd/command.c (cmd_readkey) : Support ADVANCED arg.
* scd/app.c (app_readcert): Add ADVANCED arg.
* scd/app-openpgp.c (do_readkey): Implement ADVANCED arg.
* scd/app-nks.c (do_readkey): Error return with GPG_ERR_NOT_SUPPORTED.
--
"SCD READKEY --advanced OPENPGP.3" returns key in advanced format.
With this suport, poldi-ctrl will be no longer needed.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'scd/app-nks.c')
-rw-r--r-- | scd/app-nks.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scd/app-nks.c b/scd/app-nks.c index 458516bfb..598dee187 100644 --- a/scd/app-nks.c +++ b/scd/app-nks.c @@ -618,13 +618,17 @@ do_readcert (app_t app, const char *certid, certificate parsing code in commands.c:cmd_readkey. For internal use PK and PKLEN may be NULL to just check for an existing key. */ static gpg_error_t -do_readkey (app_t app, const char *keyid, unsigned char **pk, size_t *pklen) +do_readkey (app_t app, int advanced, const char *keyid, + unsigned char **pk, size_t *pklen) { gpg_error_t err; unsigned char *buffer[2]; size_t buflen[2]; unsigned short path[1] = { 0x4500 }; + if (advanced) + return GPG_ERR_NOT_SUPPORTED; + /* We use a generic name to retrieve PK.AUT.IFD-SPK. */ if (!strcmp (keyid, "$IFDAUTHKEY") && app->app_local->nks_version >= 3) ; @@ -698,7 +702,7 @@ do_writekey (app_t app, ctrl_t ctrl, else return gpg_error (GPG_ERR_INV_ID); - if (!force && !do_readkey (app, keyid, NULL, NULL)) + if (!force && !do_readkey (app, 0, keyid, NULL, NULL)) return gpg_error (GPG_ERR_EEXIST); /* Parse the S-expression. */ |