if(!pubKey)
if(!pubKey[0])
void main_encrypt(void){	unsigned int ebuflen;        EVP_CIPHER_CTX ectx;        unsigned char iv[EVP_MAX_IV_LENGTH];	unsigned char *ekey[1]; 	int readlen;	int ekeylen, net_ekeylen; 	EVP_PKEY *pubKey[1];	char buf[512];	char ebuf[512];	 	memset(iv, '\0', sizeof(iv));        pubKey[0] = ReadPublicKey(PUBFILE);	if(!pubKey)	{           fprintf(stderr,"Error: can't load public key");           exit(1);        }              ekey[0] = malloc(EVP_PKEY_size(pubKey[0]));          if (!ekey[0])	{	   EVP_PKEY_free(pubKey[0]); 	   perror("malloc");	   exit(1);	}	EVP_SealInit(&ectx,                   EVP_des_ede3_cbc(),		   ekey,		   &ekeylen,		   iv,		   pubKey,		   1); 	net_ekeylen = htonl(ekeylen);		write(STDOUT, (char*)&net_ekeylen, sizeof(net_ekeylen));        write(STDOUT, ekey[0], ekeylen);        write(STDOUT, iv, sizeof(iv));	while(1)	{		readlen = read(STDIN, buf, sizeof(buf));		if (readlen <= 0)		{		   if (readlen < 0)			perror("read");		   break;		}		EVP_SealUpdate(&ectx, ebuf, &ebuflen, buf, readlen);		write(STDOUT, ebuf, ebuflen);	}        EVP_SealFinal(&ectx, ebuf, &ebuflen);        	write(STDOUT, ebuf, ebuflen);        EVP_PKEY_free(pubKey[0]);	free(ekey[0]);}