summaryrefslogtreecommitdiff
path: root/lib/thandy/keys.py
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-01-22 10:54:34 -0500
committerNick Mathewson <nickm@torproject.org>2009-01-22 10:56:31 -0500
commitb64339f48280872deec7bb980a61e494f6f38c92 (patch)
treefe8262b8a6e7ca572cfe8c5c26720670697d8f8d /lib/thandy/keys.py
parent2068158fd08ca042b874422ee3826f40803f31d8 (diff)
Fix multiple pychecker-spotted typos.
These are mostly typos in methods that don't get used in the current Thandy, error in error-handling paths, modules we imported unnecessarily, etc.
Diffstat (limited to 'lib/thandy/keys.py')
-rw-r--r--lib/thandy/keys.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/thandy/keys.py b/lib/thandy/keys.py
index 56273e8..211150a 100644
--- a/lib/thandy/keys.py
+++ b/lib/thandy/keys.py
@@ -5,7 +5,6 @@ import Crypto.PublicKey.RSA
import Crypto.Hash.SHA256
import Crypto.Cipher.AES
-import cPickle as pickle
import binascii
import logging
import os
@@ -24,7 +23,7 @@ class PublicKey:
self._roles = []
def format(self):
raise NotImplemented()
- def sign(self, data):
+ def sign(self, data=None, digest=None):
# returns a list of method,signature tuples.
raise NotImplemented()
def checkSignature(self, method, data, signature):
@@ -213,7 +212,7 @@ class RSAKey(PublicKey):
def checkSignature(self, method, sig, obj=None, digest=None):
assert _xor(obj == None, digest == None)
if method != "sha256-pkcs1":
- raise UnknownMethod(method)
+ raise thandy.UnknownMethod(method)
if digest == None:
digest = thandy.formats.getDigest(obj)
sig = base64ToInt(sig)