From 68b20475086bc92fa5cae0158030cd4943ce37d3 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 21 Jan 2013 15:33:46 -0500 Subject: [PATCH] Both kinds of EncryptedDataPacket --- lib/openpgp.php | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/openpgp.php b/lib/openpgp.php index 6fda942..0e929ac 100644 --- a/lib/openpgp.php +++ b/lib/openpgp.php @@ -1562,7 +1562,13 @@ class OpenPGP_CompressedDataPacket extends OpenPGP_Packet implements IteratorAgg * @see http://tools.ietf.org/html/rfc4880#section-5.7 */ class OpenPGP_EncryptedDataPacket extends OpenPGP_Packet { - // TODO + function read() { + $this->data = $this->input; + } + + function body() { + return $this->data; + } } /** @@ -1705,8 +1711,17 @@ class OpenPGP_UserAttributePacket extends OpenPGP_Packet { * * @see http://tools.ietf.org/html/rfc4880#section-5.13 */ -class OpenPGP_IntegrityProtectedDataPacket extends OpenPGP_Packet { - // TODO +class OpenPGP_IntegrityProtectedDataPacket extends OpenPGP_EncryptedDataPacket { + public $version; + + function read() { + $this->version = ord($this->read_byte()); + $this->data = $this->input; + } + + function body() { + return chr($this->version) . $this->data; + } } /**