@@ -538,6 +538,40 @@ def connect():
538538
539539 test_no += 1
540540
541+ print ("Test {0} - good X.509 Ed25519, TLSv1.3" .format (test_no ))
542+ synchro .recv (1 )
543+ connection = connect ()
544+ settings = HandshakeSettings ()
545+ settings .minVersion = (3 , 4 )
546+ settings .maxVersion = (3 , 4 )
547+ connection .handshakeClientCert (settings = settings )
548+ testConnClient (connection )
549+ assert connection .session .cipherSuite in \
550+ constants .CipherSuite .tls13Suites
551+ assert isinstance (connection .session .serverCertChain , X509CertChain )
552+ assert connection .session .serverCertChain .getEndEntityPublicKey ().key_type \
553+ == "Ed25519"
554+ connection .close ()
555+
556+ test_no += 1
557+
558+ print ("Test {0} - good X.509 Ed448, TLSv1.3" .format (test_no ))
559+ synchro .recv (1 )
560+ connection = connect ()
561+ settings = HandshakeSettings ()
562+ settings .minVersion = (3 , 4 )
563+ settings .maxVersion = (3 , 4 )
564+ connection .handshakeClientCert (settings = settings )
565+ testConnClient (connection )
566+ assert connection .session .cipherSuite in \
567+ constants .CipherSuite .tls13Suites
568+ assert isinstance (connection .session .serverCertChain , X509CertChain )
569+ assert connection .session .serverCertChain .getEndEntityPublicKey ().key_type \
570+ == "Ed448"
571+ connection .close ()
572+
573+ test_no += 1
574+
541575 print ("Test {0} - good RSA and ECDSA, TLSv1.3, rsa"
542576 .format (test_no ))
543577 synchro .recv (1 )
@@ -877,6 +911,42 @@ def connect():
877911 assert isinstance (connection .session .serverCertChain , X509CertChain )
878912 connection .close ()
879913
914+ test_no += 1
915+
916+ print ("Test {0} - good X.509 Ed25519, TLSv1.2" .format (test_no ))
917+ synchro .recv (1 )
918+ connection = connect ()
919+ settings = HandshakeSettings ()
920+ settings .minVersion = (3 , 3 )
921+ settings .maxVersion = (3 , 3 )
922+ connection .handshakeClientCert (settings = settings )
923+ testConnClient (connection )
924+ assert connection .session .cipherSuite in \
925+ constants .CipherSuite .ecdheEcdsaSuites
926+ assert isinstance (connection .session .serverCertChain , X509CertChain )
927+ assert connection .session .serverCertChain .getEndEntityPublicKey ().key_type \
928+ == "Ed25519"
929+ connection .close ()
930+
931+ test_no += 1
932+
933+ print ("Test {0} - good X.509 Ed448, TLSv1.2" .format (test_no ))
934+ synchro .recv (1 )
935+ connection = connect ()
936+ settings = HandshakeSettings ()
937+ settings .minVersion = (3 , 3 )
938+ settings .maxVersion = (3 , 3 )
939+ connection .handshakeClientCert (settings = settings )
940+ testConnClient (connection )
941+ assert connection .session .cipherSuite in \
942+ constants .CipherSuite .ecdheEcdsaSuites
943+ assert isinstance (connection .session .serverCertChain , X509CertChain )
944+ assert connection .session .serverCertChain .getEndEntityPublicKey ().key_type \
945+ == "Ed448"
946+ connection .close ()
947+
948+ test_no += 1
949+
880950 print ("Test {0} - good mutual X.509, TLSv1.3 no certs" .format (test_no ))
881951 synchro .recv (1 )
882952 connection = connect ()
@@ -1739,6 +1809,23 @@ def connect():
17391809 with open (os .path .join (dir , "serverDSAKey.pem" )) as f :
17401810 x509KeyDSA = parsePEMKey (f .read (), private = True ,
17411811 implementations = ["python" ])
1812+
1813+ with open (os .path .join (dir , "serverEd25519Cert.pem" )) as f :
1814+ x509CertEd25519 = X509 ().parse (f .read ())
1815+ x509Ed25519Chain = X509CertChain ([x509CertEd25519 ])
1816+ assert x509CertEd25519 .certAlg == "Ed25519"
1817+ with open (os .path .join (dir , "serverEd25519Key.pem" )) as f :
1818+ x509Ed25519Key = parsePEMKey (f .read (), private = True ,
1819+ implementations = ["python" ])
1820+
1821+ with open (os .path .join (dir , "serverEd448Cert.pem" )) as f :
1822+ x509CertEd448 = X509 ().parse (f .read ())
1823+ x509Ed448Chain = X509CertChain ([x509CertEd448 ])
1824+ assert x509CertEd448 .certAlg == "Ed448"
1825+ with open (os .path .join (dir , "serverEd448Key.pem" )) as f :
1826+ x509Ed448Key = parsePEMKey (f .read (), private = True ,
1827+ implementations = ["python" ])
1828+
17421829 test_no = 0
17431830
17441831 print ("Test {0} - Anonymous server handshake" .format (test_no ))
@@ -2080,6 +2167,34 @@ def connect():
20802167
20812168 test_no += 1
20822169
2170+ print ("Test {0} - good X.509 Ed25519, TLSv1.3" .format (test_no ))
2171+ synchro .send (b'R' )
2172+ connection = connect ()
2173+ settings = HandshakeSettings ()
2174+ settings .minVersion = (3 , 4 )
2175+ settings .maxVersion = (3 , 4 )
2176+ connection .handshakeServer (certChain = x509Ed25519Chain ,
2177+ privateKey = x509Ed25519Key , settings = settings )
2178+ assert connection .extendedMasterSecret
2179+ testConnServer (connection )
2180+ connection .close ()
2181+
2182+ test_no += 1
2183+
2184+ print ("Test {0} - good X.509 Ed448, TLSv1.3" .format (test_no ))
2185+ synchro .send (b'R' )
2186+ connection = connect ()
2187+ settings = HandshakeSettings ()
2188+ settings .minVersion = (3 , 4 )
2189+ settings .maxVersion = (3 , 4 )
2190+ connection .handshakeServer (certChain = x509Ed448Chain ,
2191+ privateKey = x509Ed448Key , settings = settings )
2192+ assert connection .extendedMasterSecret
2193+ testConnServer (connection )
2194+ connection .close ()
2195+
2196+ test_no += 1
2197+
20832198 for prot in ["TLSv1.3" , "TLSv1.2" ]:
20842199 for c_type , exp_chain in (("rsa" , x509Chain ),
20852200 ("ecdsa" , x509ecdsaChain )):
@@ -2347,6 +2462,32 @@ def connect():
23472462
23482463 test_no += 1
23492464
2465+ print ("Test {0} - good X.509 Ed25519, TLSv1.2" .format (test_no ))
2466+ synchro .send (b'R' )
2467+ connection = connect ()
2468+ settings = HandshakeSettings ()
2469+ settings .minVersion = (3 , 3 )
2470+ settings .maxVersion = (3 , 3 )
2471+ connection .handshakeServer (certChain = x509Ed25519Chain ,
2472+ privateKey = x509Ed25519Key , settings = settings )
2473+ testConnServer (connection )
2474+ connection .close ()
2475+
2476+ test_no += 1
2477+
2478+ print ("Test {0} - good X.509 Ed448, TLSv1.2" .format (test_no ))
2479+ synchro .send (b'R' )
2480+ connection = connect ()
2481+ settings = HandshakeSettings ()
2482+ settings .minVersion = (3 , 3 )
2483+ settings .maxVersion = (3 , 3 )
2484+ connection .handshakeServer (certChain = x509Ed448Chain ,
2485+ privateKey = x509Ed448Key , settings = settings )
2486+ testConnServer (connection )
2487+ connection .close ()
2488+
2489+ test_no += 1
2490+
23502491 print ("Test {0} - good mutual X.509, TLSv1.3 no certs" .format (test_no ))
23512492 synchro .send (b'R' )
23522493 connection = connect ()
0 commit comments