-
Notifications
You must be signed in to change notification settings - Fork 16
/
errors.h
66 lines (51 loc) · 1.87 KB
/
errors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef H_CARDANO_APP_ERRORS
#define H_CARDANO_APP_ERRORS
enum {
// Successful responses
SUCCESS = 0x9000,
// Start of error which trigger automatic response
// Note that any such error will reset
// multi-APDU exchange
_ERR_AUTORESPOND_START = 0x6E00,
// Bad request header
ERR_MALFORMED_REQUEST_HEADER = 0x6E01,
// Unknown CLA
ERR_BAD_CLA = 0x6E02,
// Unknown INS
ERR_UNKNOWN_INS = 0x6E03,
// attempt to change INS while the current call was not finished
ERR_STILL_IN_CALL = 0x6E04,
// P1 or P2 is invalid
ERR_INVALID_REQUEST_PARAMETERS = 0x6E05,
// Request is not valid in the context of previous calls
ERR_INVALID_STATE = 0x6E06,
// Some part of request data is invalid (or unknown to this app)
// (includes not enough data and too much data)
ERR_INVALID_DATA = 0x6E07,
// previously used for rejected BIP44 paths, now we use ERR_REJECTED_BY_POLICY
// ERR_INVALID_BIP44_PATH = 0x6E08,
// User rejected the action
ERR_REJECTED_BY_USER = 0x6E09,
// Ledger security policy rejected the action
ERR_REJECTED_BY_POLICY = 0x6E10,
// Pin screen
ERR_DEVICE_LOCKED = 0x6E11,
// previously used for unsupported Shelley address types
// ERR_UNSUPPORTED_ADDRESS_TYPE = 0x6E12,
// end of errors which trigger automatic response
_ERR_AUTORESPOND_END = 0x6E13,
// Errors below SHOULD NOT be returned to the client
// Instead, leaking these to the main() scope
// means unexpected programming error
// and we should stop further processing
// to avoid exploits
// Internal errors
ERR_ASSERT = 0x4700,
ERR_NOT_IMPLEMENTED = 0x4701,
// stream
ERR_NOT_ENOUGH_INPUT = 0x4710,
ERR_DATA_TOO_LARGE = 0x4711,
// cbor
ERR_UNEXPECTED_TOKEN = 0x4720,
};
#endif // H_CARDANO_APP_ERRORS