usbarmory / interlock

INTERLOCK - file encryption and HSM front-end
Other
295 stars 46 forks source link

Warning messages: missing attribute sha256 #40

Closed rrottmann closed 6 years ago

rrottmann commented 6 years ago

Issue

When compiling the current code according to the README.md Compiling section, the interlock application brings lots of missing attribute warnings:

2018/09/16 11:15:59 status.go:59: missing attribute sha256
2018/09/16 11:15:59 api.go:192: {"response":["missing attribute sha256"],"status":"KO"}

System information

Go version:

go version go1.7.4 linux/arm

Linux system: Fresh install of Raspbian Stretch Lite (2018-06-27-raspbian-stretch-lite.img)

Linux raspberrypi 4.14.69+ #1141 Mon Sep 10 15:13:50 BST 2018 armv6l GNU/Linux

Workaround (possible unsafe)

The following patch will get rid of the attribute warnings but I think the introduced checksums are supposed to be there and the fix is to be found somewhere else.

diff --git a/src/file.go b/src/file.go
index 13d1d05..f40c62b 100644
--- a/src/file.go
+++ b/src/file.go
@@ -366,7 +366,7 @@ func fileList(r *http.Request) (res jsonObject) {
                return errorResponse(err, "")
        }

-       err = validateRequest(req, []string{"path:s", "sha256:b"})
+       err = validateRequest(req, []string{"path:s"})

        if err != nil {
                return errorResponse(err, "")
abarisani commented 6 years ago

I cannot reproduce this, I wonder if you have somewhat older javascript cached in your browser?

With the current code the api/file/list command issued by the UI always sets sha256 accordingly, example:

2018/09/17 10:26:36 api.go:49: 127.0.0.1:55978 POST /api/file/list 2018/09/17 10:26:36 json.go:33: {"path":"/signal","sha256":false}

Please try again by flushing your browser cache first.

rrottmann commented 6 years ago

Thanks for pointing that out! It was in fact the cached file_manager.js from an older release that lacked the sha256 code. It's working perfectly fine now. I reflashed the SD card and reinstalled interlock but the url did not change and the browser tried to use the file from cache.