-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove legacy plugin tests #34
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -460,15 +460,9 @@ end | |
|
||
# https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html | ||
@testset "Encrypt" begin | ||
if OpenSSL.version_number() ≥ v"3" | ||
OpenSSL.load_legacy_provider() | ||
end | ||
evp_ciphers = [ | ||
EvpEncNull(), | ||
EvpBlowFishCBC(), # legacy | ||
EvpBlowFishECB(), # legacy | ||
#EvpBlowFishCFB(), // not supported | ||
EvpBlowFishOFB(), # legacy | ||
EvpAES128CBC(), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
EvpAES128ECB(), | ||
#EvpAES128CFB(), // not supported | ||
|
@@ -503,38 +497,6 @@ end | |
end | ||
end | ||
|
||
@testset "EncryptCustomKey" begin | ||
# EvpBlowFishECB is legacy, consider using EvpAES128ECB instead | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of being removed, this test could be moved to a non-legacy cipher as suggested in the comment. |
||
if OpenSSL.version_number() ≥ v"3" | ||
OpenSSL.load_legacy_provider() | ||
end | ||
evp_cipher = EvpBlowFishECB() | ||
sym_key = random_bytes(evp_cipher.key_length ÷ 2) | ||
init_vector = random_bytes(evp_cipher.init_vector_length ÷ 2) | ||
|
||
enc_evp_cipher_ctx = EvpCipherContext() | ||
encrypt_init(enc_evp_cipher_ctx, evp_cipher, sym_key, init_vector) | ||
|
||
dec_evp_cipher_ctx = EvpCipherContext() | ||
decrypt_init(dec_evp_cipher_ctx, evp_cipher, sym_key, init_vector) | ||
|
||
in_string = "OpenSSL Julia" | ||
in_data = IOBuffer(in_string) | ||
enc_data = IOBuffer() | ||
|
||
cipher(enc_evp_cipher_ctx, in_data, enc_data) | ||
seek(enc_data, 0) | ||
@show String(read(enc_data)) | ||
seek(enc_data, 0) | ||
|
||
dec_data = IOBuffer() | ||
cipher(dec_evp_cipher_ctx, enc_data, dec_data) | ||
out_data = take!(dec_data) | ||
out_string = String(out_data) | ||
|
||
@test in_string == out_string | ||
end | ||
|
||
@testset "StackOf{X509Extension}" begin | ||
ext1 = X509Extension("subjectAltName", "DNS:openssl.jl.com") | ||
ext2 = X509Extension("keyUsage", "digitalSignature, keyEncipherment, keyAgreement") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
load_legacy_provider
function and associated code would go away, I suppose.