Skip to content

Commit

Permalink
U2F: remove code related to U2F
Browse files Browse the repository at this point in the history
Since it is not authorized by the baking app
  • Loading branch information
spalmer25 committed Mar 5, 2024
1 parent ab9acf5 commit 626b1e6
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion doc/apdu.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ baking.
| `EXC_REFERENCED_DATA_NOT_FOUND` | 0x6A88 | Referenced data not found. |
| `EXC_WRONG_VALUES` | 0x6A80 | The parameters in the data field are incorrect. |
| `EXC_SECURITY` | 0x6982 | Security condition not satisfied. |
| `EXC_HID_REQUIRED` | 0x6983 | Authentication method blocked. |
| `EXC_CLASS` | 0x6E00 | Class not supported. |
| `EXC_MEMORY_ERROR` | 0x9200 | Memory error. |

Expand Down
8 changes: 0 additions & 8 deletions src/apdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ static inline bool delay_reject(void) {
return true;
}

static inline void require_permissioned_comm(void) {
/* U2F is dangerous for privacy because any open website
in the browser can use it silently if the app is opened.*/
if (G_io_apdu_media == IO_APDU_MEDIA_U2F) {
THROW(EXC_HID_REQUIRED);
}
}

size_t provide_pubkey(uint8_t* const io_buffer, cx_ecfp_public_key_t const* const pubkey);

size_t handle_apdu_error(uint8_t instruction, volatile uint32_t* flags);
Expand Down
5 changes: 0 additions & 5 deletions src/apdu_pubkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ size_t handle_apdu_get_public_key(uint8_t instruction, volatile uint32_t *flags)
THROW(EXC_WRONG_PARAM);
}

// do not expose pks without prompt through U2F (permissionless legacy comm in browser)
if (instruction == INS_GET_PUBLIC_KEY) {
require_permissioned_comm();
}

global.path_with_curve.derivation_type = parse_derivation_type(G_io_apdu_buffer[OFFSET_CURVE]);

size_t const cdata_size = G_io_apdu_buffer[OFFSET_LC];
Expand Down
1 change: 0 additions & 1 deletion src/exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#define EXC_REFERENCED_DATA_NOT_FOUND 0x6A88
#define EXC_WRONG_VALUES 0x6A80
#define EXC_SECURITY 0x6982
#define EXC_HID_REQUIRED 0x6983
#define EXC_CLASS 0x6E00
#define EXC_MEMORY_ERROR 0x9200

Expand Down

0 comments on commit 626b1e6

Please sign in to comment.