version 1.5, 2013/02/27 16:26:45
|
version 1.14, 2014/05/14 08:56:40
|
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 96 instruction_cipher(struct_processus *s_e
|
Line 94 instruction_cipher(struct_processus *s_e
|
printf("-> 1: { \"cipher type\" \"generated key\" \"iv\" }\n\n"); |
printf("-> 1: { \"cipher type\" \"generated key\" \"iv\" }\n\n"); |
|
|
printf(" 2: \"text\"\n", d_CHN); |
printf(" 2: \"text\"\n", d_CHN); |
printf(" 1: %s { \"direction\" \"cipher type\" \"key\" \"iv\" }\n", |
printf(" 1: { \"direction\" \"cipher type\" \"key\" \"iv\" }\n"); |
d_LST); |
|
printf("-> 2: \"encrypted or decrypted text\"\n", d_CHN); |
printf("-> 2: \"encrypted or decrypted text\"\n", d_CHN); |
printf(" 1: { \"direction\" \"cipher type\" \"key\" " |
printf(" 1: { \"direction\" \"cipher type\" \"key\" " |
"\"updated iv\" }\n\n", d_LST); |
"\"updated iv\" }\n\n", d_LST); |
Line 1474 instruction_cipher(struct_processus *s_e
|
Line 1471 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 1487 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)) |
{ |
{ |