Lines Matching refs:self
68 def __init__(self, ciphersuite=None, signature_algorithm=None, named_group=None, argument
70 self._ciphers = []
71 self._sig_algs = []
72 self._named_groups = []
73 self._cert_sig_algs = []
75 self.add_ciphersuites(ciphersuite)
77 self.add_named_groups(named_group)
79 self.add_signature_algorithms(signature_algorithm)
81 self.add_cert_signature_algorithms(cert_sig_alg)
82 self._compat_mode = compat_mode
85 def add_ciphersuites(self, *ciphersuites): argument
86 self._ciphers.extend(
87 [cipher for cipher in ciphersuites if cipher not in self._ciphers])
90 def add_signature_algorithms(self, *signature_algorithms): argument
91 self._sig_algs.extend(
92 [sig_alg for sig_alg in signature_algorithms if sig_alg not in self._sig_algs])
95 def add_named_groups(self, *named_groups): argument
96 self._named_groups.extend(
97 [named_group for named_group in named_groups if named_group not in self._named_groups])
100 def add_cert_signature_algorithms(self, *signature_algorithms): argument
101 self._cert_sig_algs.extend(
102 [sig_alg for sig_alg in signature_algorithms if sig_alg not in self._cert_sig_algs])
105 def pre_checks(self): argument
109 def cmd(self): argument
110 if not self._cert_sig_algs:
111 self._cert_sig_algs = list(CERTIFICATES.keys())
112 return self.pre_cmd()
115 def post_checks(self): argument
119 def pre_cmd(self): argument
123 def hrr_post_checks(self, named_group): argument
141 def cmd(self): argument
144 if self._ciphers:
145 ciphersuites = ':'.join(self._ciphers)
148 if self._sig_algs:
149 signature_algorithms = set(self._sig_algs + self._cert_sig_algs)
154 if self._named_groups:
156 map(lambda named_group: self.NAMED_GROUP[named_group], self._named_groups))
160 if not self._compat_mode:
165 def pre_checks(self): argument
171 if any(x in ffdh_groups for x in self._named_groups):
182 def cmd(self): argument
187 def post_checks(self): argument
190 def pre_cmd(self): argument
192 for _, cert, key in map(lambda sig_alg: CERTIFICATES[sig_alg], self._cert_sig_algs):
202 def pre_cmd(self): argument
204 '-CAfile {cafile}'.format(cafile=CERTIFICATES[self._cert_sig_algs[0]].cafile)]
249 def pre_checks(self): argument
254 def cmd(self): argument
265 if self._ciphers:
267 self._ciphers, self.CIPHER_SUITE))
271 if self._sig_algs:
272 signature_algorithms = set(self._sig_algs + self._cert_sig_algs)
274 signature_algorithms, self.SIGNATURE_ALGORITHM))
279 if self._named_groups:
281 self._named_groups, self.NAMED_GROUP))
291 if not self._compat_mode:
303 def pre_cmd(self): argument
306 for _, cert, key in map(lambda sig_alg: CERTIFICATES[sig_alg], self._cert_sig_algs):
311 def post_checks(self): argument
320 def pre_cmd(self): argument
322 '--x509cafile {cafile}'.format(cafile=CERTIFICATES[self._cert_sig_algs[0]].cafile)]
337 def cmd(self): argument
342 if self._ciphers:
344 map(lambda cipher: self.CIPHER_SUITE[cipher], self._ciphers))
347 if self._sig_algs + self._cert_sig_algs:
349 sig_algs=','.join(set(self._sig_algs + self._cert_sig_algs)))]
351 if self._named_groups:
352 named_groups = ','.join(self._named_groups)
356 def pre_checks(self): argument
360 if self._compat_mode:
363 if 'rsa_pss_rsae_sha256' in self._sig_algs + self._cert_sig_algs:
370 if any(x in ec_groups for x in self._named_groups):
373 if any(x in ffdh_groups for x in self._named_groups):
384 def cmd(self): argument
389 def pre_checks(self): argument
392 def post_checks(self): argument
394 if self._ciphers:
397 self.CIPHER_SUITE[self._ciphers[0]],
398 CIPHER_SUITE_IANA_VALUE[self._ciphers[0]]))
399 if self._sig_algs:
402 SIG_ALG_IANA_VALUE[self._sig_algs[0]]))
404 for named_group in self._named_groups:
412 def pre_cmd(self): argument
414 for _, cert, key in map(lambda sig_alg: CERTIFICATES[sig_alg], self._cert_sig_algs):
418 def hrr_post_checks(self, named_group): argument
427 def pre_cmd(self): argument
429 'ca_file={cafile}'.format(cafile=CERTIFICATES[self._cert_sig_algs[0]].cafile)]
431 def pre_checks(self): argument
434 def hrr_post_checks(self, named_group): argument
439 def post_checks(self): argument
441 if self._ciphers:
444 CIPHER_SUITE_IANA_VALUE[self._ciphers[0]],
445 self.CIPHER_SUITE[self._ciphers[0]]))
446 if self._sig_algs:
449 SIG_ALG_IANA_VALUE[self._sig_algs[0]]))
451 for named_group in self._named_groups: