ssl/s2_srvr.c:900: error: BUFFER_OVERRUN_L1
  Offset: [6, +oo] (⇐ [6, +oo] + [0, +oo]) Size: 1 by call to `i2d_X509`.
Showing all 40 steps of the trace


ssl/s2_srvr.c:875:15: Call
873.   		}
874.   
875.   	x509=(X509 *)d2i_X509(NULL,&p,(long)s->s2->tmp.clen);
                     ^
876.   	if (x509 == NULL)
877.   		{

crypto/asn1/x_x509.c:105:2: Assignment
  103.   	ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);
  104.   
  105.   	M_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509);
          ^
  106.   	}
  107.   

ssl/s2_srvr.c:875:2: Assignment
873.   		}
874.   
875.   	x509=(X509 *)d2i_X509(NULL,&p,(long)s->s2->tmp.clen);
        ^
876.   	if (x509 == NULL)
877.   		{

ssl/s2_srvr.c:882:45: Call
880.   		}
881.   
882.   	if (((sk=sk_X509_new_null()) == NULL) || (!sk_X509_push(sk,x509)))
                                                   ^
883.   		{
884.   		SSLerr(SSL_F_REQUEST_CERTIFICATE,ERR_R_MALLOC_FAILURE);

crypto/x509/x509_vfy.c:633:1: Parameter `*v`
  631.   	}
  632.   
  633. > IMPLEMENT_STACK_OF(X509)
  634.   IMPLEMENT_ASN1_SET_OF(X509)
  635.   

crypto/x509/x509_vfy.c:633:1: Call
  631.   	}
  632.   
  633. > IMPLEMENT_STACK_OF(X509)
  634.   IMPLEMENT_ASN1_SET_OF(X509)
  635.   

crypto/stack/stack.c:233:1: Parameter `*data`
    231.   	}
    232.   
    233. > int sk_push(STACK *st, char *data)
    234.   	{
    235.   	return(sk_insert(st,data,st->num));

crypto/stack/stack.c:235:9: Call
    233.   int sk_push(STACK *st, char *data)
    234.   	{
    235.   	return(sk_insert(st,data,st->num));
                   ^
    236.   	}
    237.   

crypto/stack/stack.c:134:1: Parameter `**st->data`
      132.   	}
      133.   
      134. > int sk_insert(STACK *st, char *data, int loc)
      135.   	{
      136.   	char **s;

ssl/s2_srvr.c:900:5: Call
898.   		EVP_VerifyUpdate(&ctx,ccd,SSL2_MIN_CERT_CHALLENGE_LENGTH);
899.   
900.   		i=i2d_X509(s->cert->pkeys[SSL_PKEY_RSA_ENC].x509,NULL);
           ^
901.   		buf2=(unsigned char *)Malloc((unsigned int)i);
902.   		if (buf2 == NULL)

crypto/asn1/x_x509.c:76:1: Parameter `**pp`
  74.   	}
  75.   
  76. > int i2d_X509(X509 *a, unsigned char **pp)
  77.   	{
  78.   	M_ASN1_I2D_vars(a);

crypto/asn1/x_x509.c:84:2: Assignment
  82.   	M_ASN1_I2D_len(a->signature,	i2d_ASN1_BIT_STRING);
  83.   
  84.   	M_ASN1_I2D_seq_total();
         ^
  85.   
  86.   	M_ASN1_I2D_put(a->cert_info,	i2d_X509_CINF);

crypto/asn1/x_x509.c:84:2: Call
  82.   	M_ASN1_I2D_len(a->signature,	i2d_ASN1_BIT_STRING);
  83.   
  84.   	M_ASN1_I2D_seq_total();
         ^
  85.   
  86.   	M_ASN1_I2D_put(a->cert_info,	i2d_X509_CINF);

crypto/asn1/asn1_lib.c:180:1: Parameter `**pp`
    178.   /* class 0 is constructed
    179.    * constructed == 2 for indefinitle length constructed */
    180. > void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
    181.   	     int xclass)
    182.   	{

crypto/asn1/asn1_lib.c:183:2: Assignment
    181.   	     int xclass)
    182.   	{
    183.   	unsigned char *p= *pp;
            ^
    184.   	int i;
    185.   

crypto/asn1/asn1_lib.c:189:5: Assignment
    187.   	i|=(xclass&V_ASN1_PRIVATE);
    188.   	if (tag < 31)
    189.   		*(p++)=i|(tag&V_ASN1_PRIMITIVE_TAG);
               ^
    190.   	else
    191.   		{

crypto/asn1/asn1_lib.c:201:5: Assignment
    199.   		}
    200.   	if ((constructed == 2) && (length == 0))
    201.   		*(p++)=0x80; /* der_put_length would output 0 instead */
               ^
    202.   	else
    203.   		asn1_put_length(&p,length);

crypto/asn1/asn1_lib.c:204:2: Assignment
    202.   	else
    203.   		asn1_put_length(&p,length);
    204.   	*pp=p;
            ^
    205.   	}
    206.   

