--- rpl/src/instructions_c8.c 2013/02/27 17:11:41 1.6 +++ rpl/src/instructions_c8.c 2015/01/05 13:12:34 1.16 @@ -1,7 +1,7 @@ /* ================================================================================ - RPL/2 (R) version 4.1.13 - Copyright (C) 1989-2013 Dr. BERTRAND Joël + RPL/2 (R) version 4.1.19 + Copyright (C) 1989-2015 Dr. BERTRAND Joël This file is part of RPL/2. @@ -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 "); @@ -96,8 +94,7 @@ instruction_cipher(struct_processus *s_e printf("-> 1: { \"cipher type\" \"generated key\" \"iv\" }\n\n"); printf(" 2: \"text\"\n", d_CHN); - printf(" 1: %s { \"direction\" \"cipher type\" \"key\" \"iv\" }\n", - d_LST); + printf(" 1: { \"direction\" \"cipher type\" \"key\" \"iv\" }\n"); printf("-> 2: \"encrypted or decrypted text\"\n", d_CHN); printf(" 1: { \"direction\" \"cipher type\" \"key\" " "\"updated iv\" }\n\n", d_LST); @@ -1474,14 +1471,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 +1487,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)) {