GH643: Cleanup header analysis
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
This commit is contained in:
parent
5b326dc529
commit
33a6d5a0e5
1 changed files with 3 additions and 4 deletions
|
@ -488,7 +488,7 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen,
|
||||||
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
|
int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
|
||||||
{
|
{
|
||||||
const EVP_CIPHER *enc = NULL;
|
const EVP_CIPHER *enc = NULL;
|
||||||
char *p, c;
|
char *dekinfostart, c;
|
||||||
char **header_pp = &header;
|
char **header_pp = &header;
|
||||||
|
|
||||||
cipher->cipher = NULL;
|
cipher->cipher = NULL;
|
||||||
|
@ -521,7 +521,7 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
|
||||||
}
|
}
|
||||||
header += 10;
|
header += 10;
|
||||||
|
|
||||||
p = header;
|
dekinfostart = header;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
c = *header;
|
c = *header;
|
||||||
#ifndef CHARSET_EBCDIC
|
#ifndef CHARSET_EBCDIC
|
||||||
|
@ -535,9 +535,8 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
|
||||||
header++;
|
header++;
|
||||||
}
|
}
|
||||||
*header = '\0';
|
*header = '\0';
|
||||||
cipher->cipher = enc = EVP_get_cipherbyname(p);
|
cipher->cipher = enc = EVP_get_cipherbyname(dekinfostart);
|
||||||
*header = c;
|
*header = c;
|
||||||
header++;
|
|
||||||
|
|
||||||
if (enc == NULL) {
|
if (enc == NULL) {
|
||||||
PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO, PEM_R_UNSUPPORTED_ENCRYPTION);
|
PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO, PEM_R_UNSUPPORTED_ENCRYPTION);
|
||||||
|
|
Loading…
Reference in a new issue