crypto/rsa/rsa_eay.c:420: error: NULL_DEREFERENCE
  pointer `meth` last assigned on line 372 could be null and is dereferenced at line 420, column 7.
Showing all 67 steps of the trace


crypto/rsa/rsa_eay.c:362:1: start of procedure RSA_eay_public_decrypt()
360.   	}
361.   
362. > static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
363.   	     unsigned char *to, RSA *rsa, int padding)
364.   	{

crypto/rsa/rsa_eay.c:367:2: 
365.   	const RSA_METHOD *meth;
366.   	BIGNUM f,ret;
367. > 	int i,num=0,r= -1;
368.   	unsigned char *p;
369.   	unsigned char *buf=NULL;

crypto/rsa/rsa_eay.c:369:2: 
367.   	int i,num=0,r= -1;
368.   	unsigned char *p;
369. > 	unsigned char *buf=NULL;
370.   	BN_CTX *ctx=NULL;
371.   

crypto/rsa/rsa_eay.c:370:2: 
368.   	unsigned char *p;
369.   	unsigned char *buf=NULL;
370. > 	BN_CTX *ctx=NULL;
371.   
372.   	meth = ENGINE_get_RSA(rsa->engine);

crypto/rsa/rsa_eay.c:372:2: 
370.   	BN_CTX *ctx=NULL;
371.   
372. > 	meth = ENGINE_get_RSA(rsa->engine);
373.   	BN_init(&f);
374.   	BN_init(&ret);

crypto/engine/engine_list.c:563:1: start of procedure ENGINE_get_RSA()
  561.   	}
  562.   
  563. > const RSA_METHOD *ENGINE_get_RSA(ENGINE *e)
  564.   	{
  565.   	if(e == NULL)

crypto/engine/engine_list.c:565:5: Taking true branch
  563.   const RSA_METHOD *ENGINE_get_RSA(ENGINE *e)
  564.   	{
  565.   	if(e == NULL)
             ^
  566.   		{
  567.   		ENGINEerr(ENGINE_F_ENGINE_GET_RSA,

crypto/engine/engine_list.c:567:3: 
  565.   	if(e == NULL)
  566.   		{
  567. > 		ENGINEerr(ENGINE_F_ENGINE_GET_RSA,
  568.   			ERR_R_PASSED_NULL_PARAMETER);
  569.   		return NULL;

crypto/err/err.c:360:1: start of procedure ERR_put_error()
    358.   /********************************************************/
    359.   
    360. > void ERR_put_error(int lib, int func, int reason, const char *file,
    361.   	     int line)
    362.   	{

crypto/err/err.c:384:2: Skipping ERR_get_state(): empty list of specs
    382.   	}
    383.   #endif
    384.   	es=ERR_get_state();
            ^
    385.   
    386.   	es->top=(es->top+1)%ERR_NUM_ERRORS;

crypto/err/err.c:386:2: 
    384.   	es=ERR_get_state();
    385.   
    386. > 	es->top=(es->top+1)%ERR_NUM_ERRORS;
    387.   	if (es->top == es->bottom)
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;

crypto/err/err.c:387:6: Taking false branch
    385.   
    386.   	es->top=(es->top+1)%ERR_NUM_ERRORS;
    387.   	if (es->top == es->bottom)
                ^
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);

crypto/err/err.c:389:2: 
    387.   	if (es->top == es->bottom)
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389. > 	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;

crypto/err/err.c:390:2: 
    388.   		es->bottom=(es->bottom+1)%ERR_NUM_ERRORS;
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390. > 	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);

crypto/err/err.c:391:2: 
    389.   	es->err_buffer[es->top]=ERR_PACK(lib,func,reason);
    390.   	es->err_file[es->top]=file;
    391. > 	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
    393.   	}

crypto/err/err.c:392:2: Taking true branch
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
            ^
    393.   	}
    394.   

crypto/err/err.c:392:2: Taking false branch
    390.   	es->err_file[es->top]=file;
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
            ^
    393.   	}
    394.   

crypto/err/err.c:393:2: return from a call to ERR_put_error
    391.   	es->err_line[es->top]=line;
    392.   	err_clear_data(es,es->top);
    393.   	}
            ^
    394.   
    395.   void ERR_clear_error(void)

