[openssl-dev] API Problems in current master

Rainer Jung rainer.jung at kippdata.de
Sun Mar 13 14:41:21 UTC 2016


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


More information about the openssl-dev mailing list