version 1.39, 2023/08/07 17:42:49
|
version 1.43, 2024/07/04 08:38:47
|
Line 1
|
Line 1
|
/* |
/* |
================================================================================ |
================================================================================ |
RPL/2 (R) version 4.1.35 |
RPL/2 (R) version 4.1.36 |
Copyright (C) 1989-2023 Dr. BERTRAND Joël |
Copyright (C) 1989-2024 Dr. BERTRAND Joël |
|
|
This file is part of RPL/2. |
This file is part of RPL/2. |
|
|
Line 47 chiffrement(struct_processus *s_etat_pro
|
Line 47 chiffrement(struct_processus *s_etat_pro
|
int longueur_message_1; |
int longueur_message_1; |
int longueur_message_2; |
int longueur_message_2; |
|
|
|
integer8 nombre_blocs; |
|
|
unsigned char *message_chiffre; |
unsigned char *message_chiffre; |
|
|
EVP_CIPHER_CTX *contexte; |
EVP_CIPHER_CTX *contexte; |
Line 67 chiffrement(struct_processus *s_etat_pro
|
Line 69 chiffrement(struct_processus *s_etat_pro
|
return(NULL); |
return(NULL); |
} |
} |
|
|
(*longueur_message_chiffre) = ((longueur_message / |
nombre_blocs = longueur_message / longueur_bloc_de_chiffrement; |
longueur_bloc_de_chiffrement) + 1) * longueur_bloc_de_chiffrement; |
|
|
if ((longueur_message % longueur_bloc_de_chiffrement) != 0) |
|
{ |
|
nombre_blocs++; |
|
} |
|
|
|
(*longueur_message_chiffre) = nombre_blocs * longueur_bloc_de_chiffrement; |
|
|
if ((message_chiffre = malloc(((size_t) (*longueur_message_chiffre)) * |
// On prévoit une zone de garde pour EVP_CipherFinal_ex() en espérant |
|
// qu'il ne faille pas plus qu'une longueur de bloc de chiffrement. |
|
if ((message_chiffre = malloc(((size_t) ((*longueur_message_chiffre) |
|
+ longueur_bloc_de_chiffrement)) * |
sizeof(unsigned char))) == NULL) |
sizeof(unsigned char))) == NULL) |
{ |
{ |
EVP_CIPHER_CTX_free(contexte); |
EVP_CIPHER_CTX_free(contexte); |