Thank you for your explanation.
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Jun 21 2021
Thank you for your report.
I pushed the fix.
If your token/card is not Yubikey and when it is possible to improve your token/card implementation, I would suggest not follow what Yubikey does for multiple applications; No multiple applications, but each feature with independent access (card+CCID, another card+different CCID, FIDO+HID, ...).
Jun 18 2021
For the problem of external application switch, please test this:
diff --git a/scd/app-common.h b/scd/app-common.h index dffe1200d..d6e6f4c0a 100644 --- a/scd/app-common.h +++ b/scd/app-common.h @@ -194,6 +194,8 @@ struct app_ctx_s { void *pincb_arg); gpg_error_t (*with_keygrip) (app_t app, ctrl_t ctrl, int action, const char *keygrip_str, int capability); + gpg_error_t (*check_aid) (app_t app, ctrl_t ctrl, + const unsigned char *aid, size_t aidlen); } fnc; };
Here is the reference to GID specification:
https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn642100(v=vs.85)?redirectedfrom=MSDN
Let me add the tag "yubikey".
I think that it could be solved in different level, if I were the device manufacturer; And it would give users the best solution.
Jun 17 2021
If something more user friendly is required, it could be possible for higher layer (SCDaemon's command handling) to check verification status beforehand, and do error recovery there.
I don't think we should do automatic error recovery from 6982 to retry decryption/signing, inside CMD_PSO (0x2A) operation.
Thank you.
Thank you.
I apply Diff1487 then Diff1488.
Jun 16 2021
OK. I think that the patch at SUSE is updated one which works.
As I understand correctly, this is a kind of very old patch, which intended to work around old libgcrypt limitation of RSA PSS.
Possible way would be: (for newer card/token of OpenPGPcard 3.4 or later) before crypto operations, we can ask card/token if authentication state is consistent to the one of scdaemon and if not reselect AID.
I'd like to support your use case. Could you please tell me about: How can we distinguish normal failure of 6982 and unusual failure of other application interference which results 6982?
I think that {D1476} is still a sketch (not real code which works). I would guess an intended use, but it's good to have concrete example program which uses the feature being added.
Jun 15 2021
Does the patch really work, or is it a sketch to describe the intended use?
I set the priority 'High' as Yubikey NEO is the last one with source code available, IIUC.
@kianga
Thanks for your log.
Jun 14 2021
Regression Yubikey NEO: T5487
Thank you. Here are my comments.
I think that Yubikey NEO is older than Yubikey 4.
Fixed in rG01a413d5235f: scd: Error code map fix for older Yubikey..
New code for Yubikey 4 or later causes wrong interaction for Yubikey NEO in 2.2.28.
Thank you for your report.
Jun 13 2021
Thank you for your suggestion and making a patch.
Jun 11 2021
For Reset Code (00D3), setting it to '' (null, to reset the DO) doesn't work, but it raises 6a80.
Once it sets by something, only factory-reset can remove the value.
While scd/app-openpgp.c assumes access of 006E composite data object to get its children objects like AID (004F), Card Capabilities (0047), etc., yubikey raises 6e82 error for the DO.
Jun 10 2021
Pushed the change.
Considering the history of the translation, I concluded that it should be:
把密钥导出到一个公钥服务器上
(the typo was G-A where B-A was expected.)
@guzhongren
This is not GitHub, so, if you want, you need to learn how to submit your change in the form of patch, by using git.
Jun 9 2021
Fixed.
I'm not sure if it's worth backporting this to 2.2.
I encountered this bug last year, but I realized that it's hard to make a reproducible case.
For the Data Object of serial number, what I read is this code: https://github.com/Yubico/yubikey-manager
Jun 8 2021
Applied and pushed.
The device with serial number 10000003, it is represented as three bytes: 00989683
Jun 7 2021
@dkg
If we support native X25519 format, multiple representations will be possible (there are 32 ways, at least) for a single secret key, because it's the feature of X25519.
In 2.3, the logic to identify Yubikey has been changed (to support PIV application).
In your log, it says:
usb_claim_interface failed: -3
Sorry, I was wrong.
@werner
My patch is for the case if it's better to accept such a key of OpenPGP.
I don't know if it's better or not (yet). The purpose of this patch is to show the point where OpenPGP secret part translates into libgcrypt secret key, concretely.
Jun 4 2021
For an implementation of Curve25519 routine, it is needed to tweak those bits.
Better to have in-line:
diff --git a/agent/cvt-openpgp.c b/agent/cvt-openpgp.c index 53c88154b..b1d43227a 100644 --- a/agent/cvt-openpgp.c +++ b/agent/cvt-openpgp.c @@ -159,7 +159,21 @@ convert_secret_key (gcry_sexp_t *r_key, int pubkey_algo, gcry_mpi_t *skey, EdDSA flag. */ format = "(private-key(ecc(curve %s)(flags eddsa)(q%m)(d%m)))"; else if (!strcmp (curve, "Curve25519")) - format = "(private-key(ecc(curve %s)(flags djb-tweak)(q%m)(d%m)))"; + { + unsigned int nbits; + unsigned char *buffer = gcry_mpi_get_opaque (skey[1], &nbits); + unsigned char d[32]; + + if (nbits != 256) + return gpg_error (GPG_ERR_BAD_SECKEY); + + memcpy (d, buffer, 32); + d[0] = (d[0] & 0x7f) | 0x40; + d[31] &= 0xf8; + gcry_mpi_release (skey[1]); + skey[1] = gcry_mpi_set_opaque_copy (NULL, d, 256); + format = "(private-key(ecc(curve %s)(flags djb-tweak)(q%m)(d%m)))"; + } else format = "(private-key(ecc(curve %s)(q%m)(d%m)))";
"Curve25519" in libgcrypt was implemented before the standardization of X25519. There are two problems here: endianess and tweaking-bits.
Ah, I think that your problem was fixed in rG53bdc6288f9b: scd: Recover the partial match for PORTSTR for PC/SC. (to be 2.3.2).
I see your situation
If possible, please let us know how you configure the permission to access CCID device with 2.2 (and with 2.3)?