Compare commits
3 Commits
nfc_confor
...
all-contri
Author | SHA1 | Date | |
---|---|---|---|
434c155a25 | |||
893898c5e7 | |||
83dd92d9ba |
@ -178,6 +178,15 @@
|
|||||||
"business",
|
"business",
|
||||||
"ideas"
|
"ideas"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"login": "oplik0",
|
||||||
|
"name": "Jakub",
|
||||||
|
"avatar_url": "https://avatars2.githubusercontent.com/u/25460763?v=4",
|
||||||
|
"profile": "https://github.com/oplik0",
|
||||||
|
"contributions": [
|
||||||
|
"bug"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"contributorsPerLine": 7,
|
"contributorsPerLine": 7,
|
||||||
|
@ -135,6 +135,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|||||||
<td align="center"><a href="https://github.com/m3hm00d"><img src="https://avatars1.githubusercontent.com/u/42179593?v=4" width="100px;" alt="f.m3hm00d"/><br /><sub><b>f.m3hm00d</b></sub></a><br /><a href="https://github.com/solokeys/solo/commits?author=m3hm00d" title="Documentation">📖</a></td>
|
<td align="center"><a href="https://github.com/m3hm00d"><img src="https://avatars1.githubusercontent.com/u/42179593?v=4" width="100px;" alt="f.m3hm00d"/><br /><sub><b>f.m3hm00d</b></sub></a><br /><a href="https://github.com/solokeys/solo/commits?author=m3hm00d" title="Documentation">📖</a></td>
|
||||||
<td align="center"><a href="http://blogs.gnome.org/hughsie/"><img src="https://avatars0.githubusercontent.com/u/151380?v=4" width="100px;" alt="Richard Hughes"/><br /><sub><b>Richard Hughes</b></sub></a><br /><a href="#ideas-hughsie" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/solokeys/solo/commits?author=hughsie" title="Code">💻</a> <a href="#infra-hughsie" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#tool-hughsie" title="Tools">🔧</a></td>
|
<td align="center"><a href="http://blogs.gnome.org/hughsie/"><img src="https://avatars0.githubusercontent.com/u/151380?v=4" width="100px;" alt="Richard Hughes"/><br /><sub><b>Richard Hughes</b></sub></a><br /><a href="#ideas-hughsie" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/solokeys/solo/commits?author=hughsie" title="Code">💻</a> <a href="#infra-hughsie" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#tool-hughsie" title="Tools">🔧</a></td>
|
||||||
<td align="center"><a href="http://www.schulz.dk"><img src="https://avatars1.githubusercontent.com/u/1150049?v=4" width="100px;" alt="Kim Schulz"/><br /><sub><b>Kim Schulz</b></sub></a><br /><a href="#business-kimusan" title="Business development">💼</a> <a href="#ideas-kimusan" title="Ideas, Planning, & Feedback">🤔</a></td>
|
<td align="center"><a href="http://www.schulz.dk"><img src="https://avatars1.githubusercontent.com/u/1150049?v=4" width="100px;" alt="Kim Schulz"/><br /><sub><b>Kim Schulz</b></sub></a><br /><a href="#business-kimusan" title="Business development">💼</a> <a href="#ideas-kimusan" title="Ideas, Planning, & Feedback">🤔</a></td>
|
||||||
|
<td align="center"><a href="https://github.com/oplik0"><img src="https://avatars2.githubusercontent.com/u/25460763?v=4" width="100px;" alt="Jakub"/><br /><sub><b>Jakub</b></sub></a><br /><a href="https://github.com/solokeys/solo/issues?q=author%3Aoplik0" title="Bug reports">🐛</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -168,7 +169,7 @@ You can buy Solo, Solo Tap, and Solo for Hackers at [solokeys.com](https://solok
|
|||||||
<br/>
|
<br/>
|
||||||
|
|
||||||
[](https://github.com/solokeys/solo/blob/master/LICENSE)
|
[](https://github.com/solokeys/solo/blob/master/LICENSE)
|
||||||
[](#contributors)
|
[](#contributors)
|
||||||
[](https://travis-ci.com/solokeys/solo)
|
[](https://travis-ci.com/solokeys/solo)
|
||||||
[](https://discourse.solokeys.com)
|
[](https://discourse.solokeys.com)
|
||||||
[](https://keybase.io/team/solokeys.public)
|
[](https://keybase.io/team/solokeys.public)
|
||||||
|
@ -1 +1 @@
|
|||||||
2.4.3
|
2.5.1
|
||||||
|
18
fido2/apdu.c
18
fido2/apdu.c
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "apdu.h"
|
#include "apdu.h"
|
||||||
|
|
||||||
uint16_t apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu)
|
int apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu)
|
||||||
{
|
{
|
||||||
EXT_APDU_HEADER *hapdu = (EXT_APDU_HEADER *)data;
|
EXT_APDU_HEADER *hapdu = (EXT_APDU_HEADER *)data;
|
||||||
|
|
||||||
@ -62,11 +62,6 @@ uint16_t apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu)
|
|||||||
if (len >= 7 && b0 == 0)
|
if (len >= 7 && b0 == 0)
|
||||||
{
|
{
|
||||||
uint16_t extlen = (hapdu->lc[1] << 8) + hapdu->lc[2];
|
uint16_t extlen = (hapdu->lc[1] << 8) + hapdu->lc[2];
|
||||||
|
|
||||||
if (len - 7 < extlen)
|
|
||||||
{
|
|
||||||
return SW_WRONG_LENGTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
// case 2E (Le) - extended
|
// case 2E (Le) - extended
|
||||||
if (len == 7)
|
if (len == 7)
|
||||||
@ -108,18 +103,9 @@ uint16_t apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu)
|
|||||||
apdu->le = 0x10000;
|
apdu->le = 0x10000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((len > 5) && (len - 5 < hapdu->lc[0]))
|
|
||||||
{
|
|
||||||
return SW_WRONG_LENGTH;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!apdu->case_type)
|
if (!apdu->case_type)
|
||||||
{
|
return 1;
|
||||||
return SW_COND_USE_NOT_SATISFIED;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (apdu->lc)
|
if (apdu->lc)
|
||||||
{
|
{
|
||||||
|
@ -36,7 +36,7 @@ typedef struct
|
|||||||
uint8_t case_type;
|
uint8_t case_type;
|
||||||
} __attribute__((packed)) APDU_STRUCT;
|
} __attribute__((packed)) APDU_STRUCT;
|
||||||
|
|
||||||
extern uint16_t apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu);
|
extern int apdu_decode(uint8_t *data, size_t len, APDU_STRUCT *apdu);
|
||||||
|
|
||||||
#define APDU_FIDO_U2F_REGISTER 0x01
|
#define APDU_FIDO_U2F_REGISTER 0x01
|
||||||
#define APDU_FIDO_U2F_AUTHENTICATE 0x02
|
#define APDU_FIDO_U2F_AUTHENTICATE 0x02
|
||||||
|
@ -784,10 +784,9 @@ void nfc_process_iblock(uint8_t * buf, int len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
APDU_STRUCT apdu;
|
APDU_STRUCT apdu;
|
||||||
uint16_t ret = apdu_decode(buf + block_offset, len - block_offset, &apdu);
|
if (apdu_decode(buf + block_offset, len - block_offset, &apdu)) {
|
||||||
if (ret != 0) {
|
|
||||||
printf1(TAG_NFC,"apdu decode error\r\n");
|
printf1(TAG_NFC,"apdu decode error\r\n");
|
||||||
nfc_write_response(buf[0], ret);
|
nfc_write_response(buf[0], SW_COND_USE_NOT_SATISFIED);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf1(TAG_NFC,"apdu ok. %scase=%02x cla=%02x ins=%02x p1=%02x p2=%02x lc=%d le=%d\r\n",
|
printf1(TAG_NFC,"apdu ok. %scase=%02x cla=%02x ins=%02x p1=%02x p2=%02x lc=%d le=%d\r\n",
|
||||||
|
Reference in New Issue
Block a user