@@ -238,7 +238,7 @@ static char *dump_expiry(const PKCS11_CERT *cert)
238238 int len = 0 ;
239239
240240 if (!cert || !cert -> x509 || !(exp = X509_get0_notAfter (cert -> x509 )))
241- return strdup ("No expiry information available" );
241+ return OPENSSL_strdup ("No expiry information available" );
242242
243243 if ((bio = BIO_new (BIO_s_mem ())) == NULL )
244244 return NULL ; /* Memory allocation failure */
@@ -414,7 +414,8 @@ static int parse_slot_id_string(UTIL_CTX *ctx,
414414 const char * slot_id , int * slot ,
415415 char * id , size_t * id_len , char * * label )
416416{
417- int n , i ;
417+ int n ;
418+ size_t i ;
418419
419420 /* support for several formats */
420421#define HEXDIGITS "01234567890ABCDEFabcdef"
@@ -613,7 +614,7 @@ static int read_from_file(UTIL_CTX *ctx,
613614 BIO_free (fp );
614615 return 0 ;
615616 }
616- if (BIO_gets (fp , txt , * field_len + 1 ) > 0 ) {
617+ if (BIO_gets (fp , txt , ( int ) * field_len + 1 ) > 0 ) {
617618 memcpy (field , txt , * field_len );
618619 * field_len = strlen (txt );
619620 } else {
@@ -676,30 +677,30 @@ static int parse_pkcs11_uri(UTIL_CTX *ctx,
676677
677678 if (!strncmp (p , "model=" , 6 )) {
678679 p += 6 ;
679- rv = parse_uri_attr (ctx , p , end - p , & tok -> model );
680+ rv = parse_uri_attr (ctx , p , ( int )( end - p ) , & tok -> model );
680681 } else if (!strncmp (p , "manufacturer=" , 13 )) {
681682 p += 13 ;
682- rv = parse_uri_attr (ctx , p , end - p , & tok -> manufacturer );
683+ rv = parse_uri_attr (ctx , p , ( int )( end - p ) , & tok -> manufacturer );
683684 } else if (!strncmp (p , "token=" , 6 )) {
684685 p += 6 ;
685- rv = parse_uri_attr (ctx , p , end - p , & tok -> label );
686+ rv = parse_uri_attr (ctx , p , ( int )( end - p ) , & tok -> label );
686687 } else if (!strncmp (p , "serial=" , 7 )) {
687688 p += 7 ;
688- rv = parse_uri_attr (ctx , p , end - p , & tok -> serialnr );
689+ rv = parse_uri_attr (ctx , p , ( int )( end - p ) , & tok -> serialnr );
689690 } else if (!strncmp (p , "object=" , 7 )) {
690691 p += 7 ;
691- rv = parse_uri_attr (ctx , p , end - p , & newlabel );
692+ rv = parse_uri_attr (ctx , p , ( int )( end - p ) , & newlabel );
692693 } else if (!strncmp (p , "id=" , 3 )) {
693694 p += 3 ;
694- rv = parse_uri_attr_len (ctx , p , end - p , id , id_len );
695+ rv = parse_uri_attr_len (ctx , p , ( int )( end - p ) , id , id_len );
695696 id_set = 1 ;
696697 } else if (!strncmp (p , "pin-value=" , 10 )) {
697698 p += 10 ;
698- rv = pin_set ? 0 : parse_uri_attr_len (ctx , p , end - p , pin , pin_len );
699+ rv = pin_set ? 0 : parse_uri_attr_len (ctx , p , ( int )( end - p ) , pin , pin_len );
699700 pin_set = 1 ;
700701 } else if (!strncmp (p , "pin-source=" , 11 )) {
701702 p += 11 ;
702- rv = pin_set ? 0 : parse_pin_source (ctx , p , end - p , pin , pin_len );
703+ rv = pin_set ? 0 : parse_pin_source (ctx , p , ( int )( end - p ) , pin , pin_len );
703704 pin_set = 1 ;
704705 } else if (!strncmp (p , "type=" , 5 ) || !strncmp (p , "object-type=" , 12 )) {
705706 p = strchr (p , '=' ) + 1 ;
@@ -840,7 +841,7 @@ static void *UTIL_CTX_try_load_object(UTIL_CTX *ctx,
840841 } else {
841842 strcpy (flags , "no token, " );
842843 }
843- if ((m = strlen (flags )) != 0 ) {
844+ if ((m = ( unsigned int ) strlen (flags )) != 0 ) {
844845 flags [m - 2 ] = '\0' ;
845846 }
846847
0 commit comments