crypto/engine/engine_list.c:569:3: 
  567.   		ENGINEerr(ENGINE_F_ENGINE_GET_RSA,
  568.   			ERR_R_PASSED_NULL_PARAMETER);
  569. > 		return NULL;
  570.   		}
  571.   	return e->rsa_meth;

crypto/engine/engine_list.c:572:2: return from a call to ENGINE_get_RSA
  570.   		}
  571.   	return e->rsa_meth;
  572.   	}
          ^
  573.   
  574.   const DSA_METHOD *ENGINE_get_DSA(ENGINE *e)

crypto/rsa/rsa_eay.c:373:2: 
371.   
372.   	meth = ENGINE_get_RSA(rsa->engine);
373. > 	BN_init(&f);
374.   	BN_init(&ret);
375.   	ctx=BN_CTX_new();

crypto/bn/bn_lib.c:286:1: start of procedure BN_init()
  284.   	}
  285.   
  286. > void BN_init(BIGNUM *a)
  287.   	{
  288.   	memset(a,0,sizeof(BIGNUM));

crypto/bn/bn_lib.c:288:2: 
  286.   void BN_init(BIGNUM *a)
  287.   	{
  288. > 	memset(a,0,sizeof(BIGNUM));
  289.   	}
  290.   

crypto/bn/bn_lib.c:289:2: return from a call to BN_init
  287.   	{
  288.   	memset(a,0,sizeof(BIGNUM));
  289.   	}
          ^
  290.   
  291.   BIGNUM *BN_new(void)

crypto/rsa/rsa_eay.c:374:2: 
372.   	meth = ENGINE_get_RSA(rsa->engine);
373.   	BN_init(&f);
374. > 	BN_init(&ret);
375.   	ctx=BN_CTX_new();
376.   	if (ctx == NULL) goto err;

crypto/bn/bn_lib.c:286:1: start of procedure BN_init()
  284.   	}
  285.   
  286. > void BN_init(BIGNUM *a)
  287.   	{
  288.   	memset(a,0,sizeof(BIGNUM));

crypto/bn/bn_lib.c:288:2: 
  286.   void BN_init(BIGNUM *a)
  287.   	{
  288. > 	memset(a,0,sizeof(BIGNUM));
  289.   	}
  290.   

crypto/bn/bn_lib.c:289:2: return from a call to BN_init
  287.   	{
  288.   	memset(a,0,sizeof(BIGNUM));
  289.   	}
          ^
  290.   
  291.   BIGNUM *BN_new(void)

crypto/rsa/rsa_eay.c:375:2: 
373.   	BN_init(&f);
374.   	BN_init(&ret);
375. > 	ctx=BN_CTX_new();
376.   	if (ctx == NULL) goto err;
377.   

crypto/bn/bn_ctx.c:68:1: start of procedure BN_CTX_new()
  66.   
  67.   
  68. > BN_CTX *BN_CTX_new(void)
  69.   	{
  70.   	BN_CTX *ret;

crypto/bn/bn_ctx.c:72:2: 
  70.   	BN_CTX *ret;
  71.   
  72. > 	ret=(BN_CTX *)OPENSSL_malloc(sizeof(BN_CTX));
  73.   	if (ret == NULL)
  74.   		{

crypto/mem.c:205:1: start of procedure CRYPTO_malloc()
    203.   	}
    204.   
    205. > void *CRYPTO_malloc(int num, const char *file, int line)
    206.   	{
    207.   	void *ret = NULL;

crypto/mem.c:207:2: 
    205.   void *CRYPTO_malloc(int num, const char *file, int line)
    206.   	{
    207. > 	void *ret = NULL;
    208.   
    209.   	allow_customize = 0;

crypto/mem.c:209:2: 
    207.   	void *ret = NULL;
    208.   
    209. > 	allow_customize = 0;
    210.   	if (malloc_debug_func != NULL)
    211.   		{

crypto/mem.c:210:6: Taking false branch
    208.   
    209.   	allow_customize = 0;
    210.   	if (malloc_debug_func != NULL)
                ^
    211.   		{
    212.   		allow_customize_debug = 0;

crypto/mem.c:215:2: Skipping __function_pointer__(): unresolved function pointer
    213.   		malloc_debug_func(NULL, num, file, line, 0);
    214.   		}
    215.   	ret = malloc_func(num);
            ^
    216.   #ifdef LEVITTE_DEBUG_MEM
    217.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:219:6: Taking false branch
    217.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
    218.   #endif
    219.   	if (malloc_debug_func != NULL)
                ^
    220.   		malloc_debug_func(ret, num, file, line, 1);
    221.   

crypto/mem.c:222:2: 
    220.   		malloc_debug_func(ret, num, file, line, 1);
    221.   
    222. > 	return ret;
    223.   	}
    224.   

crypto/mem.c:223:2: return from a call to CRYPTO_malloc
    221.   
    222.   	return ret;
    223.   	}
            ^
    224.   
    225.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/bn/bn_ctx.c:73:6: Taking false branch
  71.   
  72.   	ret=(BN_CTX *)OPENSSL_malloc(sizeof(BN_CTX));
  73.   	if (ret == NULL)
             ^
  74.   		{
  75.   		BNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE);

crypto/bn/bn_ctx.c:79:2: Skipping BN_CTX_init(): empty list of specs
  77.   		}
  78.   
  79.   	BN_CTX_init(ret);
         ^
  80.   	ret->flags=BN_FLG_MALLOCED;
  81.   	return(ret);

crypto/bn/bn_ctx.c:80:2: 
  78.   
  79.   	BN_CTX_init(ret);
  80. > 	ret->flags=BN_FLG_MALLOCED;
  81.   	return(ret);
  82.   	}

crypto/bn/bn_ctx.c:81:2: 
  79.   	BN_CTX_init(ret);
  80.   	ret->flags=BN_FLG_MALLOCED;
  81. > 	return(ret);
  82.   	}
  83.   

