We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c8e85d commit 3ffcc5fCopy full SHA for 3ffcc5f
src/LibCrypto.jl
@@ -899,6 +899,13 @@ end
899
900
function read_pkcs12(fn::AbstractString, pw::SecretBuffer)
901
data = read(fn)
902
+ # Should use cconvert, but Julia 1.10 does not do null termination so added
903
+ # selectively here only.
904
+ if pw.data[end] != 0x00
905
+ seekend(pw)
906
+ write(pw, 0x0)
907
+ seekstart(pw)
908
+ end
909
p12 = ccall((:d2i_PKCS12, libcrypto), Ptr{Cvoid},
910
(Ptr{Cvoid}, Ptr{Ptr{Cuchar}}, Clong),
911
C_NULL, Ref(pointer(data)), length(data))
@@ -909,7 +916,7 @@ function read_pkcs12(fn::AbstractString, pw::SecretBuffer)
916
ret = ccall((:PKCS12_parse, libcrypto), Cint,
917
(Ptr{Cvoid}, Ptr{Cstring},
918
Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}),
912
- p12, cconvert(Cstring, pw), xkey, xcert, xca)
919
+ p12, pointer(pw.data), xkey, xcert, xca)
913
920
openssl_error(ret)
914
921
return Cert(xcert[]), PKey(xkey[])
915
922
end
0 commit comments