Skip to content

Commit

Permalink
[update] Production certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
lpascal-ledger committed May 30, 2024
1 parent 60d4308 commit bb215c6
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 31 deletions.
Binary file modified attestations/data/prod/FIDO2/flex-cert.der
Binary file not shown.
Binary file modified attestations/data/prod/U2F/flex-cert.der
Binary file not shown.
10 changes: 5 additions & 5 deletions attestations/data/prod/ca-cert.pem
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-----BEGIN CERTIFICATE-----
MIIBgTCCAScCFBlo0s5QYFdXbfusRdQeoLX6QenlMAoGCCqGSM49BAMCMEMxCzAJ
MIIBgTCCAScCFFM1QCDXg122F9cvWFVmqeGX3tQWMAoGCCqGSM49BAMCMEMxCzAJ
BgNVBAYTAkZSMQ8wDQYDVQQKDAZMZWRnZXIxIzAhBgNVBAMMGkxlZGdlciBGSURP
IEF0dGVzdGF0aW9uIENBMB4XDTIzMDIyMzEwMzMwOFoXDTMzMDIyMDEwMzMwOFow
IEF0dGVzdGF0aW9uIENBMB4XDTI0MDUzMDE0MTk0MFoXDTM0MDUyODE0MTk0MFow
QzELMAkGA1UEBhMCRlIxDzANBgNVBAoMBkxlZGdlcjEjMCEGA1UEAwwaTGVkZ2Vy
IEZJRE8gQXR0ZXN0YXRpb24gQ0EwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATK
7nXyH4pgN3TMwCWSoMDRe4EV8Jl3XzuhicZ/2gvh+zz3WmW0OZ/EcRYEA8F26cee
uMcd21WQRRKWpjWD+JWiMAoGCCqGSM49BAMCA0gAMEUCIQCwcsHuL8ZFL3FNyU/D
OQn3bmx08lnn0O5RktLbOnoPHQIgOEi6ImAZ181q8RJiL0hbw7ZquuniRq6fjWjG
oBu1Moo=
uMcd21WQRRKWpjWD+JWiMAoGCCqGSM49BAMCA0gAMEUCIQD8J+0/b8PeYjFRQYkU
Rcqhax27olw1jY/pbskhBuRp4AIgOAHb6n+7fNffyoxpeCq3VZ7B1jN3wqmPNfna
eAjdoXs=
-----END CERTIFICATE-----
19 changes: 15 additions & 4 deletions attestations/generateCryptoData.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


parser = argparse.ArgumentParser()
parser.add_argument('env', type=str, help='CA, key and cert env')
parser.add_argument('env', type=str, help='CA, key and cert env', choices=["test", "prod"])
parser.add_argument('version', type=str, help='target protocol version', choices=["U2F", "FIDO2"])
parser.add_argument('model', type=str, help='device model')

Expand Down Expand Up @@ -46,9 +46,19 @@
key_line_2 = " " + ", ".join(["0x{}".format(x) for x in key_bytes[16:]])
key_data = ",\n".join([key_line_1, key_line_2])

key = attestation_key_prefix.format(env, version, model) \
+ " {\n" + key_data + "};"
print(key)
if env == "PROD":
print("What needs to be copy-pasted into Jenkins credentials:")
print("-"*100)
print(key_data.strip().replace(" ", "").replace("\n", ""))
print("-"*100)
print("What needs to be copy-pasted into `crypto_data.h`:")
print("-"*100)
else:
print("What needs to be copy-pasted into `crypto_data.h`:")
print("-"*100)
key = attestation_key_prefix.format(env, version, model) \
+ " {\n" + key_data + "};"
print(key)

