OLD | NEW |
1 """Class for post-handshake certificate checking.""" | 1 """Class for post-handshake certificate checking.""" |
2 | 2 |
3 from utils.cryptomath import hashAndBase64 | 3 from utils.cryptomath import hashAndBase64 |
4 from X509 import X509 | 4 from x509 import X509 |
5 from X509CertChain import X509CertChain | 5 from x509certchain import X509CertChain |
6 from errors import * | 6 from errors import * |
7 | 7 |
8 | 8 |
9 class Checker: | 9 class Checker: |
10 """This class is passed to a handshake function to check the other | 10 """This class is passed to a handshake function to check the other |
11 party's certificate chain. | 11 party's certificate chain. |
12 | 12 |
13 If a handshake function completes successfully, but the Checker | 13 If a handshake function completes successfully, but the Checker |
14 judges the other party's certificate chain to be missing or | 14 judges the other party's certificate chain to be missing or |
15 inadequate, a subclass of | 15 inadequate, a subclass of |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 if not chain.checkProtocol(self.protocol): | 137 if not chain.checkProtocol(self.protocol): |
138 raise TLSAuthorizationError(\ | 138 raise TLSAuthorizationError(\ |
139 "cryptoID protocol mismatch") | 139 "cryptoID protocol mismatch") |
140 if not chain.validate(): | 140 if not chain.validate(): |
141 raise TLSValidationError("cryptoID validation failure") | 141 raise TLSValidationError("cryptoID validation failure") |
142 elif chain: | 142 elif chain: |
143 raise TLSAuthenticationTypeError() | 143 raise TLSAuthenticationTypeError() |
144 else: | 144 else: |
145 raise TLSNoAuthenticationError() | 145 raise TLSNoAuthenticationError() |
146 | 146 |
OLD | NEW |