mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-11-26 23:42:59 +00:00
Minor simplification of _SSL_get_cert_info ()
Instead of retrieving the AlgorithmIdentifier and then reaching into it to get the OID, the relevant OID can be obtained directly from the same function.
This commit is contained in:
1 parent
5af8f4ede1
commit
e1c44feb01
1 file changed
+3
-3
+3
-3
@@ -155,7 +155,7 @@ _SSL_get_cert_info (struct cert_info *cert_info, SSL * ssl)
|
|||||||
{
|
{
|
||||||
X509 *peer_cert;
|
X509 *peer_cert;
|
||||||
const X509_PUBKEY *key;
|
const X509_PUBKEY *key;
|
||||||
X509_ALGOR *algor = NULL;
|
ASN1_OBJECT *obj = NULL;
|
||||||
EVP_PKEY *peer_pkey;
|
EVP_PKEY *peer_pkey;
|
||||||
char notBefore[64];
|
char notBefore[64];
|
||||||
char notAfter[64];
|
char notAfter[64];
|
||||||
@@ -174,10 +174,10 @@ _SSL_get_cert_info (struct cert_info *cert_info, SSL * ssl)
|
|||||||
broke_oneline (cert_info->issuer, cert_info->issuer_word);
|
broke_oneline (cert_info->issuer, cert_info->issuer_word);
|
||||||
|
|
||||||
key = X509_get_X509_PUBKEY(peer_cert);
|
key = X509_get_X509_PUBKEY(peer_cert);
|
||||||
if (!X509_PUBKEY_get0_param(NULL, NULL, 0, &algor, key))
|
if (!X509_PUBKEY_get0_param(&obj, NULL, NULL, NULL, key))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
alg = OBJ_obj2nid (algor->algorithm);
|
alg = OBJ_obj2nid (obj);
|
||||||
#ifndef HAVE_X509_GET_SIGNATURE_NID
|
#ifndef HAVE_X509_GET_SIGNATURE_NID
|
||||||
sign_alg = OBJ_obj2nid (peer_cert->sig_alg->algorithm);
|
sign_alg = OBJ_obj2nid (peer_cert->sig_alg->algorithm);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in new issue
Block a user