diff options
-rw-r--r-- | M2Crypto/PGP/PublicKey.py | 76 | ||||
-rw-r--r-- | M2Crypto/PGP/PublicKeyRing.py | 98 | ||||
-rw-r--r-- | M2Crypto/PGP/RSA.py | 28 | ||||
-rw-r--r-- | M2Crypto/PGP/__init__.py | 14 | ||||
-rw-r--r-- | M2Crypto/PGP/constants.py | 17 | ||||
-rw-r--r-- | M2Crypto/PGP/packet.py | 420 | ||||
-rw-r--r-- | M2Crypto/__init__.py | 6 | ||||
-rw-r--r-- | doc/M2Crypto.PGP.rst | 51 | ||||
-rw-r--r-- | doc/M2Crypto.rst | 1 | ||||
-rw-r--r-- | doc/doctrees/M2Crypto.SSL.doctree | bin | 349777 -> 296531 bytes | |||
-rw-r--r-- | doc/doctrees/M2Crypto.doctree | bin | 1257651 -> 1082506 bytes | |||
-rw-r--r-- | doc/doctrees/ZServerSSL-HOWTO.doctree | bin | 49245 -> 49205 bytes | |||
-rw-r--r-- | doc/doctrees/environment.pickle | bin | 459094 -> 442226 bytes | |||
-rw-r--r-- | doc/doctrees/howto.ca.doctree | bin | 51373 -> 51341 bytes | |||
-rw-r--r-- | doc/doctrees/howto.smime.doctree | bin | 94672 -> 94635 bytes | |||
-rw-r--r-- | doc/doctrees/howto.ssl.doctree | bin | 22402 -> 22375 bytes | |||
-rw-r--r-- | doc/doctrees/index.doctree | bin | 7232 -> 7200 bytes | |||
-rw-r--r-- | epydoc.conf | 3 | ||||
-rw-r--r-- | setup.py | 3 | ||||
-rw-r--r-- | tests/alltests.py | 1 | ||||
-rw-r--r-- | tests/test_pgp.py | 49 |
21 files changed, 4 insertions, 763 deletions
diff --git a/M2Crypto/PGP/PublicKey.py b/M2Crypto/PGP/PublicKey.py deleted file mode 100644 index 2aabb0b..0000000 --- a/M2Crypto/PGP/PublicKey.py +++ /dev/null @@ -1,76 +0,0 @@ -from __future__ import absolute_import - -"""M2Crypto PGP2. - -Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" - -from M2Crypto.PGP.RSA import new_pub_key -from M2Crypto.RSA import pkcs1_padding -from M2Crypto.PGP.packet import PublicKeyPacket # noqa -from M2Crypto.PGP.constants import * # noqa -from M2Crypto.PGP.packet import * # noqa - - -class PublicKey: - def __init__(self, pubkey_pkt): - # type: (PublicKeyPacket) -> None - import warnings - warnings.warn( - 'Deprecated. No maintainer for PGP. If you use this, ' + - 'please inform M2Crypto maintainer.', - DeprecationWarning) - - self._pubkey_pkt = pubkey_pkt - self._pubkey = new_pub_key((pubkey_pkt._e, pubkey_pkt._n)) - self._userid = {} # type: dict - self._signature = {} # type: dict - - def keyid(self): - # type: () -> bytes - return self._pubkey.n[-8:] - - def add_userid(self, u_pkt): - # type: (Packet.UserIDPacket) -> None - assert isinstance(u_pkt, UserIDPacket) - self._userid[u_pkt.userid()] = u_pkt - - def remove_userid(self, userid): - # type: (int) -> None - del self._userid[userid] - - def add_signature(self, userid, s_pkt): - # type: (int, SignaturePacket) -> None - assert isinstance(s_pkt, SignaturePacket) - assert userid in self._userid - if userid in self._signature: - self._signature.append(s_pkt) - else: - self._signature = [s_pkt] - - def __getitem__(self, id): - # type: (int) -> SignaturePacket - return self._userid[id] - - def __setitem__(self, *args): - # type: (*Any) -> None - raise NotImplementedError - - def __delitem__(self, id): - # type: (int) -> None - del self._userid[id] - if self._signature[id]: - del self._signature[id] - - def write(self, stream): - # type: (IO[bytes]) -> None - pass - - def encrypt(self, ptxt): - # type: (bytes) -> bytes - # XXX Munge ptxt into pgp format. - return self._pubkey.public_encrypt(ptxt, pkcs1_padding) - - def decrypt(self, ctxt): - # type: (bytes) -> bytes - # XXX Munge ctxt into pgp format. - return self._pubkey.public_encrypt(ctxt, pkcs1_padding) diff --git a/M2Crypto/PGP/PublicKeyRing.py b/M2Crypto/PGP/PublicKeyRing.py deleted file mode 100644 index 9316756..0000000 --- a/M2Crypto/PGP/PublicKeyRing.py +++ /dev/null @@ -1,98 +0,0 @@ -from __future__ import absolute_import - -"""M2Crypto PGP2. - -Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" - -from M2Crypto import util -from M2Crypto.PGP.PublicKey import * # noqa -from M2Crypto.PGP.constants import * # noqa -from M2Crypto.PGP.packet import * # noqa -if util.py27plus: - from typing import Any, AnyStr, List, Tuple # noqa - - -class PublicKeyRing: - def __init__(self, keyring): - # type: (object) -> None - import warnings - warnings.warn( - 'Deprecated. No maintainer for PGP. If you use this, ' + - 'please inform M2Crypto maintainer.', - DeprecationWarning) - - self._keyring = keyring - self._userid = {} # type: dict - self._keyid = {} # type: dict - self._spurious = [] # type: list - self._pubkey = [] # type: list - - def load(self): - # type: () -> None - curr_pub = None - curr_index = -1 - - ps = PacketStream(self._keyring) - while 1: - pkt = ps.read() - - if pkt is None: - break - - elif isinstance(pkt, PublicKeyPacket): - curr_index = curr_index + 1 - curr_pub = PublicKey(pkt) - self._pubkey.append(curr_pub) - # self._keyid[curr_pub.keyid()] = (curr_pub, curr_index) - - elif isinstance(pkt, UserIDPacket): - if curr_pub is None: - self._spurious.append(pkt) - else: - curr_pub.add_userid(pkt) - self._userid[pkt.userid()] = (curr_pub, curr_index) - - elif isinstance(pkt, SignaturePacket): - if curr_pub is None: - self._spurious.append(pkt) - else: - curr_pub.add_signature(pkt) - - else: - self._spurious.append(pkt) - - ps.close() - - def __getitem__(self, id): - # type: (int) -> int - return self._userid[id][0] - - def __setitem__(self, *args): - # type: (*Any) -> None - raise NotImplementedError - - def __delitem__(self, id): - # type: (int) -> None - pkt, idx = self._userid[id] - del self._pubkey[idx] - del self._userid[idx] - pkt, idx = self._keyid[id] - del self._keyid[idx] - - def spurious(self): - # type: () -> Tuple[SignaturePacket] - return tuple(self._spurious) - - def save(self, keyring): - # type: (file) -> None - for p in self._pubkey: - pp = p.pack() - keyring.write(pp) - - -def load_pubring(filename='pubring.pgp'): - # type: (AnyStr) -> PublicKeyRing - with open(filename, 'rb') as pkr_f: - pkr = PublicKeyRing(pkr_f) - pkr.load() - return pkr diff --git a/M2Crypto/PGP/RSA.py b/M2Crypto/PGP/RSA.py deleted file mode 100644 index 81475a1..0000000 --- a/M2Crypto/PGP/RSA.py +++ /dev/null @@ -1,28 +0,0 @@ -"""M2Crypto PGP2 RSA. - -Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" - -from M2Crypto import m2, util -from M2Crypto.RSA import RSA_pub # noqa -if util.py27plus: - from typing import Tuple # noqa - - -def new_pub_key(e_n): - # type: (Tuple[int, int]) -> RSA_pub - """ - Factory function that instantiates an RSA_pub object from a (e, n) tuple. - - 'e' is the RSA public exponent; it is a string in OpenSSL's binary format, - i.e., a number of bytes in big-endian. - - 'n' is the RSA composite of primes; it is a string in OpenSSL's - binary format, i.e., a number of bytes in big-endian. - """ - import warnings - warnings.warn('Deprecated. No maintainer for PGP. If you use this, please inform M2Crypto maintainer.', DeprecationWarning) - - (e, n) = e_n - rsa = m2.rsa_new() - m2.rsa_set_en_bin(rsa, e, n) - return RSA_pub(rsa, 1) diff --git a/M2Crypto/PGP/__init__.py b/M2Crypto/PGP/__init__.py deleted file mode 100644 index 0409096..0000000 --- a/M2Crypto/PGP/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -from __future__ import absolute_import - -"""M2Crypto PGP2. - -Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" - -from M2Crypto.PGP.PublicKey import * # noqa -from M2Crypto.PGP.PublicKeyRing import * # noqa -from M2Crypto.PGP.constants import * # noqa -from M2Crypto.PGP.packet import (CKEPacket, CommentPacket, - LiteralPacket, PacketStream, - PKEPacket, PrivateKeyPacket, - PublicKeyPacket, SignaturePacket, - TrustPacket, UserIDPacket) diff --git a/M2Crypto/PGP/constants.py b/M2Crypto/PGP/constants.py deleted file mode 100644 index e484513..0000000 --- a/M2Crypto/PGP/constants.py +++ /dev/null @@ -1,17 +0,0 @@ -"""M2Crypto PGP2. - -Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" - -CTB_TAG = 128 # type: int - -CTB_PKE = 1 # type: int -CTB_SIGNATURE = 2 # type: int -CTB_MESSAGE_DIGETS = 3 # type: int -CTB_PRIVATE_KEY = 5 # type: int -CTB_PUBLIC_KEY = 6 # type: int -CTB_COMPRESSED_DATA = 8 # type: int -CTB_CKE = 9 # type: int -CTB_LITERAL_DATA = 11 # type: int -CTB_TRUST = 12 # type: int -CTB_USERID = 13 # type: int -CTB_COMMENT = 14 # type: int diff --git a/M2Crypto/PGP/packet.py b/M2Crypto/PGP/packet.py deleted file mode 100644 index f852031..0000000 --- a/M2Crypto/PGP/packet.py +++ /dev/null @@ -1,420 +0,0 @@ -from __future__ import absolute_import - -"""M2Crypto PGP2. - -This module implements PGP packets per RFC1991 and various source -distributions. - -Each Packet type is represented by a class; Packet classes derive from -the abstract 'Packet' class. - -The 'message digest' Packet type, mentioned but not documented in RFC1991, -is not implemented. - -Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" - -# XXX Work-in-progress. UNFINISHED, type hinting is probably wrong!!! - -# Be liberal in what you accept. -# Be conservative in what you send. -# Be lazy in what you eval. - -import struct - -from io import BytesIO - -from M2Crypto import util # noqa -from M2Crypto.util import octx_to_num -from M2Crypto.PGP import constants # noqa -if util.py27plus: - from typing import AnyStr, IO, Optional, Tuple # noqa - -_OK_VERSION = ('\002', '\003') -_OK_VALIDITY = ('\000',) -_OK_PKC = ('\001',) - - -class XXXError(Exception): - pass - - -class Packet: - def __init__(self, ctb, body=None): - # type: (int, Optional[str]) -> None - import warnings - warnings.warn( - 'Deprecated. No maintainer for PGP. If you use this, ' + - 'please inform M2Crypto maintainer.', - DeprecationWarning) - - self.ctb = ctb - if body is not None: - self.body = BytesIO(body) # type: Optional[IO[str]] - else: - self.body = None - - def validate(self): - # type: () -> int - return 1 - - def pack(self): - # type: () -> None - raise NotImplementedError('%s.pack(): abstract method' % - (self.__class__,)) - - def version(self): - # type: () -> Optional[int] - if hasattr(self, '_version'): - return ord(self._version) - else: - return None - - def timestamp(self): - # type: () -> Optional[int] - if hasattr(self, '_timestamp'): - return struct.unpack('>L', self._timestamp)[0] - else: - return None - - def validity(self): - # type: () -> Optional[int] - if hasattr(self, '_validity'): - return struct.unpack('>H', self._validity)[0] - else: - return None - - def pkc(self): - # type: () -> Optional[bytes] - if hasattr(self, '_pkc'): - return self._pkc - else: - return None - - def _llf(self, lenf): - # type: (int) -> Tuple[int, bytes] - if lenf < 256: - return 0, chr(lenf) - elif lenf < 65536: - return 1, struct.pack('>H', lenf) - else: - assert lenf < 2**32 - return 2, struct.pack('>L', lenf) - - def _ctb(self, llf): - # type: (int) -> int - ctbv = _FACTORY[self.__class__] - return chr((1 << 7) | (ctbv << 2) | llf) - - -class PublicKeyPacket(Packet): # noqa - def __init__(self, ctb, body=None): - # type: (int, Optional[IO[str]) -> None - Packet.__init__(self, ctb, body) - if self.body is not None: - self._version = self.body.read(1) - self._timestamp = self.body.read(4) - self._validity = self.body.read(2) - self._pkc = self.body.read(1) - - self._nlen = self.body.read(2) - nlen = (struct.unpack('>H', self._nlen)[0] + 7) / 8 - self._n = self.body.read(nlen) - - self._elen = self.body.read(2) - elen = (struct.unpack('>H', self._elen)[0] + 7) / 8 - self._e = self.body.read(elen) - - def pack(self): - # type: () -> str - if self.body is None: - self.body = BytesIO() - self.body.write(self._version) - self.body.write(self._timestamp) - self.body.write(self._validity) - self.body.write(self._pkc) - self.body.write(self._nlen) - self.body.write(self._n) - self.body.write(self._elen) - self.body.write(self._e) - self.body = self.body.getvalue() - llf, lenf = self._llf(len(self.body)) - ctb = self._ctb(llf) - return '%s%s%s' % (ctb, lenf, self.body) - - def pubkey(self): - # type: () -> bytes - return self._pubkey.pub() - - -class TrustPacket(Packet): # noqa - # This implementation neither interprets nor emits trust packets. - def __init__(self, ctb, body=None): - # type: (int, Optional[AnyStr]) -> None - Packet.__init__(self, ctb, body) - if body is not None: - self.trust = self.body.read(1) - - -class UserIDPacket(Packet): # noqa - def __init__(self, ctb, body=None): - # type: (int, Optional[str]) -> None - Packet.__init__(self, ctb, body) - if body is not None: - self._userid = body - - def pack(self): - # type: () -> int - if self.body is None: - self.body = '' - self.body += chr(len(self._userid)) - self.body += self._userid - return self.ctb + self.body - - def userid(self): - # type: () -> int - return self._userid - - -class CommentPacket(Packet): # noqa - def __init__(self, ctb, body=None): - # type: (int, Optional[int]) -> None - Packet.__init__(self, ctb, body) - if body is not None: - self.comment = self.body.getvalue() - - def pack(self): - # type: () -> int - if self.body is None: - self.body = chr(len(self.comment)) - self.body += self.comment - return self.ctb + self.body - - -class SignaturePacket(Packet): # noqa - def __init__(self, ctb, body=None): - # type: (int, Optional[IO[bytes]]) -> None - Packet.__init__(self, ctb, body) - if body is not None: - self._version = self.body.read(1) - self._len_md_stuff = self.body.read(1) - self._classification = self.body.read(1) - self._timestamp = self.body.read(4) - self._keyid = self.body.read(8) - self._pkc = self.body.read(1) - self._md_algo = self.body.read(1) - self._md_chksum = self.body.read(2) - self._sig = self.body.read() - - def pack(self): - # type: () -> str - if self.body is None: - self.body = self._version - self.body += self._len_md_stuff - self.body += self._classification - self.body += self._timestamp - self.body += self._keyid - self.body += self._pkc - self.body += self._md_algo - self.body += self._md_chksum - self.body += self._sig - llf, lenf = self._llf(len(self.body)) - self.ctb = self.ctb | llf - return '%s%s%s' % (self.ctb, lenf, self.body) - - def validate(self): - # type: () -> None - # FIXME this looks broken ... returning None always? - if self._version not in _OK_VERSION: - return None - if self._len_md_stuff != '\005': - return None - - -class PrivateKeyPacket(Packet): # noqa - def __init__(self, ctb, body=None): - # type: (int, IO[bytes]) -> None - Packet.__init__(self, ctb, body) - if body is not None: - self._version = self.body.read(1) - self._timestamp = self.body.read(4) - self._validity = self.body.read(2) - self._pkc = self.body.read(1) - - self._nlen = self.body.read(2) - nlen = (struct.unpack('>H', self._nlen)[0] + 7) / 8 - self._n = self.body.read(nlen) - - self._elen = self.body.read(2) - elen = (struct.unpack('>H', self._elen)[0] + 7) / 8 - self._e = self.body.read(elen) - - self._cipher = self.body.read(1) - if self._cipher == '\001': - self._iv = self.body.read(8) - else: - self._iv = None - - for param in ['d', 'p', 'q', 'u']: - _plen = self.body.read(2) - setattr(self, '_' + param + 'len', _plen) - plen = (struct.unpack('>H', _plen)[0] + 7) / 8 - setattr(self, '_' + param, self.body.read(plen)) - - self._cksum = self.body.read(2) - - def is_encrypted(self): - # type: () -> int - return ord(self._cipher) - - -class CKEPacket(Packet): # noqa - def __init__(self, ctb, body=None): - # type: (int, IO[bytes]) -> None - Packet.__init__(self, ctb, body) - if body is not None: - self._iv = self.body.read(8) - self._cksum = self.body.read(2) - self._ctxt = self.body.read() - - -class PKEPacket(Packet): # noqa - def __init__(self, ctb, body=None): - # type: (int, IO[bytes]) -> None - Packet.__init__(self, ctb, body) - if body is not None: - self._version = self.body.read(1) - self._keyid = self.body.read(8) - self._pkc = ord(self.body.read(1)) - - deklen = (struct.unpack('>H', self.body.read(2))[0] + 7) / 8 - self._dek = octx_to_num(self.body.read(deklen)) - - -class LiteralPacket(Packet): # noqa - def __init__(self, ctb, body=None): - # type: (int, IO[bytes]) -> None - Packet.__init__(self, ctb, body) - if body is not None: - self.fmode = self.body.read(1) - fnlen = self.body.read(1) - self.fname = self.body.read(fnlen) - self.ftime = self.body.read(4) - # self.data = self.body.read() - - -class CompressedPacket(Packet): # noqa - def __init__(self, ctb, stream): - # type: (int, IO[bytes]) -> None - Packet.__init__(self, ctb, '') - if self.body is not None: - self.algo = stream.read(1) - # This reads the entire stream into memory. - self.data = stream.read() - - def validate(self): - # type: () -> bool - return self.algo == '\001' - - def uncompress(self): - # type: () -> IO[bytes] - import zlib - decomp = zlib.decompressobj(-13) # RFC 2440, pg 61. - # This doubles the memory usage. - stream = BytesIO(decomp.decompress(self.data)) - return stream - - -_FACTORY = { - 1: PKEPacket, - 2: SignaturePacket, - # 3 : message_digest_packet, # XXX not implemented - 5: PrivateKeyPacket, - 6: PublicKeyPacket, - # 8 : CompressedPacket, # special case - 9: CKEPacket, - 11: LiteralPacket, - 12: TrustPacket, - 13: UserIDPacket, - 14: CommentPacket, - PKEPacket: 1, - SignaturePacket: 2, - # 3 : message_digest_packet, - PrivateKeyPacket: 5, - PublicKeyPacket: 6, - # 8 : CompressedPacket, - CKEPacket: 9, - LiteralPacket: 11, - TrustPacket: 12, - UserIDPacket: 13, - CommentPacket: 14 -} - - -class PacketStream: # noqa - def __init__(self, input): - # type: (IO[bytes]) -> None - self.stream = input - self.under_current = None - self._count = 0 - - def close(self): - # type: () -> None - self.stream.close() - if self.under_current is not None: - self.under_current.close() - - def read(self, keep_trying=0): - # type: (int) -> Packet - while 1: - ctb0 = self.stream.read(1) - if not ctb0: - return None - ctb = ord(ctb0) - if is_ctb(ctb): - break - elif keep_trying: - continue - else: - raise XXXError - ctbt = (ctb & 0x3c) >> 2 - - if ctbt == constants.CTB_COMPRESSED_DATA: - self.under_current = self.stream - cp = CompressedPacket(ctb0, self.stream) - self.stream = cp.uncompress() - return self.read() - - # Decode the length of following data. See RFC for details. - llf = ctb & 3 - if llf == 0: - lenf = ord(self.stream.read(1)) - elif llf == 1: - lenf = struct.unpack('>H', self.stream.read(2))[0] - elif llf == 2: - lenf = struct.unpack('>L', self.stream.read(4))[0] - else: # llf == 3 - raise XXXError('impossible case') - - body = self.stream.read(lenf) - if not body or (len(body) != lenf): - raise XXXError('corrupted Packet') - - self._count = self.stream.tell() - try: - return _FACTORY[ctbt](ctb0, body) - except KeyError: - return Packet(ctb0, body) - - def count(self): - # type: () -> int - return self._count - - -def is_ctb(ctb): - # type: (int) -> bool - return ctb & 0xc0 - - -def make_ctb(value, llf): - # type: (int, int) -> str - return chr((1 << 7) | (value << 2) | llf) diff --git a/M2Crypto/__init__.py b/M2Crypto/__init__.py index a166894..83829a7 100644 --- a/M2Crypto/__init__.py +++ b/M2Crypto/__init__.py @@ -24,9 +24,9 @@ version = __version__ # type: str version_info = StrictVersion(__version__).version from M2Crypto import (ASN1, AuthCookie, BIO, BN, DH, DSA, EVP, Engine, Err, - PGP, RSA, Rand, SMIME, SSL, X509, m2crypto, - ftpslib, httpslib, m2, m2urllib, m2xmlrpclib, - threading, util) + RSA, Rand, SMIME, SSL, X509, m2crypto, ftpslib, + httpslib, m2, m2urllib, m2xmlrpclib, threading, + util) if m2.OPENSSL_VERSION_NUMBER >= 0x90800F and m2.OPENSSL_NO_EC == 0: from M2Crypto import EC diff --git a/doc/M2Crypto.PGP.rst b/doc/M2Crypto.PGP.rst deleted file mode 100644 index 5396b5d..0000000 --- a/doc/M2Crypto.PGP.rst +++ /dev/null @@ -1,51 +0,0 @@ -PGP Package -=========== - -:mod:`PGP` Package ------------------- - -.. automodule:: M2Crypto.PGP - :members: - :undoc-members: - :show-inheritance: - -:mod:`PublicKey` Module ------------------------ - -.. automodule:: M2Crypto.PGP.PublicKey - :members: - :undoc-members: - :show-inheritance: - -:mod:`PublicKeyRing` Module ---------------------------- - -.. automodule:: M2Crypto.PGP.PublicKeyRing - :members: - :undoc-members: - :show-inheritance: - -:mod:`RSA` Module ------------------ - -.. automodule:: M2Crypto.PGP.RSA - :members: - :undoc-members: - :show-inheritance: - -:mod:`constants` Module ------------------------ - -.. automodule:: M2Crypto.PGP.constants - :members: - :undoc-members: - :show-inheritance: - -:mod:`packet` Module --------------------- - -.. automodule:: M2Crypto.PGP.packet - :members: - :undoc-members: - :show-inheritance: - diff --git a/doc/M2Crypto.rst b/doc/M2Crypto.rst index 31a03ad..dc6c706 100644 --- a/doc/M2Crypto.rst +++ b/doc/M2Crypto.rst @@ -214,6 +214,5 @@ Subpackages .. toctree:: - M2Crypto.PGP M2Crypto.SSL diff --git a/doc/doctrees/M2Crypto.SSL.doctree b/doc/doctrees/M2Crypto.SSL.doctree Binary files differindex 3ccda5f..c613ca6 100644 --- a/doc/doctrees/M2Crypto.SSL.doctree +++ b/doc/doctrees/M2Crypto.SSL.doctree diff --git a/doc/doctrees/M2Crypto.doctree b/doc/doctrees/M2Crypto.doctree Binary files differindex 73f49b8..b195fd4 100644 --- a/doc/doctrees/M2Crypto.doctree +++ b/doc/doctrees/M2Crypto.doctree diff --git a/doc/doctrees/ZServerSSL-HOWTO.doctree b/doc/doctrees/ZServerSSL-HOWTO.doctree Binary files differindex 3c2a9fc..a807552 100644 --- a/doc/doctrees/ZServerSSL-HOWTO.doctree +++ b/doc/doctrees/ZServerSSL-HOWTO.doctree diff --git a/doc/doctrees/environment.pickle b/doc/doctrees/environment.pickle Binary files differindex d4e74d6..0068ff7 100644 --- a/doc/doctrees/environment.pickle +++ b/doc/doctrees/environment.pickle diff --git a/doc/doctrees/howto.ca.doctree b/doc/doctrees/howto.ca.doctree Binary files differindex 124cf99..25d7aae 100644 --- a/doc/doctrees/howto.ca.doctree +++ b/doc/doctrees/howto.ca.doctree diff --git a/doc/doctrees/howto.smime.doctree b/doc/doctrees/howto.smime.doctree Binary files differindex 3329844..dde291f 100644 --- a/doc/doctrees/howto.smime.doctree +++ b/doc/doctrees/howto.smime.doctree diff --git a/doc/doctrees/howto.ssl.doctree b/doc/doctrees/howto.ssl.doctree Binary files differindex 438b79b..6032ac5 100644 --- a/doc/doctrees/howto.ssl.doctree +++ b/doc/doctrees/howto.ssl.doctree diff --git a/doc/doctrees/index.doctree b/doc/doctrees/index.doctree Binary files differindex 281514e..ddb7340 100644 --- a/doc/doctrees/index.doctree +++ b/doc/doctrees/index.doctree diff --git a/epydoc.conf b/epydoc.conf index 2afa556..d2c1826 100644 --- a/epydoc.conf +++ b/epydoc.conf @@ -18,9 +18,6 @@ exclude-introspect = M2Crypto.__m2crypto # Variable shadows module, which causes the module to double in the doc # with second instance showing '. Exclude so we only get one (with '). -exclude = M2Crypto.PGP.PublicKey -exclude = M2Crypto.PGP.PublicKeyRing -exclude = M2Crypto.PGP.packet exclude = M2Crypto.SSL.Cipher exclude = M2Crypto.SSL.Connection exclude = M2Crypto.SSL.Context @@ -308,8 +308,7 @@ M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web -session management; FTP/TLS client and server; S/MIME; ZServerSSL: A HTTPS -server for Zope and ZSmime: An S/MIME messenger for Zope. M2Crypto can also be +session management; FTP/TLS client and server; S/MIME; M2Crypto can also be used to provide SSL for Twisted. Smartcards supported through the Engine interface.''' diff --git a/tests/alltests.py b/tests/alltests.py index 3fdff11..3be6729 100644 --- a/tests/alltests.py +++ b/tests/alltests.py @@ -33,7 +33,6 @@ def suite(): 'tests.test_engine', 'tests.test_evp', 'tests.test_obj', - 'tests.test_pgp', 'tests.test_rand', 'tests.test_rc4', 'tests.test_rsa', diff --git a/tests/test_pgp.py b/tests/test_pgp.py deleted file mode 100644 index 32c834f..0000000 --- a/tests/test_pgp.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python - -"""PGP test program. - -Copyright (c) 1999 Ng Pheng Siong. All rights reserved.""" - -from io import BytesIO -try: - import unittest2 as unittest -except ImportError: - import unittest - -from M2Crypto import EVP, PGP, Rand, six - - -@unittest.skipIf( - six.PY3, - 'IGNORED for python3 porting effort as PGP module is unmaintained ' + - 'and not well covered by tests') -class PGPTestCase(unittest.TestCase): - - def test_simple(self): - pkr = PGP.load_pubring('tests/pubring.pgp') - daft = pkr['daft'] - daft_pkt = daft._pubkey_pkt.pack() - s1 = EVP.MessageDigest('sha1') - s1.update(daft_pkt) - s1f = repr(s1.final()) - - buf = BytesIO(daft_pkt) - ps = PGP.PacketStream(buf) - dift_pkt = ps.read() - s2 = EVP.MessageDigest('sha1') - s2.update(dift_pkt.pack()) - s2f = repr(s2.final()) - - self.assertEqual(s1f, s2f) - - -def suite(): - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(PGPTestCase)) - return suite - - -if __name__ == '__main__': - Rand.load_file('randpool.dat', -1) - unittest.TextTestRunner().run(suite()) - Rand.save_file('randpool.dat') |