crypto/ocsp/ocsp_ext.c:397: error: NULL_DEREFERENCE
  pointer `req_ext` last assigned on line 395 could be null and is dereferenced at line 397, column 27.
Showing all 71 steps of the trace


crypto/ocsp/ocsp_ext.c:371:1: start of procedure OCSP_check_nonce()
369.    */
370.   
371. > int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs)
372.   	{
373.   	/*

crypto/ocsp/ocsp_ext.c:383:2: 
381.   	int req_idx, resp_idx;
382.   	X509_EXTENSION *req_ext, *resp_ext;
383. > 	req_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);
384.   	resp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);
385.   	/* Check both absent */

crypto/ocsp/ocsp_ext.c:81:1: start of procedure OCSP_REQUEST_get_ext_by_NID()
  79.   	}
  80.   
  81. > int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos)
  82.   	{
  83.   	return(X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions,nid,lastpos));

crypto/ocsp/ocsp_ext.c:83:2: 
  81.   int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos)
  82.   	{
  83. > 	return(X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions,nid,lastpos));
  84.   	}
  85.   

crypto/x509/x509_v3.c:74:1: start of procedure X509v3_get_ext_by_NID()
    72.   	}
    73.   
    74. > int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid,
    75.   			  int lastpos)
    76.   	{

crypto/x509/x509_v3.c:79:2: 
    77.   	ASN1_OBJECT *obj;
    78.   
    79. > 	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));

crypto/objects/obj_dat.c:270:1: start of procedure OBJ_nid2obj()
      268.   	}
      269.   
      270. > ASN1_OBJECT *OBJ_nid2obj(int n)
      271.   	{
      272.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:275:7: Taking true branch
      273.   	ASN1_OBJECT ob;
      274.   
      275.   	if ((n >= 0) && (n < NUM_NID))
                   ^
      276.   		{
      277.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:275:19: Taking true branch
      273.   	ASN1_OBJECT ob;
      274.   
      275.   	if ((n >= 0) && (n < NUM_NID))
                               ^
      276.   		{
      277.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:277:8: Taking true branch
      275.   	if ((n >= 0) && (n < NUM_NID))
      276.   		{
      277.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                    ^
      278.   			{
      279.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:277:28: Taking false branch
      275.   	if ((n >= 0) && (n < NUM_NID))
      276.   		{
      277.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                        ^
      278.   			{
      279.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:282:3: 
      280.   			return(NULL);
      281.   			}
      282. > 		return((ASN1_OBJECT *)&(nid_objs[n]));
      283.   		}
      284.   	else if (added == NULL)

crypto/objects/obj_dat.c:300:2: return from a call to OBJ_nid2obj
      298.   			}
      299.   		}
      300.   	}
              ^
      301.   
      302.   const char *OBJ_nid2sn(int n)

crypto/x509/x509_v3.c:80:6: Taking false branch
    78.   
    79.   	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
               ^
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
    82.   	}

crypto/x509/x509_v3.c:81:2: Skipping X509v3_get_ext_by_OBJ(): empty list of specs
    79.   	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
           ^
    82.   	}
    83.   

crypto/x509/x509_v3.c:82:2: return from a call to X509v3_get_ext_by_NID
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
    82.   	}
           ^
    83.   
    84.   int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, ASN1_OBJECT *obj,

crypto/ocsp/ocsp_ext.c:84:2: return from a call to OCSP_REQUEST_get_ext_by_NID
  82.   	{
  83.   	return(X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions,nid,lastpos));
  84.   	}
         ^
  85.   
  86.   int OCSP_REQUEST_get_ext_by_OBJ(OCSP_REQUEST *x, ASN1_OBJECT *obj, int lastpos)

crypto/ocsp/ocsp_ext.c:384:2: 
382.   	X509_EXTENSION *req_ext, *resp_ext;
383.   	req_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);
384. > 	resp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);
385.   	/* Check both absent */
386.   	if((req_idx < 0) && (resp_idx < 0))

