diff options
author | tb <> | 2023-11-07 21:20:48 +0000 |
---|---|---|
committer | tb <> | 2023-11-07 21:20:48 +0000 |
commit | cd28f4aded80cc04f535af8d72681b48094aeabd (patch) | |
tree | 45ee120643fae10ea8bda259c9e230894d9cd4b0 /src | |
parent | b535eb25dc8618b0d82ce8237fc263e93a49190e (diff) | |
download | openbsd-cd28f4aded80cc04f535af8d72681b48094aeabd.tar.gz openbsd-cd28f4aded80cc04f535af8d72681b48094aeabd.tar.bz2 openbsd-cd28f4aded80cc04f535af8d72681b48094aeabd.zip |
Pull up the handling of the two webcrypto special snowflakes
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/wycheproof/wycheproof.go | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index 9ae9324b75..afbcc941c2 100644 --- a/src/regress/lib/libcrypto/wycheproof/wycheproof.go +++ b/src/regress/lib/libcrypto/wycheproof/wycheproof.go | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: wycheproof.go,v 1.157 2023/11/07 16:56:12 tb Exp $ */ | 1 | /* $OpenBSD: wycheproof.go,v 1.158 2023/11/07 21:20:48 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018,2023 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018,2023 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2018,2019,2022,2023 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018,2019,2022,2023 Theo Buehler <tb@openbsd.org> |
@@ -2443,6 +2443,12 @@ func (wtg *wycheproofTestGroupX25519) run(algorithm string, variant testVariant) | |||
2443 | } | 2443 | } |
2444 | 2444 | ||
2445 | func testGroupFromAlgorithm(algorithm string, variant testVariant) wycheproofTestGroupRunner { | 2445 | func testGroupFromAlgorithm(algorithm string, variant testVariant) wycheproofTestGroupRunner { |
2446 | if algorithm == "ECDH" && variant == Webcrypto { | ||
2447 | return &wycheproofTestGroupECDHWebCrypto{} | ||
2448 | } | ||
2449 | if algorithm == "ECDSA" && variant == Webcrypto { | ||
2450 | return &wycheproofTestGroupECDSAWebCrypto{} | ||
2451 | } | ||
2446 | switch algorithm { | 2452 | switch algorithm { |
2447 | case "AES-CBC-PKCS5": | 2453 | case "AES-CBC-PKCS5": |
2448 | return &wycheproofTestGroupAesCbcPkcs5{} | 2454 | return &wycheproofTestGroupAesCbcPkcs5{} |
@@ -2455,19 +2461,9 @@ func testGroupFromAlgorithm(algorithm string, variant testVariant) wycheproofTes | |||
2455 | case "DSA": | 2461 | case "DSA": |
2456 | return &wycheproofTestGroupDSA{} | 2462 | return &wycheproofTestGroupDSA{} |
2457 | case "ECDH": | 2463 | case "ECDH": |
2458 | switch variant { | 2464 | return &wycheproofTestGroupECDH{} |
2459 | case Webcrypto: | ||
2460 | return &wycheproofTestGroupECDHWebCrypto{} | ||
2461 | default: | ||
2462 | return &wycheproofTestGroupECDH{} | ||
2463 | } | ||
2464 | case "ECDSA": | 2465 | case "ECDSA": |
2465 | switch variant { | 2466 | return &wycheproofTestGroupECDSA{} |
2466 | case Webcrypto: | ||
2467 | return &wycheproofTestGroupECDSAWebCrypto{} | ||
2468 | default: | ||
2469 | return &wycheproofTestGroupECDSA{} | ||
2470 | } | ||
2471 | case "EDDSA": | 2467 | case "EDDSA": |
2472 | return &wycheproofTestGroupEdDSA{} | 2468 | return &wycheproofTestGroupEdDSA{} |
2473 | case "HKDF-SHA-1", "HKDF-SHA-256", "HKDF-SHA-384", "HKDF-SHA-512": | 2469 | case "HKDF-SHA-1", "HKDF-SHA-256", "HKDF-SHA-384", "HKDF-SHA-512": |