version 1.45, 2013/02/27 14:12:57
|
version 1.75, 2021/03/13 12:50:42
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.12 |
RPL/2 (R) version 4.1.33 |
Copyright (C) 1989-2013 Dr. BERTRAND Joël |
Copyright (C) 1989-2021 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 339 instruction_diag_fleche(struct_processus
|
Line 339 instruction_diag_fleche(struct_processus
|
struct_objet *s_objet_argument; |
struct_objet *s_objet_argument; |
struct_objet *s_objet_resultat; |
struct_objet *s_objet_resultat; |
|
|
unsigned long i; |
integer8 i; |
unsigned long j; |
integer8 j; |
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
Line 409 instruction_diag_fleche(struct_processus
|
Line 409 instruction_diag_fleche(struct_processus
|
(*((struct_matrice *) (*s_objet_argument).objet)).nombre_lignes; |
(*((struct_matrice *) (*s_objet_argument).objet)).nombre_lignes; |
|
|
if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau |
if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau |
= malloc((*((struct_vecteur *) (*s_objet_resultat).objet)) |
= malloc(((size_t) (*((struct_vecteur *) (*s_objet_resultat) |
.taille * sizeof(integer8))) == NULL) |
.objet)).taille) * sizeof(integer8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 467 instruction_diag_fleche(struct_processus
|
Line 467 instruction_diag_fleche(struct_processus
|
(*((struct_matrice *) (*s_objet_argument).objet)).nombre_lignes; |
(*((struct_matrice *) (*s_objet_argument).objet)).nombre_lignes; |
|
|
if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau |
if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau |
= malloc((*((struct_vecteur *) (*s_objet_resultat).objet)) |
= malloc(((size_t) (*((struct_vecteur *) (*s_objet_resultat) |
.taille * sizeof(real8))) == NULL) |
.objet)).taille) * sizeof(real8))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 525 instruction_diag_fleche(struct_processus
|
Line 525 instruction_diag_fleche(struct_processus
|
(*((struct_matrice *) (*s_objet_argument).objet)).nombre_lignes; |
(*((struct_matrice *) (*s_objet_argument).objet)).nombre_lignes; |
|
|
if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau |
if (((*((struct_vecteur *) (*s_objet_resultat).objet)).tableau |
= malloc((*((struct_vecteur *) (*s_objet_resultat).objet)) |
= malloc(((size_t) (*((struct_vecteur *) (*s_objet_resultat) |
.taille * sizeof(complex16))) == NULL) |
.objet)).taille) * sizeof(complex16))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 605 instruction_diag_fleche(struct_processus
|
Line 605 instruction_diag_fleche(struct_processus
|
void |
void |
instruction_digest(struct_processus *s_etat_processus) |
instruction_digest(struct_processus *s_etat_processus) |
{ |
{ |
EVP_MD_CTX contexte; |
EVP_MD_CTX *contexte; |
|
|
const EVP_MD *EVP_sum; |
const EVP_MD *EVP_sum; |
const EVP_CIPHER *EVP_chiffrement; |
const EVP_CIPHER *EVP_chiffrement; |
|
|
logical1 somme_invalide; |
int i; |
|
int longueur_bloc; |
|
int longueur_somme; |
|
|
|
integer8 longueur_chaine; |
|
integer8 longueur_clef; |
|
integer8 longueur_clef_attendue; |
|
integer8 longueur_clef_max; |
|
integer8 longueur_clef_min; |
|
integer8 longueur_tampon; |
|
|
long i; |
logical1 somme_invalide; |
long longueur_chaine; |
|
|
|
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant; |
|
|
Line 628 instruction_digest(struct_processus *s_e
|
Line 636 instruction_digest(struct_processus *s_e
|
unsigned char *tampon; |
unsigned char *tampon; |
unsigned char *vecteur_initialisation; |
unsigned char *vecteur_initialisation; |
|
|
unsigned int longueur_bloc; |
|
unsigned int longueur_somme; |
|
unsigned int longueur_tampon; |
|
|
|
unsigned long longueur_clef; |
|
unsigned long longueur_clef_attendue; |
|
unsigned long longueur_clef_max; |
|
unsigned long longueur_clef_min; |
|
|
|
(*s_etat_processus).erreur_execution = d_ex; |
(*s_etat_processus).erreur_execution = d_ex; |
|
|
if ((*s_etat_processus).affichage_arguments == 'Y') |
if ((*s_etat_processus).affichage_arguments == 'Y') |
Line 685 instruction_digest(struct_processus *s_e
|
Line 684 instruction_digest(struct_processus *s_e
|
printf(" - DES-EDE3-CB\n"); |
printf(" - DES-EDE3-CB\n"); |
printf(" - DESX-CBC\n"); |
printf(" - DESX-CBC\n"); |
# endif |
# endif |
# ifndef OPENSSL_NO_SHA |
|
printf(" - DSS\n"); |
|
printf(" - DSS1\n"); |
|
printf(" - ECDSA\n"); |
|
# endif |
|
# ifndef OPENSSL_NO_IDEA |
# ifndef OPENSSL_NO_IDEA |
printf(" - IDEA-CBC\n"); |
printf(" - IDEA-CBC\n"); |
# endif |
# endif |
Line 713 instruction_digest(struct_processus *s_e
|
Line 707 instruction_digest(struct_processus *s_e
|
# ifndef OPENSSL_NO_RIPEMD |
# ifndef OPENSSL_NO_RIPEMD |
printf(" - RIPEMD160\n"); |
printf(" - RIPEMD160\n"); |
# endif |
# endif |
# ifndef OPENSSL_NO_SHA |
|
printf(" - SHA\n"); |
|
printf(" - SHA1\n"); |
printf(" - SHA1\n"); |
# endif |
|
# ifndef OPENSSL_NO_SHA256 |
|
printf(" - SHA224\n"); |
printf(" - SHA224\n"); |
printf(" - SHA256\n"); |
printf(" - SHA256\n"); |
# endif |
|
# ifndef OPENSSL_NO_SHA512 |
|
printf(" - SHA384\n"); |
printf(" - SHA384\n"); |
printf(" - SHA512\n"); |
printf(" - SHA512\n"); |
# endif |
|
# ifndef OPENSSL_NO_WHIRLPOOL |
# ifndef OPENSSL_NO_WHIRLPOOL |
printf(" - WHIRLPOOL\n"); |
printf(" - WHIRLPOOL\n"); |
# endif |
# endif |
Line 779 instruction_digest(struct_processus *s_e
|
Line 766 instruction_digest(struct_processus *s_e
|
((*s_objet_argument_2).type == CHN)) |
((*s_objet_argument_2).type == CHN)) |
{ |
{ |
// Liste des sommes disponibles : |
// Liste des sommes disponibles : |
// - EVP_dss |
|
// - EVP_dss1 |
|
// - EVP_ecdsa |
|
// - EVP_md2 |
// - EVP_md2 |
// - EVP_md4 |
// - EVP_md4 |
// - EVP_md5 |
// - EVP_md5 |
// - EVP_mdc2 |
// - EVP_mdc2 |
// - EVP_ripemd160 |
// - EVP_ripemd160 |
// - EVP_sha |
|
// - EVP_sha1 |
// - EVP_sha1 |
// - EVP_sha224 |
// - EVP_sha224 |
// - EVP_sha256 |
// - EVP_sha256 |
Line 795 instruction_digest(struct_processus *s_e
|
Line 778 instruction_digest(struct_processus *s_e
|
// - EVP_sha512 |
// - EVP_sha512 |
// - EVP_whirlpool |
// - EVP_whirlpool |
|
|
if ((fonction = conversion_majuscule((unsigned char *) |
if ((fonction = conversion_majuscule(s_etat_processus, |
(*s_objet_argument_1).objet)) == NULL) |
(unsigned char *) (*s_objet_argument_1).objet)) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 806 instruction_digest(struct_processus *s_e
|
Line 789 instruction_digest(struct_processus *s_e
|
|
|
switch(fonction[0]) |
switch(fonction[0]) |
{ |
{ |
case 'D': |
|
{ |
|
switch(fonction[1]) |
|
{ |
|
case 'S': // ds |
|
{ |
|
switch(fonction[2]) |
|
{ |
|
# ifndef OPENSSL_NO_SHA |
|
case 'S': // dss |
|
{ |
|
switch(fonction[3]) |
|
{ |
|
case d_code_fin_chaine: |
|
{ |
|
EVP_sum = EVP_dss(); |
|
break; |
|
} |
|
|
|
case '1': // dss1 |
|
{ |
|
if (fonction[4] == d_code_fin_chaine) |
|
{ |
|
EVP_sum = EVP_dss1(); |
|
} |
|
else |
|
{ |
|
somme_invalide = d_vrai; |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
# endif |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
case 'E': |
|
{ |
|
switch(fonction[1]) |
|
{ |
|
case 'C': // ec |
|
{ |
|
switch(fonction[2]) |
|
{ |
|
case 'D': // ecd |
|
{ |
|
switch(fonction[3]) |
|
{ |
|
case 'S': // ecds |
|
{ |
|
switch(fonction[4]) |
|
{ |
|
# ifndef OPENSSL_NO_SHA |
|
case 'A': // ecdsa |
|
{ |
|
if (fonction[5] == |
|
d_code_fin_chaine) |
|
{ |
|
EVP_sum = EVP_ecdsa(); |
|
} |
|
else |
|
{ |
|
somme_invalide = d_vrai; |
|
} |
|
|
|
break; |
|
} |
|
# endif |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
case 'M': |
case 'M': |
{ |
{ |
switch(fonction[1]) |
switch(fonction[1]) |
Line 1073 instruction_digest(struct_processus *s_e
|
Line 919 instruction_digest(struct_processus *s_e
|
{ |
{ |
switch(fonction[2]) |
switch(fonction[2]) |
{ |
{ |
# ifndef OPENSSL_NO_SHA |
|
case 'A': |
case 'A': |
{ |
{ |
switch(fonction[3]) |
switch(fonction[3]) |
{ |
{ |
case d_code_fin_chaine: |
|
{ |
|
EVP_sum = EVP_sha(); |
|
break; |
|
} |
|
|
|
case '1': // sha1 |
case '1': // sha1 |
{ |
{ |
if (fonction[4] == d_code_fin_chaine) |
if (fonction[4] == d_code_fin_chaine) |
Line 1098 instruction_digest(struct_processus *s_e
|
Line 937 instruction_digest(struct_processus *s_e
|
break; |
break; |
} |
} |
|
|
# ifndef OPENSSL_NO_SHA256 |
|
case '2': // sha2 |
case '2': // sha2 |
{ |
{ |
switch(fonction[4]) |
switch(fonction[4]) |
Line 1174 instruction_digest(struct_processus *s_e
|
Line 1012 instruction_digest(struct_processus *s_e
|
|
|
break; |
break; |
} |
} |
# endif |
|
|
|
# ifndef OPENSSL_NO_SHA512 |
|
case '3': // sha3 |
case '3': // sha3 |
{ |
{ |
switch(fonction[4]) |
switch(fonction[4]) |
Line 1266 instruction_digest(struct_processus *s_e
|
Line 1102 instruction_digest(struct_processus *s_e
|
|
|
break; |
break; |
} |
} |
# endif |
|
|
|
default: |
default: |
{ |
{ |
Line 1277 instruction_digest(struct_processus *s_e
|
Line 1112 instruction_digest(struct_processus *s_e
|
|
|
break; |
break; |
} |
} |
# endif |
|
|
|
default: |
default: |
{ |
{ |
Line 1334 instruction_digest(struct_processus *s_e
|
Line 1168 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (EVP_DigestInit(&contexte, EVP_sum) != 1) |
if ((contexte = EVP_MD_CTX_new()) == NULL) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (EVP_DigestInit(contexte, EVP_sum) != 1) |
{ |
{ |
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 1348 instruction_digest(struct_processus *s_e
|
Line 1191 instruction_digest(struct_processus *s_e
|
if ((chaine = formateur_flux(s_etat_processus, (unsigned char *) |
if ((chaine = formateur_flux(s_etat_processus, (unsigned char *) |
(*s_objet_argument_2).objet, &longueur_chaine)) == NULL) |
(*s_objet_argument_2).objet, &longueur_chaine)) == NULL) |
{ |
{ |
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 1356 instruction_digest(struct_processus *s_e
|
Line 1199 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (EVP_DigestUpdate(&contexte, chaine, longueur_chaine) != 1) |
if (EVP_DigestUpdate(contexte, chaine, (size_t) longueur_chaine) != 1) |
{ |
{ |
free(chaine); |
free(chaine); |
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 1368 instruction_digest(struct_processus *s_e
|
Line 1211 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (EVP_DigestFinal_ex(&contexte, somme, &longueur_somme) != 1) |
if (EVP_DigestFinal_ex(contexte, somme, &longueur_somme) != 1) |
{ |
{ |
free(chaine); |
free(chaine); |
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 1381 instruction_digest(struct_processus *s_e
|
Line 1224 instruction_digest(struct_processus *s_e
|
} |
} |
|
|
free(chaine); |
free(chaine); |
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
if ((s_objet_resultat = allocation(s_etat_processus, CHN)) == NULL) |
if ((s_objet_resultat = allocation(s_etat_processus, CHN)) == NULL) |
{ |
{ |
Line 1447 instruction_digest(struct_processus *s_e
|
Line 1290 instruction_digest(struct_processus *s_e
|
|
|
l_element_courant = (*s_objet_argument_1).objet; |
l_element_courant = (*s_objet_argument_1).objet; |
|
|
if ((fonction = conversion_majuscule((unsigned char *) |
if ((fonction = conversion_majuscule(s_etat_processus, |
(*(*l_element_courant).donnee).objet)) == NULL) |
(unsigned char *) (*(*l_element_courant).donnee).objet)) |
|
== NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
return; |
return; |
Line 1458 instruction_digest(struct_processus *s_e
|
Line 1302 instruction_digest(struct_processus *s_e
|
|
|
switch(fonction[0]) |
switch(fonction[0]) |
{ |
{ |
case 'D': |
|
{ |
|
switch(fonction[1]) |
|
{ |
|
case 'S': // ds |
|
{ |
|
switch(fonction[2]) |
|
{ |
|
# ifndef OPENSSL_NO_SHA |
|
case 'S': // dss |
|
{ |
|
switch(fonction[3]) |
|
{ |
|
case d_code_fin_chaine: |
|
{ |
|
EVP_sum = EVP_dss(); |
|
break; |
|
} |
|
|
|
case '1': // dss1 |
|
{ |
|
if (fonction[4] == d_code_fin_chaine) |
|
{ |
|
EVP_sum = EVP_dss1(); |
|
} |
|
else |
|
{ |
|
somme_invalide = d_vrai; |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
# endif |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
case 'E': |
|
{ |
|
switch(fonction[1]) |
|
{ |
|
case 'C': // ec |
|
{ |
|
switch(fonction[2]) |
|
{ |
|
case 'D': // ecd |
|
{ |
|
switch(fonction[3]) |
|
{ |
|
case 'S': // ecds |
|
{ |
|
switch(fonction[4]) |
|
{ |
|
# ifndef OPENSSL_NO_SHA |
|
case 'A': // ecdsa |
|
{ |
|
if (fonction[5] == |
|
d_code_fin_chaine) |
|
{ |
|
EVP_sum = EVP_ecdsa(); |
|
} |
|
else |
|
{ |
|
somme_invalide = d_vrai; |
|
} |
|
|
|
break; |
|
} |
|
# endif |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
somme_invalide = d_vrai; |
|
break; |
|
} |
|
} |
|
|
|
break; |
|
} |
|
|
|
case 'M': |
case 'M': |
{ |
{ |
switch(fonction[1]) |
switch(fonction[1]) |
Line 1725 instruction_digest(struct_processus *s_e
|
Line 1432 instruction_digest(struct_processus *s_e
|
{ |
{ |
switch(fonction[2]) |
switch(fonction[2]) |
{ |
{ |
# ifndef OPENSSL_NO_SHA |
|
case 'A': |
case 'A': |
{ |
{ |
switch(fonction[3]) |
switch(fonction[3]) |
{ |
{ |
case d_code_fin_chaine: |
|
{ |
|
EVP_sum = EVP_sha(); |
|
break; |
|
} |
|
|
|
case '1': // sha1 |
case '1': // sha1 |
{ |
{ |
if (fonction[4] == d_code_fin_chaine) |
if (fonction[4] == d_code_fin_chaine) |
Line 1750 instruction_digest(struct_processus *s_e
|
Line 1450 instruction_digest(struct_processus *s_e
|
break; |
break; |
} |
} |
|
|
# ifndef OPENSSL_NO_SHA256 |
|
case '2': // sha2 |
case '2': // sha2 |
{ |
{ |
switch(fonction[4]) |
switch(fonction[4]) |
Line 1826 instruction_digest(struct_processus *s_e
|
Line 1525 instruction_digest(struct_processus *s_e
|
|
|
break; |
break; |
} |
} |
# endif |
|
|
|
# ifndef OPENSSL_NO_SHA512 |
|
case '3': // sha3 |
case '3': // sha3 |
{ |
{ |
switch(fonction[4]) |
switch(fonction[4]) |
Line 1918 instruction_digest(struct_processus *s_e
|
Line 1615 instruction_digest(struct_processus *s_e
|
|
|
break; |
break; |
} |
} |
# endif |
|
|
|
default: |
default: |
{ |
{ |
Line 1929 instruction_digest(struct_processus *s_e
|
Line 1625 instruction_digest(struct_processus *s_e
|
|
|
break; |
break; |
} |
} |
# endif |
|
|
|
default: |
default: |
{ |
{ |
Line 2268 instruction_digest(struct_processus *s_e
|
Line 1963 instruction_digest(struct_processus *s_e
|
} |
} |
} |
} |
|
|
if ((vecteur_initialisation = malloc(longueur_clef * |
if ((vecteur_initialisation = malloc(((size_t) longueur_clef) * |
sizeof(unsigned char))) == NULL) |
sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
Line 2276 instruction_digest(struct_processus *s_e
|
Line 1971 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
memset(vecteur_initialisation, 0, longueur_clef); |
memset(vecteur_initialisation, 0, (size_t) longueur_clef); |
|
|
if ((tampon = chiffrement(EVP_chiffrement, d_vrai, |
if ((tampon = chiffrement(s_etat_processus, EVP_chiffrement, d_vrai, |
chaine, longueur_chaine, clef, longueur_clef, |
chaine, longueur_chaine, clef, longueur_clef, |
vecteur_initialisation, &longueur_tampon)) == NULL) |
vecteur_initialisation, &longueur_tampon)) == NULL) |
{ |
{ |
Line 2346 instruction_digest(struct_processus *s_e
|
Line 2041 instruction_digest(struct_processus *s_e
|
longueur_tampon = longueur_clef; |
longueur_tampon = longueur_clef; |
tampon = clef; |
tampon = clef; |
|
|
if ((clef = malloc(longueur_bloc * sizeof(unsigned char))) |
if ((clef = malloc(((size_t) longueur_bloc) * |
== NULL) |
sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
memset(clef, 0, longueur_bloc); |
memset(clef, 0, (size_t) longueur_bloc); |
memcpy(clef, tampon, longueur_tampon); |
memcpy(clef, tampon, (size_t) longueur_tampon); |
longueur_clef = longueur_bloc; |
longueur_clef = longueur_bloc; |
free(tampon); |
free(tampon); |
} |
} |
Line 2364 instruction_digest(struct_processus *s_e
|
Line 2059 instruction_digest(struct_processus *s_e
|
longueur_tampon = longueur_clef; |
longueur_tampon = longueur_clef; |
tampon = clef; |
tampon = clef; |
|
|
if ((clef = malloc(longueur_bloc * sizeof(unsigned char))) |
if ((clef = malloc(((size_t) longueur_bloc) * |
== NULL) |
sizeof(unsigned char))) == NULL) |
{ |
{ |
(*s_etat_processus).erreur_systeme = |
(*s_etat_processus).erreur_systeme = |
d_es_allocation_memoire; |
d_es_allocation_memoire; |
return; |
return; |
} |
} |
|
|
memcpy(clef, tampon, longueur_bloc); |
memcpy(clef, tampon, (size_t) longueur_bloc); |
longueur_clef = longueur_bloc; |
longueur_clef = longueur_bloc; |
free(tampon); |
free(tampon); |
} |
} |
|
|
for(i = 0; i < longueur_bloc; i++) |
for(i = 0; i < longueur_bloc; i++) |
{ |
{ |
clef[i] ^= 0x36; |
clef[i] ^= (unsigned char) 0x36; |
} |
} |
|
|
if ((chaine = formateur_flux(s_etat_processus, (unsigned char *) |
if ((chaine = formateur_flux(s_etat_processus, (unsigned char *) |
(*s_objet_argument_2).objet, &longueur_chaine)) == NULL) |
(*s_objet_argument_2).objet, &longueur_chaine)) == NULL) |
{ |
{ |
EVP_MD_CTX_cleanup(&contexte); |
|
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
|
|
return; |
return; |
} |
} |
|
|
if ((tampon = malloc((longueur_bloc + longueur_chaine) * |
if ((tampon = malloc(((size_t) (longueur_bloc + longueur_chaine)) * |
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; |
} |
} |
|
|
memcpy(tampon, clef, longueur_bloc); |
memcpy(tampon, clef, (size_t) longueur_bloc); |
memcpy(tampon + longueur_bloc, chaine, longueur_chaine); |
memcpy(tampon + longueur_bloc, chaine, (size_t) longueur_chaine); |
longueur_tampon = longueur_bloc + longueur_chaine; |
longueur_tampon = longueur_bloc + longueur_chaine; |
|
|
if (EVP_DigestInit(&contexte, EVP_sum) != 1) |
if ((contexte = EVP_MD_CTX_new()) == NULL) |
|
{ |
|
liberation(s_etat_processus, s_objet_argument_1); |
|
liberation(s_etat_processus, s_objet_argument_2); |
|
|
|
(*s_etat_processus).erreur_systeme = d_es_allocation_memoire; |
|
return; |
|
} |
|
|
|
if (EVP_DigestInit(contexte, EVP_sum) != 1) |
{ |
{ |
free(tampon); |
free(tampon); |
free(clef); |
free(clef); |
free(chaine); |
free(chaine); |
|
|
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 2419 instruction_digest(struct_processus *s_e
|
Line 2121 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (EVP_DigestUpdate(&contexte, tampon, longueur_tampon) != 1) |
if (EVP_DigestUpdate(contexte, tampon, (size_t) longueur_tampon) |
|
!= 1) |
{ |
{ |
free(tampon); |
free(tampon); |
free(clef); |
free(clef); |
free(chaine); |
free(chaine); |
|
|
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 2436 instruction_digest(struct_processus *s_e
|
Line 2139 instruction_digest(struct_processus *s_e
|
|
|
free(tampon); |
free(tampon); |
|
|
if (EVP_DigestFinal_ex(&contexte, somme, &longueur_somme) != 1) |
if (EVP_DigestFinal_ex(contexte, somme, &longueur_somme) != 1) |
{ |
{ |
free(chaine); |
free(chaine); |
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 2448 instruction_digest(struct_processus *s_e
|
Line 2151 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_reset(contexte); |
|
|
for(i = 0; i < longueur_bloc; i++) |
for(i = 0; i < longueur_bloc; i++) |
{ |
{ |
clef[i] ^= (0x36 ^ 0x5c); |
clef[i] ^= (0x36 ^ 0x5c); |
} |
} |
|
|
if ((tampon = malloc((longueur_bloc + longueur_somme) * |
if ((tampon = malloc(((size_t) (longueur_bloc + longueur_somme)) * |
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; |
} |
} |
|
|
memcpy(tampon, clef, longueur_bloc); |
memcpy(tampon, clef, (size_t) longueur_bloc); |
memcpy(tampon + longueur_bloc, somme, longueur_somme); |
memcpy(tampon + longueur_bloc, somme, (size_t) longueur_somme); |
longueur_tampon = longueur_bloc + longueur_somme; |
longueur_tampon = longueur_bloc + longueur_somme; |
|
|
if (EVP_DigestInit(&contexte, EVP_sum) != 1) |
if (EVP_DigestInit(contexte, EVP_sum) != 1) |
{ |
{ |
free(tampon); |
free(tampon); |
free(clef); |
free(clef); |
free(chaine); |
free(chaine); |
|
|
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 2481 instruction_digest(struct_processus *s_e
|
Line 2184 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
if (EVP_DigestUpdate(&contexte, tampon, longueur_tampon) != 1) |
if (EVP_DigestUpdate(contexte, tampon, (size_t) longueur_tampon) |
|
!= 1) |
{ |
{ |
free(tampon); |
free(tampon); |
free(clef); |
free(clef); |
free(chaine); |
free(chaine); |
|
|
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 2498 instruction_digest(struct_processus *s_e
|
Line 2202 instruction_digest(struct_processus *s_e
|
|
|
free(tampon); |
free(tampon); |
|
|
if (EVP_DigestFinal_ex(&contexte, somme, &longueur_somme) != 1) |
if (EVP_DigestFinal_ex(contexte, somme, &longueur_somme) != 1) |
{ |
{ |
free(chaine); |
free(chaine); |
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_1); |
liberation(s_etat_processus, s_objet_argument_2); |
liberation(s_etat_processus, s_objet_argument_2); |
Line 2510 instruction_digest(struct_processus *s_e
|
Line 2214 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
EVP_MD_CTX_cleanup(&contexte); |
EVP_MD_CTX_free(contexte); |
|
|
free(chaine); |
free(chaine); |
free(clef); |
free(clef); |