crypto/bn/bn_ctx.c:82:2: return from a call to BN_CTX_new
  80.   	ret->flags=BN_FLG_MALLOCED;
  81.   	return(ret);
  82.   	}
         ^
  83.   
  84.   void BN_CTX_init(BN_CTX *ctx)

crypto/rsa/rsa_eay.c:376:6: Taking false branch
374.   	BN_init(&ret);
375.   	ctx=BN_CTX_new();
376.   	if (ctx == NULL) goto err;
            ^
377.   
378.   	num=BN_num_bytes(rsa->n);

crypto/rsa/rsa_eay.c:378:2: 
376.   	if (ctx == NULL) goto err;
377.   
378. > 	num=BN_num_bytes(rsa->n);
379.   	buf=(unsigned char *)OPENSSL_malloc(num);
380.   	if (buf == NULL)

crypto/bn/bn_lib.c:245:1: start of procedure BN_num_bits()
  243.   	}
  244.   
  245. > int BN_num_bits(const BIGNUM *a)
  246.   	{
  247.   	BN_ULONG l;

crypto/bn/bn_lib.c:252:6: Taking false branch
  250.   	bn_check_top(a);
  251.   
  252.   	if (a->top == 0) return(0);
              ^
  253.   	l=a->d[a->top-1];
  254.   	assert(l != 0);

crypto/bn/bn_lib.c:253:2: 
  251.   
  252.   	if (a->top == 0) return(0);
  253. > 	l=a->d[a->top-1];
  254.   	assert(l != 0);
  255.   	i=(a->top-1)*BN_BITS2;

crypto/bn/bn_lib.c:254:2: 
  252.   	if (a->top == 0) return(0);
  253.   	l=a->d[a->top-1];
  254. > 	assert(l != 0);
  255.   	i=(a->top-1)*BN_BITS2;
  256.   	return(i+BN_num_bits_word(l));

crypto/bn/bn_lib.c:255:2: 
  253.   	l=a->d[a->top-1];
  254.   	assert(l != 0);
  255. > 	i=(a->top-1)*BN_BITS2;
  256.   	return(i+BN_num_bits_word(l));
  257.   	}

crypto/bn/bn_lib.c:256:2: Skipping BN_num_bits_word(): empty list of specs
  254.   	assert(l != 0);
  255.   	i=(a->top-1)*BN_BITS2;
  256.   	return(i+BN_num_bits_word(l));
          ^
  257.   	}
  258.   

crypto/bn/bn_lib.c:257:2: return from a call to BN_num_bits
  255.   	i=(a->top-1)*BN_BITS2;
  256.   	return(i+BN_num_bits_word(l));
  257.   	}
          ^
  258.   
  259.   void BN_clear_free(BIGNUM *a)

