aboutsummaryrefslogtreecommitdiff
path: root/pow/POW-0.7/lib/pkix.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-09-27 23:59:44 +0000
committerRob Austein <sra@hactrn.net>2007-09-27 23:59:44 +0000
commita3c6f733f3e2932c89ef892aa0d74e4f67bf2d69 (patch)
treeea81a97892e7c4f3ab3defdd6d4ffb90d4da9e16 /pow/POW-0.7/lib/pkix.py
parentc58ced06744f024259988cc540fc5a2e370d82ec (diff)
PKCS#10 signature verification. Getting this to work required
changing the implementation of POW.Asymmetric(), which appears to have been using the wrong OpenSSL functions for RSA public keys. If other things using public keys start acting funny, this may be why, and may require further examination. svn path=/pow/POW-0.7/POW.c; revision=1040
Diffstat (limited to 'pow/POW-0.7/lib/pkix.py')
-rwxr-xr-xpow/POW-0.7/lib/pkix.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pow/POW-0.7/lib/pkix.py b/pow/POW-0.7/lib/pkix.py
index 9350aec7..b489a51a 100755
--- a/pow/POW-0.7/lib/pkix.py
+++ b/pow/POW-0.7/lib/pkix.py
@@ -119,8 +119,8 @@ class POWCryptoDriver(CryptoDriver):
def sign(self, key, oid, plaintext):
return key.sign(self._digest(oid, plaintext))
- def verify(self, RSAkey, digestOID, plaintext, signature):
- return key.verify(signature, digest.digest(), self.OID2driver[oid])
+ def verify(self, key, oid, plaintext, signature):
+ return key.verify(signature, self._digest(oid, plaintext), self.OID2driver[oid])
def toPublicDER(self, key):
return key.derWrite(POW.RSA_PUBLIC_KEY)
@@ -1220,6 +1220,7 @@ class CertificationRequest(Sequence):
def verify(self):
driver = getCryptoDriver()
oid = self.signatureAlgorithm.get()[0]
+ # Should check self.certificationRequestInfo.subjectPublicKeyInfo.algorithmId
rsa = driver.fromPublicDER(self.certificationRequestInfo.subjectPublicKeyInfo.toString())
return driver.verify(rsa, oid, self.certificationRequestInfo.toString(), self.signatureValue.get())