@@ -358,7 +358,7 @@ int UTIL_CTX_set_pin(UTIL_CTX *ctx, const char *pin)
358358 * passed to the user interface implemented by an application. Only the
359359 * application knows how to interpret the call-back data.
360360 * A (strdup'ed) copy of the PIN code will be stored in the pin variable. */
361- static int UTIL_CTX_get_pin (UTIL_CTX * ctx , const char * token_label )
361+ static int util_ctx_get_pin (UTIL_CTX * ctx , const char * token_label )
362362{
363363 UI * ui ;
364364 char * prompt ;
@@ -423,7 +423,7 @@ static int slot_logged_in(UTIL_CTX *ctx, PKCS11_SLOT *slot) {
423423 * @tok is PKCS11 token to log in (??? could be derived as @slot->token)
424424 * @return 1 on success, 0 on error.
425425 */
426- static int UTIL_CTX_login (UTIL_CTX * ctx , PKCS11_SLOT * slot , PKCS11_TOKEN * tok )
426+ static int util_ctx_login (UTIL_CTX * ctx , PKCS11_SLOT * slot , PKCS11_TOKEN * tok )
427427{
428428 if (!(ctx -> force_login || tok -> loginRequired ) || slot_logged_in (ctx , slot ))
429429 return 1 ;
@@ -432,7 +432,7 @@ static int UTIL_CTX_login(UTIL_CTX *ctx, PKCS11_SLOT *slot, PKCS11_TOKEN *tok)
432432 * then use a NULL PIN. Otherwise, obtain a new PIN if needed. */
433433 if (tok -> secureLogin && !ctx -> forced_pin ) {
434434 /* Free the PIN if it has already been
435- * assigned (i.e, cached by UTIL_CTX_get_pin ) */
435+ * assigned (i.e, cached by util_ctx_get_pin ) */
436436 UTIL_CTX_set_pin (ctx , NULL );
437437 } else if (!ctx -> pin ) {
438438 ctx -> pin = OPENSSL_malloc (MAX_PIN_LENGTH + 1 );
@@ -442,7 +442,7 @@ static int UTIL_CTX_login(UTIL_CTX *ctx, PKCS11_SLOT *slot, PKCS11_TOKEN *tok)
442442 return 0 ;
443443 }
444444 memset (ctx -> pin , 0 , MAX_PIN_LENGTH + 1 );
445- if (!UTIL_CTX_get_pin (ctx , tok -> label )) {
445+ if (!util_ctx_get_pin (ctx , tok -> label )) {
446446 UTIL_CTX_set_pin (ctx , NULL );
447447 UTIL_CTX_log (ctx , LOG_ERR , "No PIN code was entered\n" );
448448 return 0 ;
@@ -798,7 +798,7 @@ static int parse_pkcs11_uri(UTIL_CTX *ctx,
798798/* Utilities common to public, private key and certificate handling */
799799/******************************************************************************/
800800
801- static void * UTIL_CTX_try_load_object (UTIL_CTX * ctx ,
801+ static void * util_ctx_try_load_object (UTIL_CTX * ctx ,
802802 const char * object_typestr ,
803803 void * (* match_func )(UTIL_CTX * , PKCS11_TOKEN * ,
804804 const char * , size_t , const char * ),
@@ -979,7 +979,7 @@ static void *UTIL_CTX_try_load_object(UTIL_CTX *ctx,
979979
980980 /* Only try to login if login is required */
981981 if (slot -> token -> loginRequired || ctx -> force_login ) {
982- if (!UTIL_CTX_login (ctx , slot , slot -> token )) {
982+ if (!util_ctx_login (ctx , slot , slot -> token )) {
983983 UTIL_CTX_log (ctx , LOG_ERR , "Login to token failed, returning NULL...\n" );
984984 goto cleanup ; /* failed */
985985 }
@@ -1028,7 +1028,7 @@ static void *UTIL_CTX_try_load_object(UTIL_CTX *ctx,
10281028
10291029 /* Only try to login if login is required */
10301030 if (slot -> token -> loginRequired || ctx -> force_login ) {
1031- if (!UTIL_CTX_login (ctx , slot , slot -> token )) {
1031+ if (!util_ctx_login (ctx , slot , slot -> token )) {
10321032 UTIL_CTX_log (ctx , LOG_ERR , "Login to token failed, returning NULL...\n" );
10331033 free (init_slots );
10341034 free (uninit_slots );
@@ -1109,7 +1109,7 @@ static void *UTIL_CTX_try_load_object(UTIL_CTX *ctx,
11091109 return object ;
11101110}
11111111
1112- static void * UTIL_CTX_load_object (UTIL_CTX * ctx ,
1112+ static void * util_ctx_load_object (UTIL_CTX * ctx ,
11131113 const char * object_typestr ,
11141114 void * (* match_func )(UTIL_CTX * , PKCS11_TOKEN * ,
11151115 const char * , size_t , const char * ),
@@ -1119,14 +1119,14 @@ static void *UTIL_CTX_load_object(UTIL_CTX *ctx,
11191119
11201120 if (!ctx -> force_login ) {
11211121 ERR_clear_error ();
1122- obj = UTIL_CTX_try_load_object (ctx , object_typestr , match_func ,
1122+ obj = util_ctx_try_load_object (ctx , object_typestr , match_func ,
11231123 object_uri , 0 );
11241124 }
11251125
11261126 if (!obj ) {
11271127 /* Try again with login */
11281128 ERR_clear_error ();
1129- obj = UTIL_CTX_try_load_object (ctx , object_typestr , match_func ,
1129+ obj = util_ctx_try_load_object (ctx , object_typestr , match_func ,
11301130 object_uri , 1 );
11311131 if (!obj ) {
11321132 UTIL_CTX_log (ctx , LOG_ERR , "The %s was not found at: %s\n" ,
@@ -1295,7 +1295,7 @@ X509 *UTIL_CTX_get_cert_from_uri(UTIL_CTX *ctx, const char *object_uri)
12951295{
12961296 PKCS11_CERT * cert ;
12971297
1298- cert = UTIL_CTX_load_object (ctx , "certificate" , match_cert , object_uri );
1298+ cert = util_ctx_load_object (ctx , "certificate" , match_cert , object_uri );
12991299 return cert ? X509_dup (cert -> x509 ) : NULL ;
13001300}
13011301
@@ -1428,7 +1428,7 @@ EVP_PKEY *UTIL_CTX_get_pubkey_from_uri(UTIL_CTX *ctx, const char *s_key_id)
14281428{
14291429 PKCS11_KEY * key ;
14301430
1431- key = UTIL_CTX_load_object (ctx , "public key" ,
1431+ key = util_ctx_load_object (ctx , "public key" ,
14321432 match_public_key , s_key_id );
14331433 return key ? PKCS11_get_public_key (key ) : NULL ;
14341434}
@@ -1437,7 +1437,7 @@ EVP_PKEY *UTIL_CTX_get_privkey_from_uri(UTIL_CTX *ctx, const char *s_key_id)
14371437{
14381438 PKCS11_KEY * key ;
14391439
1440- key = UTIL_CTX_load_object (ctx , "private key" ,
1440+ key = util_ctx_load_object (ctx , "private key" ,
14411441 match_private_key , s_key_id );
14421442 return key ? PKCS11_get_private_key (key ) : NULL ;
14431443}
0 commit comments