crypto/rsa/rsa_eay.c:379:2: 
377.   
378.   	num=BN_num_bytes(rsa->n);
379. > 	buf=(unsigned char *)OPENSSL_malloc(num);
380.   	if (buf == NULL)
381.   		{

crypto/mem.c:205:1: start of procedure CRYPTO_malloc()
  203.   	}
  204.   
  205. > void *CRYPTO_malloc(int num, const char *file, int line)
  206.   	{
  207.   	void *ret = NULL;

crypto/mem.c:207:2: 
  205.   void *CRYPTO_malloc(int num, const char *file, int line)
  206.   	{
  207. > 	void *ret = NULL;
  208.   
  209.   	allow_customize = 0;

crypto/mem.c:209:2: 
  207.   	void *ret = NULL;
  208.   
  209. > 	allow_customize = 0;
  210.   	if (malloc_debug_func != NULL)
  211.   		{

crypto/mem.c:210:6: Taking false branch
  208.   
  209.   	allow_customize = 0;
  210.   	if (malloc_debug_func != NULL)
              ^
  211.   		{
  212.   		allow_customize_debug = 0;

crypto/mem.c:215:2: Skipping __function_pointer__(): unresolved function pointer
  213.   		malloc_debug_func(NULL, num, file, line, 0);
  214.   		}
  215.   	ret = malloc_func(num);
          ^
  216.   #ifdef LEVITTE_DEBUG_MEM
  217.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:219:6: Taking false branch
  217.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
  218.   #endif
  219.   	if (malloc_debug_func != NULL)
              ^
  220.   		malloc_debug_func(ret, num, file, line, 1);
  221.   

crypto/mem.c:222:2: 
  220.   		malloc_debug_func(ret, num, file, line, 1);
  221.   
  222. > 	return ret;
  223.   	}
  224.   

crypto/mem.c:223:2: return from a call to CRYPTO_malloc
  221.   
  222.   	return ret;
  223.   	}
          ^
  224.   
  225.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/rsa/rsa_eay.c:380:6: Taking false branch
378.   	num=BN_num_bytes(rsa->n);
379.   	buf=(unsigned char *)OPENSSL_malloc(num);
380.   	if (buf == NULL)
            ^
381.   		{
382.   		RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE);

crypto/rsa/rsa_eay.c:388:6: Taking false branch
386.   	/* This check was for equality but PGP does evil things
387.   	 * and chops off the top '0' bytes */
388.   	if (flen > num)
            ^
389.   		{
390.   		RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_DATA_GREATER_THAN_MOD_LEN);

crypto/rsa/rsa_eay.c:394:6: Taking false branch
392.   		}
393.   
394.   	if (BN_bin2bn(from,flen,&f) == NULL) goto err;
            ^
395.   	/* do the decrypt */
396.   	if ((rsa->_method_mod_n == NULL) && (rsa->flags & RSA_FLAG_CACHE_PUBLIC))

crypto/rsa/rsa_eay.c:396:7: Taking false branch
394.   	if (BN_bin2bn(from,flen,&f) == NULL) goto err;
395.   	/* do the decrypt */
396.   	if ((rsa->_method_mod_n == NULL) && (rsa->flags & RSA_FLAG_CACHE_PUBLIC))
             ^
397.   		{
398.   		BN_MONT_CTX* bn_mont_ctx;

crypto/rsa/rsa_eay.c:420:7: 
418.   		}
419.   		
420. > 	if (!meth->bn_mod_exp(&ret,&f,rsa->e,rsa->n,ctx,
421.   		rsa->_method_mod_n)) goto err;
422.   

