Skip to content

Commit d89ebfe

Browse files
Ivan StepicIvan Stepic
authored andcommitted
Fix constness of key generation attributes
1 parent 97ee3ce commit d89ebfe

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/libp11-int.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ extern int pkcs11_generate_random(PKCS11_SLOT_private *, unsigned char *r, unsig
312312

313313
/* Generate and store a private key on the token */
314314
extern int pkcs11_rsa_keygen(PKCS11_SLOT_private *tpriv,
315-
unsigned int bits, char *label, unsigned char* id, size_t id_len);
315+
unsigned int bits, const char *label, unsigned char* id, size_t id_len);
316316

317317
extern int pkcs11_ec_keygen(PKCS11_SLOT_private *tpriv,
318-
const char *curve , char *label, unsigned char* id, size_t id_len);
318+
const char *curve , const char *label, unsigned char* id, size_t id_len);
319319

320320
/* Internal implementation of deprecated features */
321321

src/libp11.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ typedef struct PKCS11_kgen_attrs_st {
120120
PKCS11_EC_KGEN *ec;
121121
PKCS11_RSA_KGEN *rsa;
122122
} kgen;
123-
char *token_label;
124-
char *key_label;
125-
char *key_id;
123+
const char *token_label;
124+
const char *key_label;
125+
const char *key_id;
126126
} PKCS11_KGEN_ATTRS;
127127

128128
/**

src/p11_key.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ int pkcs11_reload_object(PKCS11_OBJECT_private *obj)
253253
* Generate a key pair directly on token
254254
*/
255255
int pkcs11_rsa_keygen(PKCS11_SLOT_private *slot, unsigned int bits,
256-
char *label, unsigned char* id, size_t id_len) {
256+
const char *label, unsigned char* id, size_t id_len) {
257257

258258
PKCS11_CTX_private *ctx = slot->ctx;
259259
CK_SESSION_HANDLE session;
@@ -309,7 +309,7 @@ int pkcs11_rsa_keygen(PKCS11_SLOT_private *slot, unsigned int bits,
309309
}
310310

311311
int pkcs11_ec_keygen(PKCS11_SLOT_private *slot, const char *curve,
312-
char *label, unsigned char *id, size_t id_len)
312+
const char *label, unsigned char *id, size_t id_len)
313313
{
314314
PKCS11_CTX_private *ctx = slot->ctx;
315315
CK_SESSION_HANDLE session;

0 commit comments

Comments
 (0)