--- rpl/src/instructions_c8.c 2013/02/27 17:11:41 1.6 +++ rpl/src/instructions_c8.c 2013/03/20 17:11:44 1.7 @@ -43,6 +43,10 @@ instruction_cipher(struct_processus *s_e int longueur_clef; + integer8 longueur_clef_binaire; + integer8 longueur_iv_binaire; + integer8 longueur_message; + integer8 longueur_message_chiffre; integer8 nombre_cycles; logical1 encodage; @@ -51,10 +55,6 @@ instruction_cipher(struct_processus *s_e logical8 sel; - long longueur_clef_binaire; - long longueur_iv_binaire; - long longueur_message; - struct_liste_chainee *l_element_courant; struct_objet *s_objet_argument_1; @@ -75,8 +75,6 @@ instruction_cipher(struct_processus *s_e unsigned char *message_chiffre; unsigned char *tampon; - unsigned int longueur_message_chiffre; - if ((*s_etat_processus).affichage_arguments == 'Y') { printf("\n CIPHER "); @@ -1474,14 +1472,14 @@ instruction_cipher(struct_processus *s_e if (generation_clef == d_vrai) { - if ((iv = malloc(EVP_CIPHER_iv_length(EVP_chiffrement) + if ((iv = malloc(((size_t) EVP_CIPHER_iv_length(EVP_chiffrement)) * sizeof(unsigned char))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; return; } - if ((clef = malloc(EVP_CIPHER_key_length(EVP_chiffrement) + if ((clef = malloc(((size_t) EVP_CIPHER_key_length(EVP_chiffrement)) * sizeof(unsigned char))) == NULL) { (*s_etat_processus).erreur_systeme = d_es_allocation_memoire; @@ -1490,9 +1488,10 @@ instruction_cipher(struct_processus *s_e longueur_clef = EVP_BytesToKey(EVP_chiffrement, EVP_sum, (unsigned char *) &sel, (unsigned char *) - (*s_objet_argument_2).objet, longueur_chaine(s_etat_processus, + (*s_objet_argument_2).objet, + (int) longueur_chaine(s_etat_processus, (unsigned char *) (*s_objet_argument_2).objet), - nombre_cycles, clef, iv); + (int) nombre_cycles, clef, iv); if (longueur_clef != EVP_CIPHER_key_length(EVP_chiffrement)) {