Skip to content

Commit

Permalink
include: Create sw_code.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed May 2, 2024
1 parent 21787a5 commit aaa8e6d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
27 changes: 27 additions & 0 deletions include/sw_code.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
*******************************************************************************
* Ledger App Security Key
* (c) 2024 Ledger
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
********************************************************************************/

#define SW_NO_ERROR 0x9000
#define SW_MORE_DATA 0x6100
#define SW_WRONG_LENGTH 0x6700
#define SW_CONDITIONS_NOT_SATISFIED 0x6985
#define SW_WRONG_DATA 0x6A80
#define SW_INCORRECT_P1P2 0x6A86
#define SW_INS_NOT_SUPPORTED 0x6D00
#define SW_CLA_NOT_SUPPORTED 0x6E00
#define SW_PROPRIETARY_INTERNAL 0x6FFF
3 changes: 1 addition & 2 deletions src/ctap2_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
#include "globals.h"
#include "fido_known_apps.h"
#include "ui_shared.h"

#define SW_NO_ERROR 0x9000
#include "sw_code.h"

#define RPID_FILTER "webctap."
#define RPID_FILTER_SIZE (sizeof(RPID_FILTER) - 1)
Expand Down
10 changes: 1 addition & 9 deletions src/u2f_processing.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "globals.h"
#include "fido_known_apps.h"
#include "ctap2.h"
#include "sw_code.h"

#define U2F_VERSION "U2F_V2"
#define U2F_VERSION_SIZE (sizeof(U2F_VERSION) - 1)
Expand All @@ -57,15 +58,6 @@
#define P1_U2F_REQUEST_USER_PRESENCE 0x03
#define P1_U2F_OPTIONAL_USER_PRESENCE 0x08

#define SW_NO_ERROR 0x9000
#define SW_WRONG_LENGTH 0x6700
#define SW_CONDITIONS_NOT_SATISFIED 0x6985
#define SW_WRONG_DATA 0x6A80
#define SW_INCORRECT_P1P2 0x6A86
#define SW_INS_NOT_SUPPORTED 0x6D00
#define SW_CLA_NOT_SUPPORTED 0x6E00
#define SW_PROPRIETARY_INTERNAL 0x6FFF

#define U2F_ENROLL_RESERVED 0x05
static const uint8_t DUMMY_ZERO[] = {0x00};
#define SIGN_USER_PRESENCE_MASK 0x01
Expand Down

0 comments on commit aaa8e6d

Please sign in to comment.