crypto/ocsp/ocsp_ext.c:177:1: start of procedure OCSP_BASICRESP_get_ext_by_NID()
  175.   	}
  176.   
  177. > int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos)
  178.   	{
  179.   	return(X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,nid,lastpos));

crypto/ocsp/ocsp_ext.c:179:2: 
  177.   int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos)
  178.   	{
  179. > 	return(X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,nid,lastpos));
  180.   	}
  181.   

crypto/x509/x509_v3.c:74:1: start of procedure X509v3_get_ext_by_NID()
    72.   	}
    73.   
    74. > int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid,
    75.   			  int lastpos)
    76.   	{

crypto/x509/x509_v3.c:79:2: 
    77.   	ASN1_OBJECT *obj;
    78.   
    79. > 	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));

crypto/objects/obj_dat.c:270:1: start of procedure OBJ_nid2obj()
      268.   	}
      269.   
      270. > ASN1_OBJECT *OBJ_nid2obj(int n)
      271.   	{
      272.   	ADDED_OBJ ad,*adp;

crypto/objects/obj_dat.c:275:7: Taking true branch
      273.   	ASN1_OBJECT ob;
      274.   
      275.   	if ((n >= 0) && (n < NUM_NID))
                   ^
      276.   		{
      277.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:275:19: Taking true branch
      273.   	ASN1_OBJECT ob;
      274.   
      275.   	if ((n >= 0) && (n < NUM_NID))
                               ^
      276.   		{
      277.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))

crypto/objects/obj_dat.c:277:8: Taking true branch
      275.   	if ((n >= 0) && (n < NUM_NID))
      276.   		{
      277.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                    ^
      278.   			{
      279.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:277:28: Taking false branch
      275.   	if ((n >= 0) && (n < NUM_NID))
      276.   		{
      277.   		if ((n != NID_undef) && (nid_objs[n].nid == NID_undef))
                                        ^
      278.   			{
      279.   			OBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);

crypto/objects/obj_dat.c:282:3: 
      280.   			return(NULL);
      281.   			}
      282. > 		return((ASN1_OBJECT *)&(nid_objs[n]));
      283.   		}
      284.   	else if (added == NULL)

crypto/objects/obj_dat.c:300:2: return from a call to OBJ_nid2obj
      298.   			}
      299.   		}
      300.   	}
              ^
      301.   
      302.   const char *OBJ_nid2sn(int n)

crypto/x509/x509_v3.c:80:6: Taking false branch
    78.   
    79.   	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
               ^
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
    82.   	}

crypto/x509/x509_v3.c:81:2: Skipping X509v3_get_ext_by_OBJ(): empty list of specs
    79.   	obj=OBJ_nid2obj(nid);
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
           ^
    82.   	}
    83.   

crypto/x509/x509_v3.c:82:2: return from a call to X509v3_get_ext_by_NID
    80.   	if (obj == NULL) return(-2);
    81.   	return(X509v3_get_ext_by_OBJ(x,obj,lastpos));
    82.   	}
           ^
    83.   
    84.   int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, ASN1_OBJECT *obj,

crypto/ocsp/ocsp_ext.c:180:2: return from a call to OCSP_BASICRESP_get_ext_by_NID
  178.   	{
  179.   	return(X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,nid,lastpos));
  180.   	}
          ^
  181.   
  182.   int OCSP_BASICRESP_get_ext_by_OBJ(OCSP_BASICRESP *x, ASN1_OBJECT *obj, int lastpos)

crypto/ocsp/ocsp_ext.c:386:6: Taking false branch
384.   	resp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);
385.   	/* Check both absent */
386.   	if((req_idx < 0) && (resp_idx < 0))
            ^
387.   		return 2;
388.   	/* Check in request only */

crypto/ocsp/ocsp_ext.c:389:6: Taking false branch
387.   		return 2;
388.   	/* Check in request only */
389.   	if((req_idx >= 0) && (resp_idx < 0))
            ^
390.   		return -1;
391.   	/* Check in response but not request */