static int RSA_eay_public_decrypt(int flen, const unsigned char *from,
	     unsigned char *to, RSA *rsa, int padding)
	{
	const RSA_METHOD *meth;
	BIGNUM f,ret;
	int i,num=0,r= -1;
	unsigned char *p;
	unsigned char *buf=NULL;
	BN_CTX *ctx=NULL;
	meth = ENGINE_get_RSA(rsa->engine);
	BN_init(&f);
	BN_init(&ret);
	ctx=BN_CTX_new();
	if (ctx == NULL) goto err;
	num=BN_num_bytes(rsa->n);
	buf=(unsigned char *)OPENSSL_malloc(num);
	if (buf == NULL)
		{
		RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE);
		goto err;
		}
	if (flen > num)
		{
		RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_DATA_GREATER_THAN_MOD_LEN);
		goto err;
		}
	if (BN_bin2bn(from,flen,&f) == NULL) goto err;
	if ((rsa->_method_mod_n == NULL) && (rsa->flags & RSA_FLAG_CACHE_PUBLIC))
		{
		BN_MONT_CTX* bn_mont_ctx;
		if ((bn_mont_ctx=BN_MONT_CTX_new()) == NULL)
			goto err;
		if (!BN_MONT_CTX_set(bn_mont_ctx,rsa->n,ctx))
			{
			BN_MONT_CTX_free(bn_mont_ctx);
			goto err;
			}
		if (rsa->_method_mod_n == NULL)
			{
			CRYPTO_w_lock(CRYPTO_LOCK_RSA);
			if (rsa->_method_mod_n == NULL)
				{
				rsa->_method_mod_n = bn_mont_ctx;
				bn_mont_ctx = NULL;
				}
			CRYPTO_w_unlock(CRYPTO_LOCK_RSA);
			}
		if (bn_mont_ctx)
			BN_MONT_CTX_free(bn_mont_ctx);
		}
	if (!meth->bn_mod_exp(&ret,&f,rsa->e,rsa->n,ctx,
		rsa->_method_mod_n)) goto err;
	p=buf;
	i=BN_bn2bin(&ret,p);
	switch (padding)
		{
	case RSA_PKCS1_PADDING:
		r=RSA_padding_check_PKCS1_type_1(to,num,buf,i,num);
		break;
	case RSA_NO_PADDING:
		r=RSA_padding_check_none(to,num,buf,i,num);
		break;
	default:
		RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_UNKNOWN_PADDING_TYPE);
		goto err;
		}
	if (r < 0)
		RSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_PADDING_CHECK_FAILED);
err:
	if (ctx != NULL) BN_CTX_free(ctx);
	BN_clear_free(&f);
	BN_clear_free(&ret);
	if (buf != NULL)
		{
		memset(buf,0,num);
		OPENSSL_free(buf);
		}
	return(r);
	}
