Skip to content

Commit

Permalink
Remove legacy plugin tests (#34)
Browse files Browse the repository at this point in the history
* Remove legacy plugin tests

* fix

* oops

* just remove the test
  • Loading branch information
quinnj authored Apr 20, 2024
1 parent ffca279 commit 29cd566
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
EvpAES128ECB(),
#EvpAES128CFB(), // not supported
Expand Down Expand Up @@ -503,38 +497,6 @@ end
end
end

@testset "EncryptCustomKey" begin
# EvpBlowFishECB is legacy, consider using EvpAES128ECB instead
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")
Expand Down

0 comments on commit 29cd566

Please sign in to comment.