crypto/ocsp/ocsp_ext.c:392:6: Taking false branch
390.   		return -1;
391.   	/* Check in response but not request */
392.   	if((req_idx < 0) && (resp_idx >= 0))
            ^
393.   		return 3;
394.   	/* Otherwise nonce in request and response so retrieve the extensions */

crypto/ocsp/ocsp_ext.c:395:2: 
393.   		return 3;
394.   	/* Otherwise nonce in request and response so retrieve the extensions */
395. > 	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
396.   	resp_ext = OCSP_BASICRESP_get_ext(bs, resp_idx);
397.   	if(ASN1_OCTET_STRING_cmp(req_ext->value, resp_ext->value))

crypto/ocsp/ocsp_ext.c:96:1: start of procedure OCSP_REQUEST_get_ext()
  94.   	}
  95.   
  96. > X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc)
  97.   	{
  98.   	return(X509v3_get_ext(x->tbsRequest->requestExtensions,loc));

crypto/ocsp/ocsp_ext.c:98:2: 
  96.   X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc)
  97.   	{
  98. > 	return(X509v3_get_ext(x->tbsRequest->requestExtensions,loc));
  99.   	}
  100.   

crypto/x509/x509_v3.c:125:1: start of procedure X509v3_get_ext()
    123.   	}
    124.   
    125. > X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)

crypto/x509/x509_v3.c:127:6: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:127:19: 
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127. > 	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
    128.   		return NULL;
    129.   	else

crypto/stack/stack.c:302:1: start of procedure sk_num()
      300.   	}
      301.   
      302. > int sk_num(const STACK *st)
      303.   {
      304.   	if(st == NULL) return -1;

crypto/stack/stack.c:304:5: Taking false branch
      302.   int sk_num(const STACK *st)
      303.   {
      304.   	if(st == NULL) return -1;
                 ^
      305.   	return st->num;
      306.   }

crypto/stack/stack.c:305:2: 
      303.   {
      304.   	if(st == NULL) return -1;
      305. > 	return st->num;
      306.   }
      307.   

crypto/stack/stack.c:306:1: return from a call to sk_num
      304.   	if(st == NULL) return -1;
      305.   	return st->num;
      306. > }
      307.   
      308.   char *sk_value(const STACK *st, int i)

crypto/x509/x509_v3.c:127:19: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                             ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:127:54: Taking true branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                                                                ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:128:3: 
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
    128. > 		return NULL;
    129.   	else
    130.   		return sk_X509_EXTENSION_value(x,loc);

crypto/x509/x509_v3.c:131:2: return from a call to X509v3_get_ext
    129.   	else
    130.   		return sk_X509_EXTENSION_value(x,loc);
    131.   	}
            ^
    132.   
    133.   X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc)

crypto/ocsp/ocsp_ext.c:99:2: return from a call to OCSP_REQUEST_get_ext
  97.   	{
  98.   	return(X509v3_get_ext(x->tbsRequest->requestExtensions,loc));
  99.   	}
          ^
  100.   
  101.   X509_EXTENSION *OCSP_REQUEST_delete_ext(OCSP_REQUEST *x, int loc)

crypto/ocsp/ocsp_ext.c:396:2: 
394.   	/* Otherwise nonce in request and response so retrieve the extensions */
395.   	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
396. > 	resp_ext = OCSP_BASICRESP_get_ext(bs, resp_idx);
397.   	if(ASN1_OCTET_STRING_cmp(req_ext->value, resp_ext->value))
398.   		return 0;

crypto/ocsp/ocsp_ext.c:192:1: start of procedure OCSP_BASICRESP_get_ext()
  190.   	}
  191.   
  192. > X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc)
  193.   	{
  194.   	return(X509v3_get_ext(x->tbsResponseData->responseExtensions,loc));

crypto/ocsp/ocsp_ext.c:194:2: 
  192.   X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc)
  193.   	{
  194. > 	return(X509v3_get_ext(x->tbsResponseData->responseExtensions,loc));
  195.   	}
  196.   