['static int RSA_eay_public_decrypt(int flen, const unsigned char *from,\n\t     unsigned char *to, RSA *rsa, int padding)\n\t{\n\tconst RSA_METHOD *meth;\n\tBIGNUM f,ret;\n\tint i,num=0,r= -1;\n\tunsigned char *p;\n\tunsigned char *buf=NULL;\n\tBN_CTX *ctx=NULL;\n\tmeth = ENGINE_get_RSA(rsa->engine);\n\tBN_init(&f);\n\tBN_init(&ret);\n\tctx=BN_CTX_new();\n\tif (ctx == NULL) goto err;\n\tnum=BN_num_bytes(rsa->n);\n\tbuf=(unsigned char *)OPENSSL_malloc(num);\n\tif (buf == NULL)\n\t\t{\n\t\tRSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,ERR_R_MALLOC_FAILURE);\n\t\tgoto err;\n\t\t}\n\tif (flen > num)\n\t\t{\n\t\tRSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_DATA_GREATER_THAN_MOD_LEN);\n\t\tgoto err;\n\t\t}\n\tif (BN_bin2bn(from,flen,&f) == NULL) goto err;\n\tif ((rsa->_method_mod_n == NULL) && (rsa->flags & RSA_FLAG_CACHE_PUBLIC))\n\t\t{\n\t\tBN_MONT_CTX* bn_mont_ctx;\n\t\tif ((bn_mont_ctx=BN_MONT_CTX_new()) == NULL)\n\t\t\tgoto err;\n\t\tif (!BN_MONT_CTX_set(bn_mont_ctx,rsa->n,ctx))\n\t\t\t{\n\t\t\tBN_MONT_CTX_free(bn_mont_ctx);\n\t\t\tgoto err;\n\t\t\t}\n\t\tif (rsa->_method_mod_n == NULL)\n\t\t\t{\n\t\t\tCRYPTO_w_lock(CRYPTO_LOCK_RSA);\n\t\t\tif (rsa->_method_mod_n == NULL)\n\t\t\t\t{\n\t\t\t\trsa->_method_mod_n = bn_mont_ctx;\n\t\t\t\tbn_mont_ctx = NULL;\n\t\t\t\t}\n\t\t\tCRYPTO_w_unlock(CRYPTO_LOCK_RSA);\n\t\t\t}\n\t\tif (bn_mont_ctx)\n\t\t\tBN_MONT_CTX_free(bn_mont_ctx);\n\t\t}\n\tif (!meth->bn_mod_exp(&ret,&f,rsa->e,rsa->n,ctx,\n\t\trsa->_method_mod_n)) goto err;\n\tp=buf;\n\ti=BN_bn2bin(&ret,p);\n\tswitch (padding)\n\t\t{\n\tcase RSA_PKCS1_PADDING:\n\t\tr=RSA_padding_check_PKCS1_type_1(to,num,buf,i,num);\n\t\tbreak;\n\tcase RSA_NO_PADDING:\n\t\tr=RSA_padding_check_none(to,num,buf,i,num);\n\t\tbreak;\n\tdefault:\n\t\tRSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_UNKNOWN_PADDING_TYPE);\n\t\tgoto err;\n\t\t}\n\tif (r < 0)\n\t\tRSAerr(RSA_F_RSA_EAY_PUBLIC_DECRYPT,RSA_R_PADDING_CHECK_FAILED);\nerr:\n\tif (ctx != NULL) BN_CTX_free(ctx);\n\tBN_clear_free(&f);\n\tBN_clear_free(&ret);\n\tif (buf != NULL)\n\t\t{\n\t\tmemset(buf,0,num);\n\t\tOPENSSL_free(buf);\n\t\t}\n\treturn(r);\n\t}', 'const RSA_METHOD *ENGINE_get_RSA(ENGINE *e)\n\t{\n\tif(e == NULL)\n\t\t{\n\t\tENGINEerr(ENGINE_F_ENGINE_GET_RSA,\n\t\t\tERR_R_PASSED_NULL_PARAMETER);\n\t\treturn NULL;\n\t\t}\n\treturn e->rsa_meth;\n\t}', 'void ERR_put_error(int lib, int func, int reason, const char *file,\n\t     int line)\n\t{\n\tERR_STATE *es;\n#ifdef _OSD_POSIX\n\tif (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {\n\t\tchar *end;\n\t\tfile += sizeof("*POSIX(")-1;\n\t\tend = &file[strlen(file)-1];\n\t\tif (*end == \')\')\n\t\t\t*end = \'\\0\';\n\t\tif ((end = strrchr(file, \'/\')) != NULL)\n\t\t\tfile = &end[1];\n\t}\n#endif\n\tes=ERR_get_state();\n\tes->top=(es->top+1)%ERR_NUM_ERRORS;\n\tif (es->top == es->bottom)\n\t\tes->bottom=(es->bottom+1)%ERR_NUM_ERRORS;\n\tes->err_buffer[es->top]=ERR_PACK(lib,func,reason);\n\tes->err_file[es->top]=file;\n\tes->err_line[es->top]=line;\n\terr_clear_data(es,es->top);\n\t}', 'void BN_init(BIGNUM *a)\n\t{\n\tmemset(a,0,sizeof(BIGNUM));\n\t}', 'BN_CTX *BN_CTX_new(void)\n\t{\n\tBN_CTX *ret;\n\tret=(BN_CTX *)OPENSSL_malloc(sizeof(BN_CTX));\n\tif (ret == NULL)\n\t\t{\n\t\tBNerr(BN_F_BN_CTX_NEW,ERR_R_MALLOC_FAILURE);\n\t\treturn(NULL);\n\t\t}\n\tBN_CTX_init(ret);\n\tret->flags=BN_FLG_MALLOCED;\n\treturn(ret);\n\t}', 'void *CRYPTO_malloc(int num, const char *file, int line)\n\t{\n\tvoid *ret = NULL;\n\tallow_customize = 0;\n\tif (malloc_debug_func != NULL)\n\t\t{\n\t\tallow_customize_debug = 0;\n\t\tmalloc_debug_func(NULL, num, file, line, 0);\n\t\t}\n\tret = malloc_func(num);\n#ifdef LEVITTE_DEBUG_MEM\n\tfprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\\n", ret, num);\n#endif\n\tif (malloc_debug_func != NULL)\n\t\tmalloc_debug_func(ret, num, file, line, 1);\n\treturn ret;\n\t}', 'int BN_num_bits(const BIGNUM *a)\n\t{\n\tBN_ULONG l;\n\tint i;\n\tbn_check_top(a);\n\tif (a->top == 0) return(0);\n\tl=a->d[a->top-1];\n\tassert(l != 0);\n\ti=(a->top-1)*BN_BITS2;\n\treturn(i+BN_num_bits_word(l));\n\t}']