Skip to content

Commit 76e8c1b

Browse files
Change key types to a 16-bit encoding
All key types now have an encoding on 32 bits where the bottom 16 bits are zero. Change to using 16 bits only. Keep 32 bits for key types in storage, but move the significant half-word from the top to the bottom. Likewise, change EC curve and DH group families from 32 bits out of which the top 8 and bottom 16 bits are zero, to 8 bits only. Reorder psa_core_key_attributes_t to avoid padding.
1 parent 823a5ff commit 76e8c1b

12 files changed

+67
-67
lines changed

include/psa/crypto_extra.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ psa_status_t mbedtls_psa_inject_entropy(const uint8_t *seed,
329329
* string. The length of the byte string is the length of the base prime `p`
330330
* in bytes.
331331
*/
332-
#define PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t)0x60040000)
332+
#define PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t)0x6004)
333333

334334
/** DSA key pair (private and public key).
335335
*
@@ -347,7 +347,7 @@ psa_status_t mbedtls_psa_inject_entropy(const uint8_t *seed,
347347
* Add 1 to the resulting integer and use this as the private key *x*.
348348
*
349349
*/
350-
#define PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t)0x70040000)
350+
#define PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t)0x7004)
351351

352352
/** Whether a key type is an DSA key (pair or public-only). */
353353
#define PSA_KEY_TYPE_IS_DSA(type) \
@@ -418,9 +418,7 @@ psa_status_t mbedtls_psa_inject_entropy(const uint8_t *seed,
418418
* #PSA_KEY_TYPE_DH_KEY_PAIR(#PSA_DH_GROUP_CUSTOM), the group data comes
419419
* from domain parameters set by psa_set_key_domain_parameters().
420420
*/
421-
/* This value is a deprecated value meaning an explicit curve in the IANA
422-
* registry. */
423-
#define PSA_DH_GROUP_CUSTOM ((psa_dh_group_t) 0xff01)
421+
#define PSA_DH_GROUP_CUSTOM ((psa_dh_group_t) 0x80)
424422

425423

426424
/**

include/psa/crypto_struct.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,14 @@ typedef uint16_t psa_key_attributes_flag_t;
330330
typedef struct
331331
{
332332
psa_key_type_t type;
333+
psa_key_bits_t bits;
333334
psa_key_lifetime_t lifetime;
334335
psa_key_id_t id;
335336
psa_key_policy_t policy;
336-
psa_key_bits_t bits;
337337
psa_key_attributes_flag_t flags;
338338
} psa_core_key_attributes_t;
339339

340-
#define PSA_CORE_KEY_ATTRIBUTES_INIT {0, 0, PSA_KEY_ID_INIT, PSA_KEY_POLICY_INIT, 0, 0}
340+
#define PSA_CORE_KEY_ATTRIBUTES_INIT {PSA_KEY_TYPE_NONE, 0, PSA_KEY_LIFETIME_VOLATILE, PSA_KEY_ID_INIT, PSA_KEY_POLICY_INIT, 0}
341341

342342
struct psa_key_attributes_s
343343
{

include/psa/crypto_types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,23 @@ typedef int32_t psa_status_t;
6363

6464
/** \brief Encoding of a key type.
6565
*/
66-
typedef uint32_t psa_key_type_t;
66+
typedef uint16_t psa_key_type_t;
6767

6868
/** The type of PSA elliptic curve family identifiers.
6969
*
7070
* The curve identifier is required to create an ECC key using the
7171
* PSA_KEY_TYPE_ECC_KEY_PAIR() or PSA_KEY_TYPE_ECC_PUBLIC_KEY()
7272
* macros.
7373
*/
74-
typedef uint32_t psa_ecc_curve_t;
74+
typedef uint8_t psa_ecc_curve_t;
7575

7676
/** The type of PSA Diffie-Hellman group family identifiers.
7777
*
7878
* The group identifier is required to create an Diffie-Hellman key using the
7979
* PSA_KEY_TYPE_DH_KEY_PAIR() or PSA_KEY_TYPE_DH_PUBLIC_KEY()
8080
* macros.
8181
*/
82-
typedef uint32_t psa_dh_group_t;
82+
typedef uint8_t psa_dh_group_t;
8383

8484
/** \brief Encoding of a cryptographic algorithm.
8585
*

include/psa/crypto_values.h

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@
282282
*
283283
* Zero is not the encoding of any key type.
284284
*/
285-
#define PSA_KEY_TYPE_NONE ((psa_key_type_t)0x00000000)
285+
#define PSA_KEY_TYPE_NONE ((psa_key_type_t)0x0000)
286286

287287
/** Vendor-defined key type flag.
288288
*
@@ -291,15 +291,15 @@
291291
* must use an encoding with the #PSA_KEY_TYPE_VENDOR_FLAG bit set and should
292292
* respect the bitwise structure used by standard encodings whenever practical.
293293
*/
294-
#define PSA_KEY_TYPE_VENDOR_FLAG ((psa_key_type_t)0x80000000)
294+
#define PSA_KEY_TYPE_VENDOR_FLAG ((psa_key_type_t)0x8000)
295295

296-
#define PSA_KEY_TYPE_CATEGORY_MASK ((psa_key_type_t)0x70000000)
297-
#define PSA_KEY_TYPE_CATEGORY_SYMMETRIC ((psa_key_type_t)0x40000000)
298-
#define PSA_KEY_TYPE_CATEGORY_RAW ((psa_key_type_t)0x50000000)
299-
#define PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY ((psa_key_type_t)0x60000000)
300-
#define PSA_KEY_TYPE_CATEGORY_KEY_PAIR ((psa_key_type_t)0x70000000)
296+
#define PSA_KEY_TYPE_CATEGORY_MASK ((psa_key_type_t)0x7000)
297+
#define PSA_KEY_TYPE_CATEGORY_SYMMETRIC ((psa_key_type_t)0x4000)
298+
#define PSA_KEY_TYPE_CATEGORY_RAW ((psa_key_type_t)0x5000)
299+
#define PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY ((psa_key_type_t)0x6000)
300+
#define PSA_KEY_TYPE_CATEGORY_KEY_PAIR ((psa_key_type_t)0x7000)
301301

302-
#define PSA_KEY_TYPE_CATEGORY_FLAG_PAIR ((psa_key_type_t)0x10000000)
302+
#define PSA_KEY_TYPE_CATEGORY_FLAG_PAIR ((psa_key_type_t)0x1000)
303303

304304
/** Whether a key type is vendor-defined.
305305
*
@@ -313,7 +313,7 @@
313313
* This encompasses both symmetric keys and non-key data.
314314
*/
315315
#define PSA_KEY_TYPE_IS_UNSTRUCTURED(type) \
316-
(((type) & PSA_KEY_TYPE_CATEGORY_MASK & ~(psa_key_type_t)0x10000000) == \
316+
(((type) & PSA_KEY_TYPE_CATEGORY_MASK & ~(psa_key_type_t)0x1000) == \
317317
PSA_KEY_TYPE_CATEGORY_SYMMETRIC)
318318

319319
/** Whether a key type is asymmetric: either a key pair or a public key. */
@@ -357,7 +357,7 @@
357357
*
358358
* A "key" of this type cannot be used for any cryptographic operation.
359359
* Applications may use this type to store arbitrary data in the keystore. */
360-
#define PSA_KEY_TYPE_RAW_DATA ((psa_key_type_t)0x50010000)
360+
#define PSA_KEY_TYPE_RAW_DATA ((psa_key_type_t)0x5001)
361361

362362
/** HMAC key.
363363
*
@@ -367,21 +367,21 @@
367367
* HMAC keys should generally have the same size as the underlying hash.
368368
* This size can be calculated with #PSA_HASH_SIZE(\c alg) where
369369
* \c alg is the HMAC algorithm or the underlying hash algorithm. */
370-
#define PSA_KEY_TYPE_HMAC ((psa_key_type_t)0x51000000)
370+
#define PSA_KEY_TYPE_HMAC ((psa_key_type_t)0x5100)
371371

372372
/** A secret for key derivation.
373373
*
374374
* The key policy determines which key derivation algorithm the key
375375
* can be used for.
376376
*/
377-
#define PSA_KEY_TYPE_DERIVE ((psa_key_type_t)0x52000000)
377+
#define PSA_KEY_TYPE_DERIVE ((psa_key_type_t)0x5200)
378378

379379
/** Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.
380380
*
381381
* The size of the key can be 16 bytes (AES-128), 24 bytes (AES-192) or
382382
* 32 bytes (AES-256).
383383
*/
384-
#define PSA_KEY_TYPE_AES ((psa_key_type_t)0x44020000)
384+
#define PSA_KEY_TYPE_AES ((psa_key_type_t)0x4402)
385385

386386
/** Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).
387387
*
@@ -392,17 +392,17 @@
392392
* deprecated and should only be used to decrypt legacy data. 3-key 3DES
393393
* is weak and deprecated and should only be used in legacy protocols.
394394
*/
395-
#define PSA_KEY_TYPE_DES ((psa_key_type_t)0x43020000)
395+
#define PSA_KEY_TYPE_DES ((psa_key_type_t)0x4302)
396396

397397
/** Key for a cipher, AEAD or MAC algorithm based on the
398398
* Camellia block cipher. */
399-
#define PSA_KEY_TYPE_CAMELLIA ((psa_key_type_t)0x44040000)
399+
#define PSA_KEY_TYPE_CAMELLIA ((psa_key_type_t)0x4404)
400400

401401
/** Key for the RC4 stream cipher.
402402
*
403403
* Note that RC4 is weak and deprecated and should only be used in
404404
* legacy protocols. */
405-
#define PSA_KEY_TYPE_ARC4 ((psa_key_type_t)0x40020000)
405+
#define PSA_KEY_TYPE_ARC4 ((psa_key_type_t)0x4002)
406406

407407
/** Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
408408
*
@@ -411,19 +411,19 @@
411411
* Implementations must support 12-byte nonces, may support 8-byte nonces,
412412
* and should reject other sizes.
413413
*/
414-
#define PSA_KEY_TYPE_CHACHA20 ((psa_key_type_t)0x40040000)
414+
#define PSA_KEY_TYPE_CHACHA20 ((psa_key_type_t)0x4004)
415415

416416
/** RSA public key. */
417-
#define PSA_KEY_TYPE_RSA_PUBLIC_KEY ((psa_key_type_t)0x60020000)
417+
#define PSA_KEY_TYPE_RSA_PUBLIC_KEY ((psa_key_type_t)0x6002)
418418
/** RSA key pair (private and public key). */
419-
#define PSA_KEY_TYPE_RSA_KEY_PAIR ((psa_key_type_t)0x70020000)
419+
#define PSA_KEY_TYPE_RSA_KEY_PAIR ((psa_key_type_t)0x7002)
420420
/** Whether a key type is an RSA key (pair or public-only). */
421421
#define PSA_KEY_TYPE_IS_RSA(type) \
422422
(PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type) == PSA_KEY_TYPE_RSA_PUBLIC_KEY)
423423

424-
#define PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE ((psa_key_type_t)0x61000000)
425-
#define PSA_KEY_TYPE_ECC_KEY_PAIR_BASE ((psa_key_type_t)0x71000000)
426-
#define PSA_KEY_TYPE_ECC_CURVE_MASK ((psa_key_type_t)0x00ffffff)
424+
#define PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE ((psa_key_type_t)0x6100)
425+
#define PSA_KEY_TYPE_ECC_KEY_PAIR_BASE ((psa_key_type_t)0x7100)
426+
#define PSA_KEY_TYPE_ECC_CURVE_MASK ((psa_key_type_t)0x00ff)
427427
/** Elliptic curve key pair.
428428
*
429429
* \param curve A value of type ::psa_ecc_curve_t that identifies the
@@ -466,7 +466,7 @@
466466
* _SEC 2: Recommended Elliptic Curve Domain Parameters_.
467467
* https://www.secg.org/sec2-v2.pdf
468468
*/
469-
#define PSA_ECC_CURVE_SECP_K1 ((psa_ecc_curve_t) 0x160000)
469+
#define PSA_ECC_CURVE_SECP_K1 ((psa_ecc_curve_t) 0x16)
470470

471471
/** SEC random curves over prime fields.
472472
*
@@ -476,9 +476,9 @@
476476
* _SEC 2: Recommended Elliptic Curve Domain Parameters_.
477477
* https://www.secg.org/sec2-v2.pdf
478478
*/
479-
#define PSA_ECC_CURVE_SECP_R1 ((psa_ecc_curve_t) 0x120000)
479+
#define PSA_ECC_CURVE_SECP_R1 ((psa_ecc_curve_t) 0x12)
480480
/* SECP160R2 (SEC2 v1, obsolete) */
481-
#define PSA_ECC_CURVE_SECP_R2 ((psa_ecc_curve_t) 0x1a0000)
481+
#define PSA_ECC_CURVE_SECP_R2 ((psa_ecc_curve_t) 0x1a)
482482

483483
/** SEC Koblitz curves over binary fields.
484484
*
@@ -488,7 +488,7 @@
488488
* _SEC 2: Recommended Elliptic Curve Domain Parameters_.
489489
* https://www.secg.org/sec2-v2.pdf
490490
*/
491-
#define PSA_ECC_CURVE_SECT_K1 ((psa_ecc_curve_t) 0x260000)
491+
#define PSA_ECC_CURVE_SECT_K1 ((psa_ecc_curve_t) 0x26)
492492

493493
/** SEC random curves over binary fields.
494494
*
@@ -498,7 +498,7 @@
498498
* _SEC 2: Recommended Elliptic Curve Domain Parameters_.
499499
* https://www.secg.org/sec2-v2.pdf
500500
*/
501-
#define PSA_ECC_CURVE_SECT_R1 ((psa_ecc_curve_t) 0x220000)
501+
#define PSA_ECC_CURVE_SECT_R1 ((psa_ecc_curve_t) 0x22)
502502

503503
/** SEC additional random curves over binary fields.
504504
*
@@ -508,7 +508,7 @@
508508
* _SEC 2: Recommended Elliptic Curve Domain Parameters_.
509509
* https://www.secg.org/sec2-v2.pdf
510510
*/
511-
#define PSA_ECC_CURVE_SECT_R2 ((psa_ecc_curve_t) 0x2a0000)
511+
#define PSA_ECC_CURVE_SECT_R2 ((psa_ecc_curve_t) 0x2a)
512512

513513
/** Brainpool P random curves.
514514
*
@@ -517,7 +517,7 @@
517517
* brainpoolP320r1, brainpoolP384r1, brainpoolP512r1.
518518
* It is defined in RFC 5639.
519519
*/
520-
#define PSA_ECC_CURVE_BRAINPOOL_P_R1 ((psa_ecc_curve_t) 0x300000)
520+
#define PSA_ECC_CURVE_BRAINPOOL_P_R1 ((psa_ecc_curve_t) 0x30)
521521

522522
/** Curve25519 and Curve448.
523523
*
@@ -529,11 +529,11 @@
529529
* _Ed448-Goldilocks, a new elliptic curve_, NIST ECC Workshop, 2015.
530530
* The algorithm #PSA_ALG_ECDH performs X448 when used with this curve.
531531
*/
532-
#define PSA_ECC_CURVE_XED ((psa_ecc_curve_t) 0x400000)
532+
#define PSA_ECC_CURVE_XED ((psa_ecc_curve_t) 0x40)
533533

534-
#define PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE ((psa_key_type_t)0x62000000)
535-
#define PSA_KEY_TYPE_DH_KEY_PAIR_BASE ((psa_key_type_t)0x72000000)
536-
#define PSA_KEY_TYPE_DH_GROUP_MASK ((psa_key_type_t)0x00ffffff)
534+
#define PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE ((psa_key_type_t)0x6200)
535+
#define PSA_KEY_TYPE_DH_KEY_PAIR_BASE ((psa_key_type_t)0x7200)
536+
#define PSA_KEY_TYPE_DH_GROUP_MASK ((psa_key_type_t)0x00ff)
537537
/** Diffie-Hellman key pair.
538538
*
539539
* \param group A value of type ::psa_dh_group_t that identifies the
@@ -577,7 +577,7 @@
577577
#define PSA_DH_GROUP_RFC7919 ((psa_dh_group_t) 0x02)
578578

579579
#define PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT(type) \
580-
(((type) >> 24) & 7)
580+
(((type) >> 8) & 7)
581581
/** The block size of a block cipher.
582582
*
583583
* \param type A cipher key type (value of type #psa_key_type_t).

library/pkwrite.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ int mbedtls_pk_write_pubkey_der( mbedtls_pk_context *key, unsigned char *buf, si
282282
bits = psa_get_key_bits( &attributes );
283283
psa_reset_key_attributes( &attributes );
284284

285-
curve = PSA_KEY_TYPE_GET_CURVE( key_type ) & 0xff0000;
285+
curve = PSA_KEY_TYPE_GET_CURVE( key_type );
286286
if( curve == 0 )
287287
return( MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE );
288288

library/psa_crypto.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,6 @@ psa_ecc_curve_t mbedtls_ecc_group_to_psa( mbedtls_ecp_group_id grpid,
427427
mbedtls_ecp_group_id mbedtls_ecc_group_of_psa( psa_ecc_curve_t curve,
428428
size_t byte_length )
429429
{
430-
if( ( curve & 0xffff ) != 0 )
431-
{
432-
if( PSA_BITS_TO_BYTES( curve & 0xffff ) != byte_length )
433-
return( MBEDTLS_ECP_DP_NONE );
434-
}
435430
switch( curve )
436431
{
437432
case PSA_ECC_CURVE_SECP_R1:

library/psa_crypto_storage.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ typedef struct {
259259
uint8_t magic[PSA_KEY_STORAGE_MAGIC_HEADER_LENGTH];
260260
uint8_t version[4];
261261
uint8_t lifetime[sizeof( psa_key_lifetime_t )];
262-
uint8_t type[sizeof( psa_key_type_t )];
262+
uint8_t type[4]; /* Size=4 for a 2-byte type to keep the structure more
263+
* regular and aligned and to make potential future
264+
* extensibility easier. */
263265
uint8_t policy[sizeof( psa_key_policy_t )];
264266
uint8_t data_len[4];
265267
uint8_t key_data[];
@@ -276,7 +278,7 @@ void psa_format_key_data_for_storage( const uint8_t *data,
276278
memcpy( storage_format->magic, PSA_KEY_STORAGE_MAGIC_HEADER, PSA_KEY_STORAGE_MAGIC_HEADER_LENGTH );
277279
PUT_UINT32_LE( 0, storage_format->version, 0 );
278280
PUT_UINT32_LE( attr->lifetime, storage_format->lifetime, 0 );
279-
PUT_UINT32_LE( attr->type, storage_format->type, 0 );
281+
PUT_UINT32_LE( (uint32_t) attr->type, storage_format->type, 0 );
280282
PUT_UINT32_LE( attr->policy.usage, storage_format->policy, 0 );
281283
PUT_UINT32_LE( attr->policy.alg, storage_format->policy, sizeof( uint32_t ) );
282284
PUT_UINT32_LE( attr->policy.alg2, storage_format->policy, 2 * sizeof( uint32_t ) );
@@ -302,6 +304,7 @@ psa_status_t psa_parse_key_data_from_storage( const uint8_t *storage_data,
302304
const psa_persistent_key_storage_format *storage_format =
303305
(const psa_persistent_key_storage_format *)storage_data;
304306
uint32_t version;
307+
uint32_t type;
305308

306309
if( storage_data_length < sizeof(*storage_format) )
307310
return( PSA_ERROR_STORAGE_FAILURE );
@@ -332,7 +335,11 @@ psa_status_t psa_parse_key_data_from_storage( const uint8_t *storage_data,
332335
}
333336

334337
GET_UINT32_LE( attr->lifetime, storage_format->lifetime, 0 );
335-
GET_UINT32_LE( attr->type, storage_format->type, 0 );
338+
GET_UINT32_LE( type, storage_format->type, 0 );
339+
if( type <= (psa_key_type_t) -1 )
340+
attr->type = (psa_key_type_t) type;
341+
else
342+
return( PSA_ERROR_STORAGE_FAILURE );
336343
GET_UINT32_LE( attr->policy.usage, storage_format->policy, 0 );
337344
GET_UINT32_LE( attr->policy.alg, storage_format->policy, sizeof( uint32_t ) );
338345
GET_UINT32_LE( attr->policy.alg2, storage_format->policy, 2 * sizeof( uint32_t ) );

programs/psa/psa_constant_names.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static void append_with_curve(char **buffer, size_t buffer_size,
8080
curve_name, strlen(curve_name));
8181
} else {
8282
append_integer(buffer, buffer_size, required_size,
83-
"0x%04x", curve);
83+
"0x%02x", curve);
8484
}
8585
append(buffer, buffer_size, required_size, ")", 1);
8686
}
@@ -98,7 +98,7 @@ static void append_with_group(char **buffer, size_t buffer_size,
9898
group_name, strlen(group_name));
9999
} else {
100100
append_integer(buffer, buffer_size, required_size,
101-
"0x%04x", group);
101+
"0x%02x", group);
102102
}
103103
append(buffer, buffer_size, required_size, ")", 1);
104104
}
@@ -144,7 +144,7 @@ static int psa_snprint_ecc_curve(char *buffer, size_t buffer_size,
144144
{
145145
const char *name = psa_ecc_curve_name(curve);
146146
if (name == NULL) {
147-
return snprintf(buffer, buffer_size, "0x%04x", (unsigned) curve);
147+
return snprintf(buffer, buffer_size, "0x%02x", (unsigned) curve);
148148
} else {
149149
size_t length = strlen(name);
150150
if (length < buffer_size) {
@@ -161,7 +161,7 @@ static int psa_snprint_dh_group(char *buffer, size_t buffer_size,
161161
{
162162
const char *name = psa_dh_group_name(group);
163163
if (name == NULL) {
164-
return snprintf(buffer, buffer_size, "0x%04x", (unsigned) group);
164+
return snprintf(buffer, buffer_size, "0x%02x", (unsigned) group);
165165
} else {
166166
size_t length = strlen(name);
167167
if (length < buffer_size) {

scripts/generate_psa_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
default:
6262
%(key_type_code)s{
6363
return snprintf(buffer, buffer_size,
64-
"0x%%08lx", (unsigned long) type);
64+
"0x%%04x", (unsigned) type);
6565
}
6666
break;
6767
}

tests/scripts/test_psa_constant_names.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ def __init__(self):
7575
# Sets of names per type
7676
self.statuses = set(['PSA_SUCCESS'])
7777
self.algorithms = set(['0xffffffff'])
78-
self.ecc_curves = set(['0xffff'])
79-
self.dh_groups = set(['0xffff'])
80-
self.key_types = set(['0xffffffff'])
78+
self.ecc_curves = set(['0xff'])
79+
self.dh_groups = set(['0xff'])
80+
self.key_types = set(['0xffff'])
8181
self.key_usage_flags = set(['0x80000000'])
8282
# Hard-coded value for unknown algorithms
8383
self.hash_algorithms = set(['0x010000fe'])

0 commit comments

Comments
 (0)