solokeys / openpgp

OpenPGP functionality for Solo
107 stars 10 forks source link

Some responses to GET DATA are not properly wrapped #11

Open conorpp opened 4 years ago

conorpp commented 4 years ago

For constructed DO GET DATA requests, it looks like the replies should be 1 single constructed DO/TLV.

Some examples:

Currently looks like:

>> GET DATA [CA] var. Application Related Data. [006e]
<< 
    5-16. Full AID. [004f]: d2760001240102010005000031880000 (216 bytes total)

>> GET DATA [CA] var. Cardholder related data. [0065]
<< 
    0-39. Name. [005b]:  (9 bytes total)

Should be like this:

>> GET DATA [CA] var. Application Related Data. [006e]
<< 
    var. Application Related Data. [006e]: 
        5-16. Full AID. [004f]: d2760001240102010006086910620000
        0-15.  Historical bytes. [5f52]: 0073000080059000
        3. Optional general feature management. [7f74]: 
            RSA modulus. [0081]: 20
        var. Discretionary data objects. [0073]: 
            10. Extended capabilities. [00c0]: 3c00000004c000ff00ff
            var. Algorithm attributes signature. [00c1]: 010800001100
            var. Algorithm attributes decryption. [00c2]: 011000001100
            var. Algorithm attributes authentication. [00c3]: 011000001100
            7. PW status Bytes (PW1, PW1 max length, RC max length, PW3 max length, ...) [00c4]: 017f7f7f030003
            60. fingerprints, 20 bytes each for sig,dec,auth. [00c5]: 682626763c5676d3f13b9d5adf6990fc44fc439243eee30ef73bfd53e25cb0d1dae105de65de9c0407c3573447987972785915e1bd5c5f1fc3c313bb
            60. CA fingerprints, 20 bytes each. [00c6]: 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
            12. List of 3, 4-byte dates for pubkey pairs. [00cd]: 5dfcf74e5dfc0bbc5dfc0c54 (224 bytes total)

>> GET DATA [CA] var. Cardholder related data. [0065]
<< 
    var. Cardholder related data. [0065]: 
        0-39. Name. [005b]: 
        2-8. Language preferences. [5f2d]: 
        1. Sex. [5f35]: 39 (11 bytes total)
merlokk commented 4 years ago

wrapping not needs: https://gnupg.org/ftp/specs/OpenPGP-smart-card-application-3.4.pdf 7.2.6 GET DATA

wrapping can be switch on here: https://github.com/solokeys/openpgp/blob/master/src/filesystem.h#L47