crypto/asn1/x_x509.c:86:2: Call
  84.   	M_ASN1_I2D_seq_total();
  85.   
  86.   	M_ASN1_I2D_put(a->cert_info,	i2d_X509_CINF);
         ^
  87.   	M_ASN1_I2D_put(a->sig_alg,	i2d_X509_ALGOR);
  88.   	M_ASN1_I2D_put(a->signature,	i2d_ASN1_BIT_STRING);

crypto/asn1/x_cinf.c:64:1: Parameter `**pp`
    62.   #include <openssl/x509.h>
    63.   
    64. > int i2d_X509_CINF(X509_CINF *a, unsigned char **pp)
    65.   	{
    66.   	int v1=0,v2=0;

crypto/asn1/x_cinf.c:82:2: Assignment
    80.   					     V_ASN1_SEQUENCE,v2);
    81.   
    82.   	M_ASN1_I2D_seq_total();
           ^
    83.   
    84.   	M_ASN1_I2D_put_EXP_opt(a->version,i2d_ASN1_INTEGER,0,v1);

crypto/asn1/x_cinf.c:82:2: Call
    80.   					     V_ASN1_SEQUENCE,v2);
    81.   
    82.   	M_ASN1_I2D_seq_total();
           ^
    83.   
    84.   	M_ASN1_I2D_put_EXP_opt(a->version,i2d_ASN1_INTEGER,0,v1);

crypto/asn1/asn1_lib.c:180:1: Parameter `**pp`
      178.   /* class 0 is constructed
      179.    * constructed == 2 for indefinitle length constructed */
      180. > void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
      181.   	     int xclass)
      182.   	{

crypto/asn1/asn1_lib.c:183:2: Assignment
      181.   	     int xclass)
      182.   	{
      183.   	unsigned char *p= *pp;
              ^
      184.   	int i;
      185.   

crypto/asn1/asn1_lib.c:189:5: Assignment
      187.   	i|=(xclass&V_ASN1_PRIVATE);
      188.   	if (tag < 31)
      189.   		*(p++)=i|(tag&V_ASN1_PRIMITIVE_TAG);
                 ^
      190.   	else
      191.   		{

crypto/asn1/asn1_lib.c:201:5: Assignment
      199.   		}
      200.   	if ((constructed == 2) && (length == 0))
      201.   		*(p++)=0x80; /* der_put_length would output 0 instead */
                 ^
      202.   	else
      203.   		asn1_put_length(&p,length);

crypto/asn1/asn1_lib.c:204:2: Assignment
      202.   	else
      203.   		asn1_put_length(&p,length);
      204.   	*pp=p;
              ^
      205.   	}
      206.   

crypto/asn1/x_cinf.c:84:2: Call
    82.   	M_ASN1_I2D_seq_total();
    83.   
    84.   	M_ASN1_I2D_put_EXP_opt(a->version,i2d_ASN1_INTEGER,0,v1);
           ^
    85.   	M_ASN1_I2D_put(a->serialNumber,		i2d_ASN1_INTEGER);
    86.   	M_ASN1_I2D_put(a->signature,		i2d_X509_ALGOR);

