Diff for /rpl/src/instructions_c8.c between versions 1.3 and 1.13

version 1.3, 2013/02/27 14:12:57 version 1.13, 2014/04/25 07:37:30
Line 1 Line 1
 /*  /*
 ================================================================================  ================================================================================
   RPL/2 (R) version 4.1.12    RPL/2 (R) version 4.1.18
   Copyright (C) 1989-2013 Dr. BERTRAND Joël    Copyright (C) 1989-2014 Dr. BERTRAND Joël
   
   This file is part of RPL/2.    This file is part of RPL/2.
   
Line 43  instruction_cipher(struct_processus *s_e Line 43  instruction_cipher(struct_processus *s_e
   
     int                             longueur_clef;      int                             longueur_clef;
   
       integer8                        longueur_clef_binaire;
       integer8                        longueur_iv_binaire;
       integer8                        longueur_message;
       integer8                        longueur_message_chiffre;
     integer8                        nombre_cycles;      integer8                        nombre_cycles;
   
     logical1                        encodage;      logical1                        encodage;
Line 51  instruction_cipher(struct_processus *s_e Line 55  instruction_cipher(struct_processus *s_e
   
     logical8                        sel;      logical8                        sel;
   
     long                            longueur_clef_binaire;  
     long                            longueur_iv_binaire;  
     long                            longueur_message;  
   
     struct_liste_chainee            *l_element_courant;      struct_liste_chainee            *l_element_courant;
   
     struct_objet                    *s_objet_argument_1;      struct_objet                    *s_objet_argument_1;
Line 75  instruction_cipher(struct_processus *s_e Line 75  instruction_cipher(struct_processus *s_e
     unsigned char                   *message_chiffre;      unsigned char                   *message_chiffre;
     unsigned char                   *tampon;      unsigned char                   *tampon;
   
     unsigned int                    longueur_message_chiffre;  
   
     if ((*s_etat_processus).affichage_arguments == 'Y')      if ((*s_etat_processus).affichage_arguments == 'Y')
     {      {
         printf("\n  CIPHER ");          printf("\n  CIPHER ");
Line 292  instruction_cipher(struct_processus *s_e Line 290  instruction_cipher(struct_processus *s_e
             printf("  Usage:\n\n");              printf("  Usage:\n\n");
         }          }
   
         printf("    \"password\" { \"key\" \"DES-EDE-OFB\" \"SHA1\" "          printf("    \"password\" { \"KEY\" \"DES-EDE-OFB\" \"SHA1\" "
                 "# 0h 3 } CIPHER\n");                  "# 0h 3 } CIPHER\n");
         printf("    \"text\" { \"ENCRYPT\" \"AES-128-CBC\" \"key\" "          printf("    \"text\" { \"ENCRYPT\" \"AES-128-CBC\" \"key\" "
                 "\"iv\" } CIPHER\n");                  "\"iv\" } CIPHER\n");
Line 1474  instruction_cipher(struct_processus *s_e Line 1472  instruction_cipher(struct_processus *s_e
   
     if (generation_clef == d_vrai)      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)                  * sizeof(unsigned char))) == NULL)
         {          {
             (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;              (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
             return;              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)                  * sizeof(unsigned char))) == NULL)
         {          {
             (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;              (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
Line 1490  instruction_cipher(struct_processus *s_e Line 1488  instruction_cipher(struct_processus *s_e
   
         longueur_clef = EVP_BytesToKey(EVP_chiffrement, EVP_sum,          longueur_clef = EVP_BytesToKey(EVP_chiffrement, EVP_sum,
                 (unsigned char *) &sel, (unsigned char *)                  (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),                  (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))          if (longueur_clef != EVP_CIPHER_key_length(EVP_chiffrement))
         {          {
Line 1755  instruction_cipher(struct_processus *s_e Line 1754  instruction_cipher(struct_processus *s_e
             return;              return;
         }          }
   
         if (((*(*l_element_courant).donnee).objet = malloc(          if (((*(*l_element_courant).donnee).objet =
                 (strlen(algorithme_chiffrement) + 1) * sizeof(unsigned char)))                  conversion_majuscule(algorithme_chiffrement)) == NULL)
                 == NULL)  
         {          {
             (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;              (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
             return;              return;
         }          }
   
         strcpy((*(*l_element_courant).donnee).objet, algorithme_chiffrement);  
   
         // Clef          // Clef
   
         if (((*l_element_courant).suivant = allocation_maillon(          if (((*l_element_courant).suivant = allocation_maillon(

Removed from v.1.3  
changed lines
  Added in v.1.13


CVSweb interface <joel.bertrand@systella.fr>