Re-base conversion scripts on libmutton v0.5.0

This commit is contained in:
2026-02-17 21:16:35 -05:00
parent 2e3eb2fea3
commit 11f1fa2a0b
6 changed files with 52 additions and 54 deletions
+9 -9
View File
@@ -1,19 +1,19 @@
module gpgToRCW
go 1.24.4
go 1.26.0
require (
github.com/rwinkhart/go-boilerplate v0.1.0
github.com/rwinkhart/libmutton v0.3.2-0.20250619221323-1c0671354862
github.com/rwinkhart/rcw v0.2.1
github.com/rwinkhart/go-boilerplate v0.3.1
github.com/rwinkhart/libmutton v0.5.0
github.com/rwinkhart/rcw v0.3.0
)
require (
golang.org/x/crypto v0.39.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/crypto v0.48.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/term v0.40.0 // indirect
)
replace golang.org/x/sys => github.com/rwinkhart/sys-freebsd-13-xucred v0.33.0
replace golang.org/x/sys => github.com/rwinkhart/sys v0.41.0
replace github.com/Microsoft/go-winio => github.com/rwinkhart/go-winio-easy-pipe-handles v0.0.0-20250407031321-96994a0e8410
replace github.com/Microsoft/go-winio => github.com/rwinkhart/go-winio v0.1.1
+12 -14
View File
@@ -1,14 +1,12 @@
github.com/rwinkhart/go-boilerplate v0.1.0 h1:EzlVj6R7Bxtl79Nl7R5zRcg6s+Cf2FAqGIzR4giWTQg=
github.com/rwinkhart/go-boilerplate v0.1.0/go.mod h1:cnzIF45I0FCOvE4YIB+26pLCUx2kWyY2llKYZruNaRY=
github.com/rwinkhart/libmutton v0.3.2-0.20250520161453-e64da70edb84 h1:7WUBDHVGgW5Dd4wm56X8qQpWUNOvh2Y/IQkjBl7atEE=
github.com/rwinkhart/libmutton v0.3.2-0.20250520161453-e64da70edb84/go.mod h1:noIP2Ov56fNq2McVhkOj5+VVLOV4E2eie2HbuOhXhXA=
github.com/rwinkhart/libmutton v0.3.2-0.20250619221323-1c0671354862 h1:2sOYCHUzjtB4NBRpqvYYzC6oidkb40otUEGamProVwQ=
github.com/rwinkhart/libmutton v0.3.2-0.20250619221323-1c0671354862/go.mod h1:E0+uwcSUDbuwgwEjwmx4unWVyaHNcSS+bbwGiCFAYf0=
github.com/rwinkhart/rcw v0.2.1 h1:TCKmk557e/+EH3q1VGWiAnWuP7VUHbyhjtJWwpojPtk=
github.com/rwinkhart/rcw v0.2.1/go.mod h1:8aom27OU0OEAUDZni6YQx5YYW6pIotIFfFXxsYTFZsU=
github.com/rwinkhart/sys-freebsd-13-xucred v0.33.0 h1:W4J4cS0yLMLKuYePFFL2OR8MAYLoHkErJvq9FBBqK70=
github.com/rwinkhart/sys-freebsd-13-xucred v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg=
golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ=
github.com/rwinkhart/go-boilerplate v0.3.1 h1:vkVRuptO2s1yPzzwpvtiiB0c/hPB6yr0p1mzZ2Myb9E=
github.com/rwinkhart/go-boilerplate v0.3.1/go.mod h1:ES13A2r9fnCVfyezwMBgY/RgA4pOIudOUXz3Jk/ikes=
github.com/rwinkhart/libmutton v0.5.0 h1:Du/o5Hyb26uE6lubqBISN/ZF9JZ5oObHVveQjAqrP0E=
github.com/rwinkhart/libmutton v0.5.0/go.mod h1:peh8A1f3gnaF97m8J06U28JloKv04Kw8WtFCH+Pcq6s=
github.com/rwinkhart/rcw v0.3.0 h1:OdgA++IGcDrZqN6FzyYnzbz04fL8Q1MHvlgPjhtgJM4=
github.com/rwinkhart/rcw v0.3.0/go.mod h1:UUY7kSku6kV2X1RWPUcK0Re+rQ6RvngWI8DVZJ11cqk=
github.com/rwinkhart/sys v0.41.0 h1:pHB6HphVC132UXYZ6yeOk62abqgl+pyl5ZZnsk4iUKg=
github.com/rwinkhart/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg=
golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM=
+4 -4
View File
@@ -18,8 +18,8 @@ func main() {
// get info from user
var rcwPassphrase []byte
for {
rcwPassphrase = front.InputHidden("RCW passphrase:")
if !bytes.Equal(rcwPassphrase, front.InputHidden("Confirm RCW passphrase:")) {
rcwPassphrase = front.InputSecret("RCW passphrase:")
if !bytes.Equal(rcwPassphrase, front.InputSecret("Confirm RCW passphrase:")) {
fmt.Println(back.AnsiError + "Passphrases do not match" + back.AnsiReset)
continue
}
@@ -42,8 +42,8 @@ func main() {
var decLines []string
for _, entry := range entries {
entry = strings.TrimSuffix(entry, ".gpg")
decLines = decryptGPG(global.TargetLocationFormat(entry))
encBytes := wrappers.Encrypt([]byte(strings.Join(decLines, "\n")), rcwPassphrase)
decLines = decryptGPG(global.GetRealPath(entry))
encBytes := wrappers.Encrypt([]byte(strings.Join(decLines, "\n")), rcwPassphrase, true, false)
err := os.WriteFile(outputDir+strings.ReplaceAll(entry, "/", global.PathSeparator), encBytes, 0600)
if err != nil {
other.PrintError("Failed to write to file: "+err.Error(), back.ErrorWrite)