mirror of
https://github.com/cloudflare/redoctober.git
synced 2026-01-03 11:45:41 +00:00
goimports and go vet cleanups.
This commit is contained in:
10
core/core.go
10
core/core.go
@@ -155,7 +155,7 @@ func Init(path string) (err error) {
|
||||
err = fmt.Errorf("Failed to load password vault %s: %s", path, err)
|
||||
}
|
||||
|
||||
cache = keycache.Cache{make(map[string]keycache.ActiveUser)}
|
||||
cache = keycache.Cache{UserKeys: make(map[string]keycache.ActiveUser)}
|
||||
crypt = cryptor.New(&records, &cache)
|
||||
|
||||
return
|
||||
@@ -279,8 +279,12 @@ func Encrypt(jsonIn []byte) ([]byte, error) {
|
||||
return jsonStatusError(err)
|
||||
}
|
||||
|
||||
// Encrypt file
|
||||
access := cryptor.AccessStructure{s.Owners, s.LeftOwners, s.RightOwners}
|
||||
access := cryptor.AccessStructure{
|
||||
Names: s.Owners,
|
||||
LeftNames: s.LeftOwners,
|
||||
RightNames: s.RightOwners,
|
||||
}
|
||||
|
||||
if resp, err := crypt.Encrypt(s.Data, s.Labels, access); err != nil {
|
||||
log.Println("Error encrypting:", err)
|
||||
return jsonStatusError(err)
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"crypto/sha1"
|
||||
"crypto/sha256"
|
||||
"errors"
|
||||
|
||||
"github.com/cloudflare/redoctober/padding"
|
||||
"github.com/cloudflare/redoctober/symcrypt"
|
||||
)
|
||||
|
||||
@@ -5,10 +5,11 @@ package keycache
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/cloudflare/redoctober/passvault"
|
||||
"github.com/cloudflare/redoctober/symcrypt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/cloudflare/redoctober/passvault"
|
||||
"github.com/cloudflare/redoctober/symcrypt"
|
||||
)
|
||||
|
||||
func TestUsesFlush(t *testing.T) {
|
||||
|
||||
@@ -18,14 +18,15 @@ import (
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"github.com/cloudflare/redoctober/ecdh"
|
||||
"github.com/cloudflare/redoctober/padding"
|
||||
"github.com/cloudflare/redoctober/symcrypt"
|
||||
"golang.org/x/crypto/scrypt"
|
||||
"io/ioutil"
|
||||
"math/big"
|
||||
mrand "math/rand"
|
||||
"os"
|
||||
|
||||
"github.com/cloudflare/redoctober/ecdh"
|
||||
"github.com/cloudflare/redoctober/padding"
|
||||
"github.com/cloudflare/redoctober/symcrypt"
|
||||
"golang.org/x/crypto/scrypt"
|
||||
)
|
||||
|
||||
// Constants for record type
|
||||
|
||||
@@ -2,8 +2,9 @@ package symcrypt
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/cloudflare/redoctober/padding"
|
||||
"testing"
|
||||
|
||||
"github.com/cloudflare/redoctober/padding"
|
||||
)
|
||||
|
||||
func TestCrypt(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user