Made asn1_get_alg() and asn1_get_alg_null() as generic functions
A generic function for retrieving the AlgorithmIdentifier structure with its parameters and adapted X509, PKCS#5 and PKCS#12 to use them.
This commit is contained in:
parent
ce6ae233cb
commit
f8d018a274
6 changed files with 127 additions and 117 deletions
|
@ -244,6 +244,35 @@ int asn1_get_mpi( unsigned char **p,
|
|||
mpi *X );
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Retrieve an AlgorithmIdentifier ASN.1 sequence.
|
||||
* Updates the pointer to immediately behind the full AlgorithmIdentifier.
|
||||
*
|
||||
* \param p The position in the ASN.1 data
|
||||
* \param end End of data
|
||||
* \param alg The buffer to receive the OID
|
||||
* \param params The buffer to receive the params (if any)
|
||||
*
|
||||
* \return 0 if successful or a specific ASN.1 or MPI error code.
|
||||
*/
|
||||
int asn1_get_alg( unsigned char **p,
|
||||
const unsigned char *end,
|
||||
asn1_buf *alg, asn1_buf *params );
|
||||
|
||||
/**
|
||||
* Retrieve an AlgorithmIdentifier ASN.1 sequence with NULL or no params.
|
||||
* Updates the pointer to immediately behind the full AlgorithmIdentifier.
|
||||
*
|
||||
* \param p The position in the ASN.1 data
|
||||
* \param end End of data
|
||||
* \param alg The buffer to receive the OID
|
||||
*
|
||||
* \return 0 if successful or a specific ASN.1 or MPI error code.
|
||||
*/
|
||||
int asn1_get_alg_null( unsigned char **p,
|
||||
const unsigned char *end,
|
||||
asn1_buf *alg );
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue