@ -60,17 +60,16 @@
# include <openssl/thread.h>
# include <openssl/thread.h>
# include <openssl/x509.h>
# include <openssl/x509.h>
# include "internal.h"
/*
/*
* X509_REQ_INFO is handled in an unusual way to get round invalid encodings .
* X509_REQ_INFO is handled in an unusual way to get round invalid encodings .
* Some broken certificate requests don ' t encode the attributes field if it
* Some broken certificate requests don ' t encode the attributes field if it
* is empty . This is in violation of PKCS # 10 but we need to tolerate it . We
* is empty . This is in violation of PKCS # 10 but we need to tolerate it . We
* do this by making the attributes field OPTIONAL then using the callback to
* do this by making the attributes field OPTIONAL then using the callback to
* initialise it to an empty STACK . This means that the field will be
* initialise it to an empty STACK . This means that the field will be
* correctly encoded unless we NULL out the field . As a result we no longer
* correctly encoded unless we NULL out the field .
* need the req_kludge field because the information is now contained in the
* attributes field : 1. If it is NULL then it ' s the invalid omission . 2. If
* it is empty it is the correct encoding . 3. If it is not empty then some
* attributes are present .
*/
*/
static int rinf_cb ( int operation , ASN1_VALUE * * pval , const ASN1_ITEM * it ,
static int rinf_cb ( int operation , ASN1_VALUE * * pval , const ASN1_ITEM * it ,
@ -90,9 +89,7 @@ ASN1_SEQUENCE_enc(X509_REQ_INFO, enc, rinf_cb) = {
ASN1_SIMPLE ( X509_REQ_INFO , version , ASN1_INTEGER ) ,
ASN1_SIMPLE ( X509_REQ_INFO , version , ASN1_INTEGER ) ,
ASN1_SIMPLE ( X509_REQ_INFO , subject , X509_NAME ) ,
ASN1_SIMPLE ( X509_REQ_INFO , subject , X509_NAME ) ,
ASN1_SIMPLE ( X509_REQ_INFO , pubkey , X509_PUBKEY ) ,
ASN1_SIMPLE ( X509_REQ_INFO , pubkey , X509_PUBKEY ) ,
/* This isn't really OPTIONAL but it gets round invalid
/* This isn't really OPTIONAL but it gets around invalid encodings. */
* encodings
*/
ASN1_IMP_SET_OF_OPT ( X509_REQ_INFO , attributes , X509_ATTRIBUTE , 0 )
ASN1_IMP_SET_OF_OPT ( X509_REQ_INFO , attributes , X509_ATTRIBUTE , 0 )
} ASN1_SEQUENCE_END_enc ( X509_REQ_INFO , X509_REQ_INFO )
} ASN1_SEQUENCE_END_enc ( X509_REQ_INFO , X509_REQ_INFO )