Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Merge b6cb2b0 into e7dc0fd
Browse files Browse the repository at this point in the history
  • Loading branch information
shashidharatd committed Feb 3, 2015
2 parents e7dc0fd + b6cb2b0 commit 1cfc2c0
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion appid/appid.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package appid

import (
"code.google.com/p/gogoprotobuf/proto"
"errors"
"fmt"
"github.com/cloudfoundry/loggregatorlib/logmessage"
"github.com/gogo/protobuf/proto"
"net/url"
)

Expand Down
2 changes: 1 addition & 1 deletion emitter/emit.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package emitter

import (
"code.google.com/p/gogoprotobuf/proto"
"github.com/cloudfoundry/gosteno"
"github.com/cloudfoundry/loggregatorlib/loggregatorclient"
"github.com/cloudfoundry/loggregatorlib/logmessage"
"github.com/gogo/protobuf/proto"
// "regexp"
"strings"
"time"
Expand Down
2 changes: 1 addition & 1 deletion emitter/emit_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package emitter_test

import (
"code.google.com/p/gogoprotobuf/proto"
. "github.com/cloudfoundry/loggregatorlib/emitter"
"github.com/cloudfoundry/loggregatorlib/logmessage"
"github.com/cloudfoundry/loggregatorlib/logmessage/testhelpers"
"github.com/gogo/protobuf/proto"
"strings"

"github.com/cloudfoundry/loggregatorlib/loggregatorclient/fake"
Expand Down
2 changes: 1 addition & 1 deletion logmessage/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package logmessage

import (
"bytes"
"code.google.com/p/gogoprotobuf/proto"
"encoding/binary"
"github.com/gogo/protobuf/proto"
)

func DumpMessage(msg Message, buffer *bytes.Buffer) {
Expand Down
2 changes: 1 addition & 1 deletion logmessage/log_message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion logmessage/message.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package logmessage

import (
"code.google.com/p/gogoprotobuf/proto"
"errors"
"github.com/cloudfoundry/loggregatorlib/signature"
"github.com/gogo/protobuf/proto"
"time"
)

Expand Down
2 changes: 1 addition & 1 deletion logmessage/message_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package logmessage

import (
"code.google.com/p/gogoprotobuf/proto"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/assert"
"testing"
"time"
Expand Down
2 changes: 1 addition & 1 deletion logmessage/testhelpers/logmessage_testhelper.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package testhelpers

import (
"code.google.com/p/gogoprotobuf/proto"
"github.com/cloudfoundry/loggregatorlib/logmessage"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/assert"
"testing"
"time"
Expand Down
10 changes: 5 additions & 5 deletions signature/symmetric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var _ = Describe("Encryption", func() {
Expect(decrypted).To(Equal(message))
Expect(encrypted).NotTo(Equal(message))
})

It("encrypts and decrypts with a 'short' key", func() {
key := "short key"
encrypted, err := Encrypt(key, message)
Expand All @@ -31,7 +31,7 @@ var _ = Describe("Encryption", func() {
Expect(decrypted).To(Equal(message))
Expect(encrypted).NotTo(Equal(message))
})

It("fails to decrypt with the wrong key", func() {
key := "short key"
encrypted, err := Encrypt(key, message)
Expand All @@ -40,7 +40,7 @@ var _ = Describe("Encryption", func() {
_, err = Decrypt("wrong key", encrypted)
Expect(err).To(HaveOccurred())
})

It("is non-deterministic", func() {
key := "aaaaaaaaaaaaaaaa"
encrypted1, err := Encrypt(key, message)
Expand All @@ -51,11 +51,11 @@ var _ = Describe("Encryption", func() {

Expect(encrypted1).NotTo(Equal(encrypted2))
})

It("correctly computes a digest", func() {
Expect(DigestBytes([]byte("some-key"))).To(Equal([]byte{0x68, 0x2f, 0x66, 0x97, 0xfa, 0x93, 0xec, 0xa6, 0xc8, 0x1, 0xa2, 0x32, 0x51, 0x9a, 0x9, 0xe3, 0xfe, 0xc, 0x5c, 0x33, 0x94, 0x65, 0xee, 0x53, 0xc3, 0xf9, 0xed, 0xf9, 0x2f, 0xd0, 0x1f, 0x35}))
})

It("deterministically computes the actual encryption key", func() {
key := "12345"
Expect(getEncryptionKey(key)).To(Equal([]byte{0x59, 0x94, 0x47, 0x1a, 0xbb, 0x1, 0x11, 0x2a, 0xfc, 0xc1, 0x81, 0x59, 0xf6, 0xcc, 0x74, 0xb4}))
Expand Down

0 comments on commit 1cfc2c0

Please sign in to comment.