mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-25 02:45:32 +00:00
Improve docs for ASN.1 bitstrings and their usage
This commit is contained in:
parent
abb7622d08
commit
e730ff68ee
|
@ -189,16 +189,18 @@ int mbedtls_asn1_write_ia5_string( unsigned char **p, unsigned char *start,
|
||||||
const char *text, size_t text_len );
|
const char *text, size_t text_len );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Write a bitstring tag (MBEDTLS_ASN1_BIT_STRING) and
|
* \brief Write a bitstring tag (#MBEDTLS_ASN1_BIT_STRING) and
|
||||||
* value in ASN.1 format
|
* value in ASN.1 format.
|
||||||
* Note: function works backwards in data buffer
|
|
||||||
*
|
*
|
||||||
* \param p reference to current position pointer
|
* \note This function works backwards in data buffer.
|
||||||
* \param start start of the buffer (for bounds-checking)
|
|
||||||
* \param buf the bitstring
|
|
||||||
* \param bits the total number of bits in the bitstring
|
|
||||||
*
|
*
|
||||||
* \return the length written or a negative error code
|
* \param p The reference to the current position pointer.
|
||||||
|
* \param start The start of the buffer, for bounds-checking.
|
||||||
|
* \param buf The bitstring to write.
|
||||||
|
* \param bits The total number of bits in the bitstring.
|
||||||
|
*
|
||||||
|
* \return The number of bytes written to \p p on success.
|
||||||
|
* \return A negative error code on failure.
|
||||||
*/
|
*/
|
||||||
int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start,
|
int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start,
|
||||||
const unsigned char *buf, size_t bits );
|
const unsigned char *buf, size_t bits );
|
||||||
|
|
|
@ -205,6 +205,14 @@ void mbedtls_x509write_csr_set_md_alg( mbedtls_x509write_csr *ctx, mbedtls_md_ty
|
||||||
* \param key_usage key usage flags to set
|
* \param key_usage key usage flags to set
|
||||||
*
|
*
|
||||||
* \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
|
* \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED
|
||||||
|
*
|
||||||
|
* \note The <code>decipherOnly</code> flag from the Key Usage
|
||||||
|
* extension is represented by bit 8 (i.e.
|
||||||
|
* <code>0x8000</code>), which cannot typically be represented
|
||||||
|
* in an unsigned char. Therefore, the flag
|
||||||
|
* <code>decipherOnly</code> (i.e.
|
||||||
|
* #MBEDTLS_X509_KU_DECIPHER_ONLY) cannot be set using this
|
||||||
|
* function.
|
||||||
*/
|
*/
|
||||||
int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned char key_usage );
|
int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned char key_usage );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue