All pastes #418888 Raw Edit

Mine

public text v1 · immutable
#418888 ·published 2007-03-31 22:06 UTC
rendered paste body
	content = camel_medium_get_content_object((CamelMedium *)ipart);
	ct = camel_mime_part_get_content_type((CamelMimePart *)content);
	/* Encrypted part (using our fake mime type) or PGP/Mime multipart */
	if (camel_content_type_is(ct, "multipart", "encrypted")) {	
		mp = (CamelMultipart *) camel_medium_get_content_object ((CamelMedium *) ipart);
		if (!(encrypted = camel_multipart_get_part (mp, CAMEL_MULTIPART_ENCRYPTED_CONTENT))) {
			camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("Failed to decrypt MIME part: protocol error"));
			return NULL;
		}

		content = camel_medium_get_content_object ((CamelMedium *) encrypted);
	} else if (camel_content_type_is(ct, "application", "x-inlinepgp-encrypted")) {
		content = camel_medium_get_content_object ((CamelMedium *) ipart);

	} else {
		/* Invalid Mimetype */
		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
				_("Cannot decrypt message: Incorrect message format"));
		return NULL;
	}