@@ -2224,7 +2224,7 @@ static int wp_rsa_decode_enc_pki(wp_Rsa* rsa, unsigned char* data, word32 len,
22242224 }
22252225 if (ok ) {
22262226 /* Decrypt to encoded private key. */
2227- int ret = wc_DecryptPKCS8Key (data , len , password , passwordSz );
2227+ int ret = wc_DecryptPKCS8Key (data , len , password , ( int ) passwordSz );
22282228 if (ret <= 0 ) {
22292229 ok = 0 ;
22302230 }
@@ -2596,7 +2596,7 @@ static int wp_rsa_encode_spki(const wp_Rsa* rsa, unsigned char* keyData,
25962596 int ok = 1 ;
25972597 int ret ;
25982598
2599- ret = wc_RsaKeyToPublicDer ((RsaKey * )& rsa -> key , keyData , * keyLen );
2599+ ret = wc_RsaKeyToPublicDer ((RsaKey * )& rsa -> key , keyData , ( word32 ) * keyLen );
26002600 if (ret <= 0 ) {
26012601 ok = 0 ;
26022602 }
@@ -2692,7 +2692,7 @@ static int wp_rsa_encode_pub(const wp_Rsa* rsa, unsigned char* keyData,
26922692 }
26932693#else
26942694 /* TODO: Encodes with header. Strip it off. */
2695- ret = wc_RsaKeyToPublicDer ((RsaKey * )& rsa -> key , keyData , * keyLen );
2695+ ret = wc_RsaKeyToPublicDer ((RsaKey * )& rsa -> key , keyData , ( word32 ) * keyLen );
26962696 if (ret <= 0 ) {
26972697 ok = 0 ;
26982698 }
@@ -2879,8 +2879,8 @@ static int wp_rsa_encode_enc_pki_size(const wp_RsaEncDecCtx* ctx,
28792879 ok = wp_rsa_encode_pki_size (rsa , & len , RSA_ALGO_ID (ctx ));
28802880 if (ok ) {
28812881 /* Get encrypted encode private key. */
2882- if (wc_EncryptPKCS8Key (fakeData , len , NULL , & outSz , "" , 0 , WP_PKCS5 ,
2883- WP_PBES2 , ctx -> cipher , fakeSalt , sizeof (fakeSalt ),
2882+ if (wc_EncryptPKCS8Key (fakeData , ( word32 ) len , NULL , & outSz , "" , 0 ,
2883+ WP_PKCS5 , WP_PBES2 , ctx -> cipher , fakeSalt , sizeof (fakeSalt ),
28842884 WP_PKCS12_ITERATIONS_DEFAULT , wp_provctx_get_rng (ctx -> provCtx ),
28852885 NULL ) != LENGTH_ONLY_E ) {
28862886 ok = 0 ;
@@ -2914,7 +2914,7 @@ static int wp_rsa_encode_enc_pki(const wp_RsaEncDecCtx* ctx, const wp_Rsa* rsa,
29142914{
29152915 int ok = 1 ;
29162916 size_t len ;
2917- word32 outSz = * keyLen ;
2917+ word32 outSz = ( word32 ) * keyLen ;
29182918 byte salt [WP_MAX_SALT_SIZE ];
29192919 int saltLen = 16 ;
29202920 char password [1024 ];
@@ -2947,10 +2947,10 @@ static int wp_rsa_encode_enc_pki(const wp_RsaEncDecCtx* ctx, const wp_Rsa* rsa,
29472947 }
29482948 if (ok ) {
29492949 /* Encrypt encoded key - in and out buffers must be different. */
2950- if (wc_EncryptPKCS8Key (encodedKey , len , keyData , & outSz , password ,
2951- passwordSz , WP_PKCS5 , WP_PBES2 , ctx -> cipher , salt , saltLen ,
2952- WP_PKCS12_ITERATIONS_DEFAULT , wp_provctx_get_rng ( ctx -> provCtx ) ,
2953- NULL ) <= 0 ) {
2950+ if (wc_EncryptPKCS8Key (encodedKey , ( word32 ) len , keyData , & outSz ,
2951+ password , ( word32 ) passwordSz , WP_PKCS5 , WP_PBES2 , ctx -> cipher ,
2952+ salt , saltLen , WP_PKCS12_ITERATIONS_DEFAULT ,
2953+ wp_provctx_get_rng ( ctx -> provCtx ), NULL ) <= 0 ) {
29542954 ok = 0 ;
29552955 }
29562956 else {
0 commit comments