[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openssl-dev
Subject:    Re: [openssl-dev] API Problems in current master
From:       Rainer Jung <rainer.jung () kippdata ! de>
Date:       2016-03-13 14:41:21
Message-ID: 56E57C11.1090202 () kippdata ! de
[Download RAW message or body]

Am 13.03.2016 um 14:34 schrieb Richard Moore:
> I'm currently testing the new release by trying to port Qt to use it
> (with the compatibility stuff disabled). Here are the first problems
> I've hit:
>
> How do we get the certificate serial number? We were doing
> x509->cert_info->serialNumber to get it as an ASN1_INTEGER.

ASN1_INTEGER *X509_get_serialNumber(X509 *x);

implemented in crypto/x509/x509_cmp.c:

ASN1_INTEGER *X509_get_serialNumber(X509 *a)
{
     return &a->cert_info.serialNumber;
}

> https://www.openssl.org/docs/manmaster/crypto/EVP_PKEY_type.html says:
> "EVP_PKEY_type() returns the type of key corresponding to the value
> type. The type of a key can be obtained with EVP_PKEY_type(pkey->type)."
> except it can't
> because the structure is now opaque.

The docs should be fixed, but there's:

int EVP_PKEY_id(const EVP_PKEY *pkey);
int EVP_PKEY_base_id(const EVP_PKEY *pkey);

implemented in crypto/evp/p_lib.c:

int EVP_PKEY_id(const EVP_PKEY *pkey)
{
     return pkey->type;
}

int EVP_PKEY_base_id(const EVP_PKEY *pkey)
{
     return EVP_PKEY_type(pkey->type);
}

HTH

Regards,

Rainer
-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic