Skip to content

Commit ffa84a6

Browse files
committed
Revert RSA public exponent change from #474
1 parent 68d4038 commit ffa84a6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
NEWS for Libp11 -- History of user visible changes
22

33
New in 0.4.17; unreleased
4+
* Reverted RSA public exponent change from #474 (Michał Trojnara)
45

56
New in 0.4.16; 2025-06-23; Michał Trojnara
67
* Fixed PKCS#11 module synchronization setup that was broken

src/p11_key.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ int pkcs11_rsa_keygen(PKCS11_SLOT_private *slot, unsigned int bits,
332332
CKM_RSA_PKCS_KEY_PAIR_GEN, NULL_PTR, 0
333333
};
334334
CK_ULONG num_bits = bits;
335-
CK_BYTE public_exponent[] = { 1, 0, 0, 0, 1 };
335+
CK_BYTE public_exponent[] = { 1, 0, 1 };
336336
CK_OBJECT_HANDLE pub_key_obj, priv_key_obj;
337337
int rv;
338338

@@ -344,7 +344,8 @@ int pkcs11_rsa_keygen(PKCS11_SLOT_private *slot, unsigned int bits,
344344
pkcs11_common_pubkey_attr(&pubtmpl, label, id, id_len);
345345
pkcs11_addattr_bool(&pubtmpl, CKA_ENCRYPT, TRUE);
346346
pkcs11_addattr_var(&pubtmpl, CKA_MODULUS_BITS, num_bits);
347-
pkcs11_addattr(&pubtmpl, CKA_PUBLIC_EXPONENT, public_exponent, 5);
347+
pkcs11_addattr(&pubtmpl, CKA_PUBLIC_EXPONENT,
348+
public_exponent, sizeof public_exponent);
348349

349350
/* privkey attributes */
350351
pkcs11_common_privkey_attr(&privtmpl, label, id, id_len, params);

0 commit comments

Comments
 (0)