Skip to content

Commit

Permalink
fix reader
Browse files Browse the repository at this point in the history
  • Loading branch information
jrschumacher committed Nov 5, 2024
1 parent 3a288d8 commit 704aed5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/handlers/tdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ func (h Handler) DecryptBytes(toDecrypt []byte) (*bytes.Buffer, error) {
out := &bytes.Buffer{}
pt := io.Writer(out)
ec := bytes.NewReader(toDecrypt)
switch sdk.GetTdfType(ec) {
tdfType := sdk.GetTdfType(ec)
// reset the reader to the beginning
ec.Reset(toDecrypt)
switch tdfType {
case sdk.Nano:
if _, err := h.sdk.ReadNanoTDF(pt, ec); err != nil {
return nil, err
Expand Down

0 comments on commit 704aed5

Please sign in to comment.