crypto/x509/x509_v3.c:125:1: start of procedure X509v3_get_ext()
    123.   	}
    124.   
    125. > X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)

crypto/x509/x509_v3.c:127:6: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:127:19: 
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127. > 	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
    128.   		return NULL;
    129.   	else

crypto/stack/stack.c:302:1: start of procedure sk_num()
      300.   	}
      301.   
      302. > int sk_num(const STACK *st)
      303.   {
      304.   	if(st == NULL) return -1;

crypto/stack/stack.c:304:5: Taking false branch
      302.   int sk_num(const STACK *st)
      303.   {
      304.   	if(st == NULL) return -1;
                 ^
      305.   	return st->num;
      306.   }

crypto/stack/stack.c:305:2: 
      303.   {
      304.   	if(st == NULL) return -1;
      305. > 	return st->num;
      306.   }
      307.   

crypto/stack/stack.c:306:1: return from a call to sk_num
      304.   	if(st == NULL) return -1;
      305.   	return st->num;
      306. > }
      307.   
      308.   char *sk_value(const STACK *st, int i)

crypto/x509/x509_v3.c:127:19: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                             ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:127:54: Taking false branch
    125.   X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)
    126.   	{
    127.   	if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)
                                                                ^
    128.   		return NULL;
    129.   	else

crypto/x509/x509_v3.c:130:3: 
    128.   		return NULL;
    129.   	else
    130. > 		return sk_X509_EXTENSION_value(x,loc);
    131.   	}
    132.   

crypto/stack/stack.c:308:1: start of procedure sk_value()
      306.   }
      307.   
      308. > char *sk_value(const STACK *st, int i)
      309.   {
      310.   	if(st == NULL) return NULL;

crypto/stack/stack.c:310:5: Taking false branch
      308.   char *sk_value(const STACK *st, int i)
      309.   {
      310.   	if(st == NULL) return NULL;
                 ^
      311.   	return st->data[i];
      312.   }

crypto/stack/stack.c:311:2: 
      309.   {
      310.   	if(st == NULL) return NULL;
      311. > 	return st->data[i];
      312.   }
      313.   

crypto/stack/stack.c:312:1: return from a call to sk_value
      310.   	if(st == NULL) return NULL;
      311.   	return st->data[i];
      312. > }
      313.   
      314.   char *sk_set(STACK *st, int i, char *value)

crypto/x509/x509_v3.c:131:2: return from a call to X509v3_get_ext
    129.   	else
    130.   		return sk_X509_EXTENSION_value(x,loc);
    131.   	}
            ^
    132.   
    133.   X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc)

crypto/ocsp/ocsp_ext.c:195:2: return from a call to OCSP_BASICRESP_get_ext
  193.   	{
  194.   	return(X509v3_get_ext(x->tbsResponseData->responseExtensions,loc));
  195.   	}
          ^
  196.   
  197.   X509_EXTENSION *OCSP_BASICRESP_delete_ext(OCSP_BASICRESP *x, int loc)

crypto/ocsp/ocsp_ext.c:397:5: 
395.   	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
396.   	resp_ext = OCSP_BASICRESP_get_ext(bs, resp_idx);
397. > 	if(ASN1_OCTET_STRING_cmp(req_ext->value, resp_ext->value))
398.   		return 0;
399.   	return 1;

int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs)
	{
	int req_idx, resp_idx;
	X509_EXTENSION *req_ext, *resp_ext;
	req_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);
	resp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);
	if((req_idx < 0) && (resp_idx < 0))
		return 2;
	if((req_idx >= 0) && (resp_idx < 0))
		return -1;
	if((req_idx < 0) && (resp_idx >= 0))
		return 3;
	req_ext = OCSP_REQUEST_get_ext(req, req_idx);
	resp_ext = OCSP_BASICRESP_get_ext(bs, resp_idx);
	if(ASN1_OCTET_STRING_cmp(req_ext->value, resp_ext->value))
		return 0;
	return 1;
	}
