Sodium::SecureBuffer Fix copying noaccess SecureBuffer's.

master
Didactic Drunk 2019-09-28 08:58:25 -07:00
parent 1e240f70b6
commit f766db7e9e
1 changed files with 4 additions and 1 deletions

View File

@ -49,7 +49,10 @@ module Sodium
# For .dup
def initialize(sbuf : self)
initialize sbuf.bytesize
sbuf.to_slice.copy_to self.to_slice
# Maybe not thread safe
sbuf.readonly do
sbuf.to_slice.copy_to self.to_slice
end
readonly
end