# Generate ATTESTATION_CERT
with open(cert_file, 'rb') as f:
Expand All @@ -68,3 +78,4 @@
cert = attestation_cert_prefix.format(env, version, model) \
+ " {\n" + cert_data + "};"
print(cert)
print("-"*100)
44 changes: 22 additions & 22 deletions include/crypto_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -640,16 +640,16 @@ static const uint8_t TEST_FIDO2_STAX_ATTESTATION_CERT[] = {
static const uint8_t PROD_U2F_FLEX_ATTESTATION_KEY[] = {PROD_U2F_FLEX_PRIVATE_KEY};
#endif
static const uint8_t PROD_U2F_FLEX_ATTESTATION_CERT[] = {
0x30, 0x82, 0x01, 0xce, 0x30, 0x82, 0x01, 0x75, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x07,
0x68, 0x7b, 0xad, 0x3a, 0x2c, 0x16, 0xb0, 0x33, 0x90, 0x78, 0x7a, 0x16, 0x34, 0x6d, 0x9d, 0x73,
0x6f, 0x22, 0x23, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30,
0x30, 0x82, 0x01, 0xce, 0x30, 0x82, 0x01, 0x75, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x01,
0x36, 0x08, 0x41, 0x58, 0xa9, 0x13, 0x01, 0x21, 0x26, 0x17, 0x65, 0x9b, 0x4c, 0x82, 0xc7, 0x76,
0x88, 0x23, 0x66, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30,
0x43, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x46, 0x52, 0x31, 0x0f,
0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x06, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x31,
0x23, 0x30, 0x21, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1a, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72,
0x20, 0x46, 0x49, 0x44, 0x4f, 0x20, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x35, 0x31, 0x36, 0x30, 0x39,
0x31, 0x33, 0x31, 0x39, 0x5a, 0x17, 0x0d, 0x33, 0x34, 0x30, 0x35, 0x31, 0x34, 0x30, 0x39, 0x31,
0x33, 0x31, 0x39, 0x5a, 0x30, 0x73, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
0x6e, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x35, 0x33, 0x30, 0x31, 0x34,
0x31, 0x39, 0x34, 0x33, 0x5a, 0x17, 0x0d, 0x33, 0x34, 0x30, 0x35, 0x32, 0x38, 0x31, 0x34, 0x31,
0x39, 0x34, 0x33, 0x5a, 0x30, 0x73, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
0x02, 0x46, 0x52, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x06, 0x4c, 0x65,
0x64, 0x67, 0x65, 0x72, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x19, 0x41,
0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x41, 0x74, 0x74,
Expand All @@ -665,28 +665,28 @@ static const uint8_t PROD_U2F_FLEX_ATTESTATION_CERT[] = {
0xc6, 0xea, 0x5f, 0x4a, 0xa3, 0x17, 0x30, 0x15, 0x30, 0x13, 0x06, 0x0b, 0x2b, 0x06, 0x01, 0x04,
0x01, 0x82, 0xe5, 0x1c, 0x02, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x04, 0x30, 0x30, 0x0a, 0x06,
0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20,
0x40, 0x02, 0xe5, 0xe2, 0xd1, 0x64, 0x88, 0x90, 0x2d, 0x36, 0xf5, 0xb2, 0x77, 0x83, 0xc2, 0x90,
0x25, 0x1e, 0x5f, 0xb5, 0xcf, 0x2e, 0xa8, 0x5d, 0x68, 0xa9, 0x8f, 0xdb, 0xcd, 0x8e, 0x5e, 0x6a,
0x02, 0x20, 0x26, 0xdd, 0x62, 0x08, 0xed, 0x59, 0xcf, 0x48, 0xa4, 0x1e, 0xcd, 0x3d, 0x09, 0xc8,
0xfd, 0xfd, 0x46, 0xf5, 0x06, 0x8e, 0xf5, 0x04, 0x02, 0x1e, 0x20, 0xc9, 0x1a, 0xb3, 0x3b, 0x2a,
0xaa, 0x95};
0x00, 0x91, 0xa2, 0x44, 0x50, 0x97, 0x51, 0x89, 0xd1, 0x34, 0x1b, 0xe4, 0x32, 0x0c, 0xca, 0xfd,
0x40, 0x96, 0xe9, 0x0a, 0xc5, 0x3a, 0xd4, 0xfc, 0x4a, 0xf4, 0x9c, 0xe2, 0xcf, 0x06, 0xca, 0x8a,
0x02, 0x20, 0x27, 0x3c, 0xd9, 0x29, 0xd0, 0xa7, 0x0b, 0xa7, 0xfc, 0x6c, 0xf5, 0x9e, 0x9f, 0xaa,
0x0e, 0x35, 0x57, 0x6e, 0x3c, 0x9e, 0xd6, 0x8b, 0xc3, 0x49, 0xfd, 0x81, 0x35, 0xa7, 0x80, 0x31,
0x93, 0x4f};

/* FIDO2 PROD env */
#if defined(PROD_FIDO2_FLEX_PRIVATE_KEY)
static const uint8_t PROD_FIDO2_FLEX_ATTESTATION_KEY[] = {PROD_FIDO2_FLEX_PRIVATE_KEY};
#endif

static const uint8_t PROD_FIDO2_FLEX_ATTESTATION_CERT[] = {
0x30, 0x82, 0x01, 0xeb, 0x30, 0x82, 0x01, 0x91, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x7e,
0xbc, 0xf5, 0xf9, 0xc1, 0xd2, 0x9f, 0x87, 0x8e, 0xe0, 0x97, 0xd9, 0x55, 0xd6, 0x60, 0x3b, 0x52,
0xc8, 0x7d, 0xf8, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30,
0x30, 0x82, 0x01, 0xea, 0x30, 0x82, 0x01, 0x91, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x14, 0x3b,
0x7e, 0x8c, 0x41, 0x7e, 0xb6, 0xfb, 0x0f, 0x07, 0xee, 0x2c, 0x5e, 0x86, 0x46, 0xea, 0x7e, 0xc1,
0x75, 0x15, 0x32, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30,
0x43, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x46, 0x52, 0x31, 0x0f,
0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x06, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72, 0x31,
0x23, 0x30, 0x21, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0c, 0x1a, 0x4c, 0x65, 0x64, 0x67, 0x65, 0x72,
0x20, 0x46, 0x49, 0x44, 0x4f, 0x20, 0x41, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x35, 0x31, 0x36, 0x30, 0x39,
0x31, 0x33, 0x31, 0x37, 0x5a, 0x17, 0x0d, 0x33, 0x34, 0x30, 0x35, 0x31, 0x34, 0x30, 0x39, 0x31,
0x33, 0x31, 0x37, 0x5a, 0x30, 0x73, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
0x6e, 0x20, 0x43, 0x41, 0x30, 0x1e, 0x17, 0x0d, 0x32, 0x34, 0x30, 0x35, 0x33, 0x30, 0x31, 0x34,
0x31, 0x39, 0x34, 0x31, 0x5a, 0x17, 0x0d, 0x33, 0x34, 0x30, 0x35, 0x32, 0x38, 0x31, 0x34, 0x31,
0x39, 0x34, 0x31, 0x5a, 0x30, 0x73, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
0x02, 0x46, 0x52, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x0c, 0x06, 0x4c, 0x65,
0x64, 0x67, 0x65, 0x72, 0x31, 0x22, 0x30, 0x20, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x0c, 0x19, 0x41,
0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x20, 0x41, 0x74, 0x74,
Expand All @@ -703,11 +703,11 @@ static const uint8_t PROD_FIDO2_FLEX_ATTESTATION_CERT[] = {
0x01, 0x82, 0xe5, 0x1c, 0x01, 0x01, 0x04, 0x04, 0x12, 0x04, 0x10, 0x1d, 0x8c, 0xac, 0x46, 0x47,
0xa1, 0x33, 0x86, 0xaf, 0x50, 0xe8, 0x8a, 0xe4, 0x6f, 0xe8, 0x02, 0x30, 0x0c, 0x06, 0x03, 0x55,
0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48,
0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30, 0x45, 0x02, 0x21, 0x00, 0xc6, 0x8a, 0xf1,
0xf7, 0x9a, 0x87, 0x7a, 0xe1, 0xb5, 0xc5, 0x0b, 0x2f, 0xd2, 0x0a, 0xd5, 0x03, 0xf1, 0xe2, 0x3f,
0xbc, 0x88, 0x0a, 0x97, 0xd4, 0xf7, 0xb9, 0x17, 0x55, 0x5c, 0x27, 0xc5, 0xb3, 0x02, 0x20, 0x6a,
0xdd, 0xe5, 0x8d, 0x46, 0x98, 0x45, 0x1f, 0x13, 0x80, 0x02, 0x44, 0xb8, 0x5d, 0x14, 0x12, 0x9f,
0x82, 0xab, 0x10, 0x58, 0xab, 0x38, 0x9d, 0x7c, 0x1b, 0x6b, 0xde, 0xd3, 0x81, 0x02, 0xe0};
0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x4b, 0xb1, 0x2d, 0x24,
0x61, 0x39, 0x86, 0x92, 0x0f, 0xa8, 0x13, 0xf4, 0x84, 0x00, 0xd8, 0x06, 0x96, 0xa4, 0x5b, 0x96,
0x40, 0x2f, 0x65, 0xef, 0xa6, 0x47, 0x07, 0x71, 0xf7, 0x05, 0xa9, 0x2f, 0x02, 0x20, 0x33, 0xbc,
0xe3, 0x73, 0x19, 0x7d, 0x7b, 0x6d, 0xf6, 0x86, 0x38, 0x94, 0x6a, 0xcf, 0x00, 0x66, 0x8f, 0x31,
0xd4, 0x4d, 0x4b, 0x7d, 0x84, 0xd4, 0xa6, 0x80, 0x54, 0x7c, 0xe1, 0x2e, 0x78, 0x5c};

/* U2F TEST env */
static const uint8_t TEST_U2F_FLEX_ATTESTATION_KEY[] = {
Expand Down

0 comments on commit bb215c6

Please sign in to comment.