Added x509 accessors for the SEP build certificate additions.

This commit is contained in:
John Safranek
2013-08-17 09:01:15 -07:00
parent 19f7053f1d
commit 442886a207
4 changed files with 85 additions and 0 deletions

View File

@@ -7011,6 +7011,48 @@ int CyaSSL_set_compression(CYASSL* ssl)
return x509->derCert.buffer;
}
#ifdef CYASSL_SEP
int CyaSSL_X509_get_device_type(CYASSL_X509* x509, byte* in, int *inOutSz)
{
CYASSL_ENTER("CyaSSL_X509_get_dev_type");
if (x509 == NULL || inOutSz == NULL || *inOutSz < x509->deviceTypeSz)
return BAD_FUNC_ARG;
XMEMCPY(in, x509->deviceType, x509->deviceTypeSz);
*inOutSz = x509->deviceTypeSz;
return SSL_SUCCESS;
}
int CyaSSL_X509_get_hw_type(CYASSL_X509* x509, byte* in, int *inOutSz)
{
CYASSL_ENTER("CyaSSL_X509_get_hw_type");
if (x509 == NULL || inOutSz == NULL || *inOutSz < x509->hwTypeSz)
return BAD_FUNC_ARG;
XMEMCPY(in, x509->hwType, x509->hwTypeSz);
*inOutSz = x509->hwTypeSz;
return SSL_SUCCESS;
}
int CyaSSL_X509_get_hw_serial_number(CYASSL_X509* x509, byte* in, int *inOutSz)
{
CYASSL_ENTER("CyaSSL_X509_get_hw_serial_number");
if (x509 == NULL || inOutSz == NULL || *inOutSz < x509->hwSerialNumSz)
return BAD_FUNC_ARG;
XMEMCPY(in, x509->hwSerialNum, x509->hwSerialNumSz);
*inOutSz = x509->hwSerialNumSz;
return SSL_SUCCESS;
}
#endif /* CYASSL_SEP */
#endif /* KEEP_PEER_CERT || SESSION_CERTS */