提交 33a6d5a0 编写于 作者: D Dmitry-Me 提交者: Rich Salz

GH643: Cleanup header analysis

Signed-off-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NKurt Roeckx <kurt@openssl.org>
上级 5b326dc5
......@@ -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)
{
const EVP_CIPHER *enc = NULL;
char *p, c;
char *dekinfostart, c;
char **header_pp = &header;
cipher->cipher = NULL;
......@@ -521,7 +521,7 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
}
header += 10;
p = header;
dekinfostart = header;
for (;;) {
c = *header;
#ifndef CHARSET_EBCDIC
......@@ -535,9 +535,8 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher)
header++;
}
*header = '\0';
cipher->cipher = enc = EVP_get_cipherbyname(p);
cipher->cipher = enc = EVP_get_cipherbyname(dekinfostart);
*header = c;
header++;
if (enc == NULL) {
PEMerr(PEM_F_PEM_GET_EVP_CIPHER_INFO, PEM_R_UNSUPPORTED_ENCRYPTION);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册