goimports and go vet cleanups.

This commit is contained in:
Kyle Isom
2015-05-07 15:35:07 -07:00
parent 4ecdcd8614
commit 923804458d
5 changed files with 18 additions and 10 deletions

View File

@@ -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)

View File

@@ -13,6 +13,7 @@ import (
"crypto/sha1"
"crypto/sha256"
"errors"
"github.com/cloudflare/redoctober/padding"
"github.com/cloudflare/redoctober/symcrypt"
)

View File

@@ -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) {

View File

@@ -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

View File

@@ -2,8 +2,9 @@ package symcrypt
import (
"bytes"
"github.com/cloudflare/redoctober/padding"
"testing"
"github.com/cloudflare/redoctober/padding"
)
func TestCrypt(t *testing.T) {