- Fixed type of length in get_pkcs_padding()
diff --git a/library/cipher.c b/library/cipher.c
index 2a9da25..485a09b 100644
--- a/library/cipher.c
+++ b/library/cipher.c
@@ -94,7 +94,7 @@
return supported_ciphers;
}
-const cipher_info_t *cipher_info_from_type( cipher_type_t cipher_type )
+const cipher_info_t *cipher_info_from_type( const cipher_type_t cipher_type )
{
/* Find static cipher information */
switch ( cipher_type )
@@ -433,11 +433,10 @@
output[data_len + i] = (unsigned char) padding_len;
}
-static int get_pkcs_padding( unsigned char *input, unsigned char input_len,
+static int get_pkcs_padding( unsigned char *input, unsigned int input_len,
size_t *data_len)
{
- int i = 0;
- unsigned char padding_len = 0;
+ unsigned int i, padding_len = 0;
if( NULL == input || NULL == data_len )
return POLARSSL_ERR_CIPHER_BAD_INPUT_DATA;