['int OCSP_check_nonce(OCSP_REQUEST *req, OCSP_BASICRESP *bs)\n\t{\n\tint req_idx, resp_idx;\n\tX509_EXTENSION *req_ext, *resp_ext;\n\treq_idx = OCSP_REQUEST_get_ext_by_NID(req, NID_id_pkix_OCSP_Nonce, -1);\n\tresp_idx = OCSP_BASICRESP_get_ext_by_NID(bs, NID_id_pkix_OCSP_Nonce, -1);\n\tif((req_idx < 0) && (resp_idx < 0))\n\t\treturn 2;\n\tif((req_idx >= 0) && (resp_idx < 0))\n\t\treturn -1;\n\tif((req_idx < 0) && (resp_idx >= 0))\n\t\treturn 3;\n\treq_ext = OCSP_REQUEST_get_ext(req, req_idx);\n\tresp_ext = OCSP_BASICRESP_get_ext(bs, resp_idx);\n\tif(ASN1_OCTET_STRING_cmp(req_ext->value, resp_ext->value))\n\t\treturn 0;\n\treturn 1;\n\t}', 'int OCSP_REQUEST_get_ext_by_NID(OCSP_REQUEST *x, int nid, int lastpos)\n\t{\n\treturn(X509v3_get_ext_by_NID(x->tbsRequest->requestExtensions,nid,lastpos));\n\t}', 'int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid,\n\t\t\t  int lastpos)\n\t{\n\tASN1_OBJECT *obj;\n\tobj=OBJ_nid2obj(nid);\n\tif (obj == NULL) return(-2);\n\treturn(X509v3_get_ext_by_OBJ(x,obj,lastpos));\n\t}', 'ASN1_OBJECT *OBJ_nid2obj(int n)\n\t{\n\tADDED_OBJ ad,*adp;\n\tASN1_OBJECT ob;\n\tif ((n >= 0) && (n < NUM_NID))\n\t\t{\n\t\tif ((n != NID_undef) && (nid_objs[n].nid == NID_undef))\n\t\t\t{\n\t\t\tOBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\treturn((ASN1_OBJECT *)&(nid_objs[n]));\n\t\t}\n\telse if (added == NULL)\n\t\treturn(NULL);\n\telse\n\t\t{\n\t\tad.type=ADDED_NID;\n\t\tad.obj= &ob;\n\t\tob.nid=n;\n\t\tadp=(ADDED_OBJ *)lh_retrieve(added,&ad);\n\t\tif (adp != NULL)\n\t\t\treturn(adp->obj);\n\t\telse\n\t\t\t{\n\t\t\tOBJerr(OBJ_F_OBJ_NID2OBJ,OBJ_R_UNKNOWN_NID);\n\t\t\treturn(NULL);\n\t\t\t}\n\t\t}\n\t}', 'int OCSP_BASICRESP_get_ext_by_NID(OCSP_BASICRESP *x, int nid, int lastpos)\n\t{\n\treturn(X509v3_get_ext_by_NID(x->tbsResponseData->responseExtensions,nid,lastpos));\n\t}', 'X509_EXTENSION *OCSP_REQUEST_get_ext(OCSP_REQUEST *x, int loc)\n\t{\n\treturn(X509v3_get_ext(x->tbsRequest->requestExtensions,loc));\n\t}', 'X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc)\n\t{\n\tif (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0)\n\t\treturn NULL;\n\telse\n\t\treturn sk_X509_EXTENSION_value(x,loc);\n\t}', 'int sk_num(const STACK *st)\n{\n\tif(st == NULL) return -1;\n\treturn st->num;\n}', 'X509_EXTENSION *OCSP_BASICRESP_get_ext(OCSP_BASICRESP *x, int loc)\n\t{\n\treturn(X509v3_get_ext(x->tbsResponseData->responseExtensions,loc));\n\t}', 'char *sk_value(const STACK *st, int i)\n{\n\tif(st == NULL) return NULL;\n\treturn st->data[i];\n}']