Bump rcw to add error handling for corrupt entries

This commit is contained in:
2026-01-25 16:27:33 -05:00
parent e1c6469506
commit 02fc5c1ffa
3 changed files with 5 additions and 7 deletions
+2 -4
View File
@@ -2,7 +2,6 @@ package core
import (
"errors"
"fmt"
"os"
"strings"
"time"
@@ -74,7 +73,6 @@ func EntryRefresh(oldRCWPassword, newRCWPassword []byte, removeOldDir bool) erro
// decrypt, optimize, and re-encrypt each entry
for _, vanityPath := range entries {
fmt.Println(vanityPath) // TODO handle error in rcw (slice length?) so it can be captured and returned for use by non-CLI clients to track corrupt entries
realPath := global.GetRealPath(vanityPath)
encBytes, err := os.ReadFile(realPath)
if err != nil {
@@ -128,10 +126,10 @@ func VerifyEntries(rcwPassword []byte) error {
}
decBytes, err := wrappers.Decrypt(encBytes, rcwPassword)
if err != nil {
return errors.New("unable verify \"" + vanityPath + "\" (decryption failure): " + err.Error())
return errors.New("unable to verify \"" + vanityPath + "\" (decryption failure): " + err.Error())
}
if len(decBytes) < 1 {
return errors.New("unable verify \"" + vanityPath + "\" (contains 0/nil bytes)")
return errors.New("unable to verify \"" + vanityPath + "\" (contains 0/nil bytes)")
}
}
return nil
+1 -1
View File
@@ -6,7 +6,7 @@ require (
github.com/pkg/sftp v1.13.10
github.com/pquerna/otp v1.5.0
github.com/rwinkhart/go-boilerplate v0.2.2
github.com/rwinkhart/rcw v0.2.4
github.com/rwinkhart/rcw v0.2.5
golang.org/x/crypto v0.47.0
golang.org/x/sys v0.40.0
)
+2 -2
View File
@@ -18,8 +18,8 @@ github.com/rwinkhart/go-winio v0.1.0 h1:b72agLW+dETGmhR3VbcbwnStfgKfc5AfgJOXBJDk
github.com/rwinkhart/go-winio v0.1.0/go.mod h1:ZWa7ssZJT30CCDGJ7fk/2SBTq9BIQrrVjrcss0UW2s0=
github.com/rwinkhart/peercred-mini v0.1.2 h1:4cGWDbv0whvLeVvbUdx84V/9p+2fS+DEXgrA1KxlRFo=
github.com/rwinkhart/peercred-mini v0.1.2/go.mod h1:LLHG7YshHEpbpJJP+Il9nx2dnGj5O3VGE32rWmflj0c=
github.com/rwinkhart/rcw v0.2.4 h1:FrRSsl+ui1WLmDwqjLSROtFPKqSeGLEfF2SPENt4qP0=
github.com/rwinkhart/rcw v0.2.4/go.mod h1:nhW4RAHvEjW2QcOlqEdWqRQOFJLjoOGSPkSRZlMjU3s=
github.com/rwinkhart/rcw v0.2.5 h1:3GJeii9sDZsZNL+HRkfHrnbgxnaB8a9kejiMIfPXnpE=
github.com/rwinkhart/rcw v0.2.5/go.mod h1:qVw8Yp/SKtsuVZYOzzluVEVkoRJ1G7UEh2aR1CXso/U=
github.com/rwinkhart/sys v0.40.0 h1:ZPBbXb+27vLL518sZhhNV89jXK1KbCnFGmYJ2juOQ/c=
github.com/rwinkhart/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=