crypto/asn1/asn1_lib.c:180:1: Parameter `**pp`
      178.   /* class 0 is constructed
      179.    * constructed == 2 for indefinitle length constructed */
      180. > void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
      181.   	     int xclass)
      182.   	{

crypto/asn1/asn1_lib.c:183:2: Assignment
      181.   	     int xclass)
      182.   	{
      183.   	unsigned char *p= *pp;
              ^
      184.   	int i;
      185.   

crypto/asn1/asn1_lib.c:189:5: Assignment
      187.   	i|=(xclass&V_ASN1_PRIVATE);
      188.   	if (tag < 31)
      189.   		*(p++)=i|(tag&V_ASN1_PRIMITIVE_TAG);
                 ^
      190.   	else
      191.   		{

crypto/asn1/asn1_lib.c:203:3: Call
      201.   		*(p++)=0x80; /* der_put_length would output 0 instead */
      202.   	else
      203.   		asn1_put_length(&p,length);
               ^
      204.   	*pp=p;
      205.   	}

crypto/asn1/asn1_lib.c:216:8: <Offset trace>
214.   		{
215.   		l=length;
216.   		for (i=0; l > 0; i++)
              ^
217.   			l>>=8;
218.   		*(p++)=i|0x80;

crypto/asn1/asn1_lib.c:216:8: Assignment
        214.   		{
        215.   		l=length;
        216.   		for (i=0; l > 0; i++)
                      ^
        217.   			l>>=8;
        218.   		*(p++)=i|0x80;

crypto/asn1/asn1_lib.c:220:10: Assignment
        218.   		*(p++)=i|0x80;
        219.   		l=i;
        220.   		while (i-- > 0)
                        ^
        221.   			{
        222.   			p[i]=length&0xff;

crypto/asn1/asn1_lib.c:207:1: <Length trace>
205.   	}
206.   
207. > static void asn1_put_length(unsigned char **pp, int length)
208.   	{
209.   	unsigned char *p= *pp;

crypto/asn1/asn1_lib.c:207:1: Parameter `**pp`
        205.   	}
        206.   
        207. > static void asn1_put_length(unsigned char **pp, int length)
        208.   	{
        209.   	unsigned char *p= *pp;

crypto/asn1/asn1_lib.c:209:2: Assignment
        207.   static void asn1_put_length(unsigned char **pp, int length)
        208.   	{
        209.   	unsigned char *p= *pp;
                ^
        210.   	int i,l;
        211.   	if (length <= 127)

crypto/asn1/asn1_lib.c:218:5: Assignment
        216.   		for (i=0; l > 0; i++)
        217.   			l>>=8;
        218.   		*(p++)=i|0x80;
                   ^
        219.   		l=i;
        220.   		while (i-- > 0)

crypto/asn1/asn1_lib.c:222:4: Array access: Offset: [6, +oo] (⇐ [6, +oo] + [0, +oo]) Size: 1 by call to `i2d_X509` 
        220.   		while (i-- > 0)
        221.   			{
        222.   			p[i]=length&0xff;
                  ^
        223.   			length>>=8;
        224.   			}

static void asn1_put_length(unsigned char **pp, int length)
	{
	unsigned char *p= *pp;
	int i,l;
	if (length <= 127)
		*(p++)=(unsigned char)length;
	else
		{
		l=length;
		for (i=0; l > 0; i++)
			l>>=8;
		*(p++)=i|0x80;
		l=i;
		while (i-- > 0)
			{
			p[i]=length&0xff;
			length>>=8;
			}
		p+=l;
		}
	*pp=p;
	}
['static int request_certificate(SSL *s)\n\t{\n\tunsigned char *p,*p2,*buf2;\n\tunsigned char *ccd;\n\tint i,j,ctype,ret= -1;\n\tX509 *x509=NULL;\n\tSTACK_OF(X509) *sk=NULL;\n\tccd=s->s2->tmp.ccl;\n\tif (s->state == SSL2_ST_SEND_REQUEST_CERTIFICATE_A)\n\t\t{\n\t\tp=(unsigned char *)s->init_buf->data;\n\t\t*(p++)=SSL2_MT_REQUEST_CERTIFICATE;\n\t\t*(p++)=SSL2_AT_MD5_WITH_RSA_ENCRYPTION;\n\t\tRAND_bytes(ccd,SSL2_MIN_CERT_CHALLENGE_LENGTH);\n\t\tmemcpy(p,ccd,SSL2_MIN_CERT_CHALLENGE_LENGTH);\n\t\ts->state=SSL2_ST_SEND_REQUEST_CERTIFICATE_B;\n\t\ts->init_num=SSL2_MIN_CERT_CHALLENGE_LENGTH+2;\n\t\ts->init_off=0;\n\t\t}\n\tif (s->state == SSL2_ST_SEND_REQUEST_CERTIFICATE_B)\n\t\t{\n\t\ti=ssl2_do_write(s);\n\t\tif (i <= 0)\n\t\t\t{\n\t\t\tret=i;\n\t\t\tgoto end;\n\t\t\t}\n\t\ts->init_num=0;\n\t\ts->state=SSL2_ST_SEND_REQUEST_CERTIFICATE_C;\n\t\t}\n\tif (s->state == SSL2_ST_SEND_REQUEST_CERTIFICATE_C)\n\t\t{\n\t\tp=(unsigned char *)s->init_buf->data;\n\t\ti=ssl2_read(s,(char *)&(p[s->init_num]),6-s->init_num);\n\t\tif (i < 3)\n\t\t\t{\n\t\t\tret=ssl2_part_read(s,SSL_F_REQUEST_CERTIFICATE,i);\n\t\t\tgoto end;\n\t\t\t}\n\t\tif ((*p == SSL2_MT_ERROR) && (i >= 3))\n\t\t\t{\n\t\t\tn2s(p,i);\n\t\t\tif (s->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT)\n\t\t\t\t{\n\t\t\t\tssl2_return_error(s,SSL2_PE_BAD_CERTIFICATE);\n\t\t\t\tSSLerr(SSL_F_REQUEST_CERTIFICATE,SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE);\n\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\tret=1;\n\t\t\tgoto end;\n\t\t\t}\n\t\tif ((*(p++) != SSL2_MT_CLIENT_CERTIFICATE) || (i < 6))\n\t\t\t{\n\t\t\tssl2_return_error(s,SSL2_PE_UNDEFINED_ERROR);\n\t\t\tSSLerr(SSL_F_REQUEST_CERTIFICATE,SSL_R_SHORT_READ);\n\t\t\tgoto end;\n\t\t\t}\n\t\tctype= *(p++);\n\t\tif (ctype != SSL2_AT_MD5_WITH_RSA_ENCRYPTION)\n\t\t\t{\n\t\t\tssl2_return_error(s,SSL2_PE_UNSUPPORTED_CERTIFICATE_TYPE);\n\t\t\tSSLerr(SSL_F_REQUEST_CERTIFICATE,SSL_R_BAD_RESPONSE_ARGUMENT);\n\t\t\tgoto end;\n\t\t\t}\n\t\tn2s(p,i); s->s2->tmp.clen=i;\n\t\tn2s(p,i); s->s2->tmp.rlen=i;\n\t\ts->state=SSL2_ST_SEND_REQUEST_CERTIFICATE_D;\n\t\ts->init_num=0;\n\t\t}\n\tp=(unsigned char *)s->init_buf->data;\n\tj=s->s2->tmp.clen+s->s2->tmp.rlen-s->init_num;\n\ti=ssl2_read(s,(char *)&(p[s->init_num]),j);\n\tif (i < j)\n\t\t{\n\t\tret=ssl2_part_read(s,SSL_F_REQUEST_CERTIFICATE,i);\n\t\tgoto end;\n\t\t}\n\tx509=(X509 *)d2i_X509(NULL,&p,(long)s->s2->tmp.clen);\n\tif (x509 == NULL)\n\t\t{\n\t\tSSLerr(SSL_F_REQUEST_CERTIFICATE,ERR_R_X509_LIB);\n\t\tgoto msg_end;\n\t\t}\n\tif (((sk=sk_X509_new_null()) == NULL) || (!sk_X509_push(sk,x509)))\n\t\t{\n\t\tSSLerr(SSL_F_REQUEST_CERTIFICATE,ERR_R_MALLOC_FAILURE);\n\t\tgoto msg_end;\n\t\t}\n\ti=ssl_verify_cert_chain(s,sk);\n\tif (i)\n\t\t{\n\t\tEVP_MD_CTX ctx;\n\t\tEVP_PKEY *pkey=NULL;\n\t\tEVP_VerifyInit(&ctx,s->ctx->rsa_md5);\n\t\tEVP_VerifyUpdate(&ctx,s->s2->key_material,\n\t\t\t(unsigned int)s->s2->key_material_length);\n\t\tEVP_VerifyUpdate(&ctx,ccd,SSL2_MIN_CERT_CHALLENGE_LENGTH);\n\t\ti=i2d_X509(s->cert->pkeys[SSL_PKEY_RSA_ENC].x509,NULL);\n\t\tbuf2=(unsigned char *)Malloc((unsigned int)i);\n\t\tif (buf2 == NULL)\n\t\t\t{\n\t\t\tSSLerr(SSL_F_REQUEST_CERTIFICATE,ERR_R_MALLOC_FAILURE);\n\t\t\tgoto msg_end;\n\t\t\t}\n\t\tp2=buf2;\n\t\ti=i2d_X509(s->cert->pkeys[SSL_PKEY_RSA_ENC].x509,&p2);\n\t\tEVP_VerifyUpdate(&ctx,buf2,(unsigned int)i);\n\t\tFree(buf2);\n\t\tpkey=X509_get_pubkey(x509);\n\t\tif (pkey == NULL) goto end;\n\t\ti=EVP_VerifyFinal(&ctx,p,s->s2->tmp.rlen,pkey);\n\t\tEVP_PKEY_free(pkey);\n\t\tmemset(&ctx,0,sizeof(ctx));\n\t\tif (i)\n\t\t\t{\n\t\t\tif (s->session->peer != NULL)\n\t\t\t\tX509_free(s->session->peer);\n\t\t\ts->session->peer=x509;\n\t\t\tCRYPTO_add(&x509->references,1,CRYPTO_LOCK_X509);\n\t\t\tret=1;\n\t\t\tgoto end;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tSSLerr(SSL_F_REQUEST_CERTIFICATE,SSL_R_BAD_CHECKSUM);\n\t\t\tgoto msg_end;\n\t\t\t}\n\t\t}\n\telse\n\t\t{\nmsg_end:\n\t\tssl2_return_error(s,SSL2_PE_BAD_CERTIFICATE);\n\t\t}\nend:\n\tsk_X509_free(sk);\n\tX509_free(x509);\n\treturn(ret);\n\t}', 'X509 *d2i_X509(X509 **a, unsigned char **pp, long length)\n\t{\n\tM_ASN1_D2I_vars(a,X509 *,X509_new);\n\tM_ASN1_D2I_Init();\n\tM_ASN1_D2I_start_sequence();\n\tM_ASN1_D2I_get(ret->cert_info,d2i_X509_CINF);\n\tM_ASN1_D2I_get(ret->sig_alg,d2i_X509_ALGOR);\n\tM_ASN1_D2I_get(ret->signature,d2i_ASN1_BIT_STRING);\n\tif (ret->name != NULL) Free(ret->name);\n\tret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);\n\tM_ASN1_D2I_Finish(a,X509_free,ASN1_F_D2I_X509);\n\t}', 'IMPLEMENT_STACK_OF(X509)', 'int sk_push(STACK *st, char *data)\n\t{\n\treturn(sk_insert(st,data,st->num));\n\t}', 'int sk_insert(STACK *st, char *data, int loc)\n\t{\n\tchar **s;\n\tif(st == NULL) return 0;\n\tif (st->num_alloc <= st->num+1)\n\t\t{\n\t\ts=(char **)Realloc((char *)st->data,\n\t\t\t(unsigned int)sizeof(char *)*st->num_alloc*2);\n\t\tif (s == NULL)\n\t\t\treturn(0);\n\t\tst->data=s;\n\t\tst->num_alloc*=2;\n\t\t}\n\tif ((loc >= (int)st->num) || (loc < 0))\n\t\tst->data[st->num]=data;\n\telse\n\t\t{\n\t\tint i;\n\t\tchar **f,**t;\n\t\tf=(char **)st->data;\n\t\tt=(char **)&(st->data[1]);\n\t\tfor (i=st->num; i>=loc; i--)\n\t\t\tt[i]=f[i];\n#ifdef undef\n\t\tmemmove( (char *)&(st->data[loc+1]),\n\t\t\t(char *)&(st->data[loc]),\n\t\t\tsizeof(char *)*(st->num-loc));\n#endif\n\t\tst->data[loc]=data;\n\t\t}\n\tst->num++;\n\tst->sorted=0;\n\treturn(st->num);\n\t}', 'int i2d_X509(X509 *a, unsigned char **pp)\n\t{\n\tM_ASN1_I2D_vars(a);\n\tM_ASN1_I2D_len(a->cert_info,\ti2d_X509_CINF);\n\tM_ASN1_I2D_len(a->sig_alg,\ti2d_X509_ALGOR);\n\tM_ASN1_I2D_len(a->signature,\ti2d_ASN1_BIT_STRING);\n\tM_ASN1_I2D_seq_total();\n\tM_ASN1_I2D_put(a->cert_info,\ti2d_X509_CINF);\n\tM_ASN1_I2D_put(a->sig_alg,\ti2d_X509_ALGOR);\n\tM_ASN1_I2D_put(a->signature,\ti2d_ASN1_BIT_STRING);\n\tM_ASN1_I2D_finish();\n\t}', 'void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,\n\t     int xclass)\n\t{\n\tunsigned char *p= *pp;\n\tint i;\n\ti=(constructed)?V_ASN1_CONSTRUCTED:0;\n\ti|=(xclass&V_ASN1_PRIVATE);\n\tif (tag < 31)\n\t\t*(p++)=i|(tag&V_ASN1_PRIMITIVE_TAG);\n\telse\n\t\t{\n\t\t*(p++)=i|V_ASN1_PRIMITIVE_TAG;\n\t\twhile (tag > 0x7f)\n\t\t\t{\n\t\t\t*(p++)=(tag&0x7f)|0x80;\n\t\t\ttag>>=7;\n\t\t\t}\n\t\t*(p++)=(tag&0x7f);\n\t\t}\n\tif ((constructed == 2) && (length == 0))\n\t\t*(p++)=0x80;\n\telse\n\t\tasn1_put_length(&p,length);\n\t*pp=p;\n\t}', 'int i2d_X509_CINF(X509_CINF *a, unsigned char **pp)\n\t{\n\tint v1=0,v2=0;\n\tM_ASN1_I2D_vars(a);\n\tM_ASN1_I2D_len_EXP_opt(a->version,i2d_ASN1_INTEGER,0,v1);\n\tM_ASN1_I2D_len(a->serialNumber,\t\ti2d_ASN1_INTEGER);\n\tM_ASN1_I2D_len(a->signature,\t\ti2d_X509_ALGOR);\n\tM_ASN1_I2D_len(a->issuer,\t\ti2d_X509_NAME);\n\tM_ASN1_I2D_len(a->validity,\t\ti2d_X509_VAL);\n\tM_ASN1_I2D_len(a->subject,\t\ti2d_X509_NAME);\n\tM_ASN1_I2D_len(a->key,\t\t\ti2d_X509_PUBKEY);\n\tM_ASN1_I2D_len_IMP_opt(a->issuerUID,\ti2d_ASN1_BIT_STRING);\n\tM_ASN1_I2D_len_IMP_opt(a->subjectUID,\ti2d_ASN1_BIT_STRING);\n\tM_ASN1_I2D_len_EXP_SEQUENCE_opt_type(X509_EXTENSION,a->extensions,\n\t\t\t\t\t     i2d_X509_EXTENSION,3,\n\t\t\t\t\t     V_ASN1_SEQUENCE,v2);\n\tM_ASN1_I2D_seq_total();\n\tM_ASN1_I2D_put_EXP_opt(a->version,i2d_ASN1_INTEGER,0,v1);\n\tM_ASN1_I2D_put(a->serialNumber,\t\ti2d_ASN1_INTEGER);\n\tM_ASN1_I2D_put(a->signature,\t\ti2d_X509_ALGOR);\n\tM_ASN1_I2D_put(a->issuer,\t\ti2d_X509_NAME);\n\tM_ASN1_I2D_put(a->validity,\t\ti2d_X509_VAL);\n\tM_ASN1_I2D_put(a->subject,\t\ti2d_X509_NAME);\n\tM_ASN1_I2D_put(a->key,\t\t\ti2d_X509_PUBKEY);\n\tM_ASN1_I2D_put_IMP_opt(a->issuerUID,\ti2d_ASN1_BIT_STRING,1);\n\tM_ASN1_I2D_put_IMP_opt(a->subjectUID,\ti2d_ASN1_BIT_STRING,2);\n\tM_ASN1_I2D_put_EXP_SEQUENCE_opt_type(X509_EXTENSION,a->extensions,\n\t\t\t\t\t     i2d_X509_EXTENSION,3,\n\t\t\t\t\t     V_ASN1_SEQUENCE,v2);\n\tM_ASN1_I2D_finish();\n\t}', 'static void asn1_put_length(unsigned char **pp, int length)\n\t{\n\tunsigned char *p= *pp;\n\tint i,l;\n\tif (length <= 127)\n\t\t*(p++)=(unsigned char)length;\n\telse\n\t\t{\n\t\tl=length;\n\t\tfor (i=0; l > 0; i++)\n\t\t\tl>>=8;\n\t\t*(p++)=i|0x80;\n\t\tl=i;\n\t\twhile (i-- > 0)\n\t\t\t{\n\t\t\tp[i]=length&0xff;\n\t\t\tlength>>=8;\n\t\t\t}\n\t\tp+=l;\n\t\t}\n\t*pp=p;\n\t}']