PR_ASSERT(data->verify_error < 0);
MimeCMS_generate (void *crypto_closure){  MimeCMSdata *data = (MimeCMSdata *) crypto_closure;  PRBool self_signed_p = PR_FALSE;  PRBool self_encrypted_p = PR_FALSE;  PRBool union_encrypted_p = PR_FALSE;  PRBool good_p = PR_TRUE;  PRBool unverified_p = PR_FALSE;  PR_ASSERT(data && data->output_fn);  if (!data || !data->output_fn) return 0;  if (data->content_info)	{	  data->content_info->ContentIsSigned(&self_signed_p);	  data->content_info->ContentIsEncrypted(&self_encrypted_p);	  union_encrypted_p = (self_encrypted_p || data->parent_is_encrypted_p);	  if (self_signed_p)		{		  PR_SetError(0, 0);      good_p = data->content_info->VerifySignature();#if 0 // XXX Fix this XXX //		  good_p = SEC_PKCS7VerifySignature(data->content_info,											0, /*certUsageEmailSigner */ /* #### */											PR_TRUE);  /* #### keepcerts */#endif		  if (!good_p)			{			  if (!data->verify_error)				data->verify_error = PR_GetError();			  PR_ASSERT(data->verify_error < 0);			  if (data->verify_error >= 0)				data->verify_error = -1;			}		  else			{			  good_p = MimeCMSHeadersAndCertsMatch(data->self,													 data->content_info,													 &data->sender_addr);			  if (!good_p && !data->verify_error)				// data->verify_error = SEC_ERROR_CERT_ADDR_MISMATCH; XXX Fix later XXX //        data->verify_error = -1;			}		}#if 0 	  if (SEC_PKCS7ContainsCertsOrCrls(data->content_info))		{		  /* #### call libsec telling it to import the certs */		}#endif	  /* Don't free these yet -- keep them around for the lifetime of the		 MIME object, so that we can get at the security info of sub-parts		 of the currently-displayed message. */#if 0	  SEC_PKCS7DestroyContentInfo(data->content_info);	  data->content_info = 0;#endif /* 0 */	}  else	{	  /* No content info?  Something's horked.  Guess. */	  self_encrypted_p = PR_TRUE;	  union_encrypted_p = PR_TRUE;	  good_p = PR_FALSE;	  if (!data->decode_error && !data->verify_error)		data->decode_error = -1;	}  unverified_p = data->self->options->missing_parts;  PR_ASSERT(data->self);  if (data->self && data->self->parent)	// mime_set_crypto_stamp(data->self->parent, self_signed_p, self_encrypted_p); XXX Fix later XXX //  {	char *stamp_url = 0, *result = nsnull;	if (data->self)	{		if (unverified_p && data->self->options)			// stamp_url = IMAP_CreateReloadAllPartsUrl(data->self->options->url); XXX Fix later XXX //      stamp_url = nsnull;		else			stamp_url = MimeCMS_MakeSAURL(data->self);	}#if 0 // XXX Fix this later XXX //	result =	  MimeHeaders_make_crypto_stamp (union_encrypted_p,									 self_signed_p,									 good_p,									 unverified_p,									 data->parent_holds_stamp_p,									 stamp_url);#endif	PR_FREEIF(stamp_url);	return result;  }}