Skip to content

Commit

Permalink
Merge pull request #473 from hahattan/issue-471
Browse files Browse the repository at this point in the history
Switch CBOR library for security
  • Loading branch information
cloudxxx8 authored Apr 8, 2020
2 parents 44a3efc + d827b43 commit b92b1a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
11 changes: 7 additions & 4 deletions example/cmd/device-simple/Attribution.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ https://github.com/pmezard/go-difflib/blob/master/LICENSE
stretchr/testify (MIT) https://github.com/stretchr/testify
https://github.com/stretchr/testify/blob/master/LICENSE

ugorji/go (MIT) https://github.com/ugorji/go
https://github.com/ugorji/go/blob/master/LICENSE

kr/logfmt (MIT) https://github.com/kr/logfmt
https://github.com/kr/logfmt/blob/master/Readme

Expand All @@ -112,4 +109,10 @@ edgexfoundry/go-mod-secrets (Apache 2.0) https://github.com/edgexfoundry/go-mod-
https://github.com/edgexfoundry/go-mod-secrets/blob/master/LICENSE

edgexfoundry/go-mod-configuration (Apache 2.0) https://github.com/edgexfoundry/go-mod-configuration
https://github.com/edgexfoundry/go-mod-configuration/blob/master/LICENSE
https://github.com/edgexfoundry/go-mod-configuration/blob/master/LICENSE

fxamacker/cbor (MIT) https://github.com/fxamacker/cbor/v2
https://github.com/fxamacker/cbor/blob/master/LICENSE

x448/float16 (MIT) https://github.com/x448/float16
https://github.com/x448/float16/blob/master/LICENSE
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ module github.com/edgexfoundry/device-sdk-go
require (
github.com/OneOfOne/xxhash v1.2.6
github.com/edgexfoundry/go-mod-bootstrap v0.0.26
github.com/edgexfoundry/go-mod-core-contracts v0.1.52
github.com/edgexfoundry/go-mod-core-contracts v0.1.54
github.com/edgexfoundry/go-mod-registry v0.1.17
github.com/fxamacker/cbor/v2 v2.2.0
github.com/google/uuid v1.1.0
github.com/gorilla/mux v1.7.1
github.com/pkg/errors v0.8.1
github.com/stretchr/testify v1.5.1
github.com/ugorji/go v1.1.4
gopkg.in/yaml.v2 v2.2.8
)

Expand Down
9 changes: 3 additions & 6 deletions pkg/models/commandvalue_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// -*- Mode: Go; indent-tabs-mode: t -*-
//
// Copyright (C) 2018 Canonical Ltd
// Copyright (C) 2018 IOTech Ltd
// Copyright (C) 2020 IOTech Ltd
//
// SPDX-License-Identifier: Apache-2.0

Expand All @@ -18,7 +18,7 @@ import (
"time"

contract "github.com/edgexfoundry/go-mod-core-contracts/models"
"github.com/ugorji/go/codec"
"github.com/fxamacker/cbor/v2"
)

// Test NewCommandValue function
Expand Down Expand Up @@ -722,10 +722,7 @@ func TestNewFloat64Value(t *testing.T) {

// encodeMockEvent accepts a contract.Event and returns a CBOR encoded byte array
func encodeMockEvent(e contract.Event) ([]byte, error) {
var handle codec.CborHandle
var byteBuffer = make([]byte, 0, 64)
enc := codec.NewEncoderBytes(&byteBuffer, &handle)
err := enc.Encode(e)
byteBuffer, err := cbor.Marshal(e)
if err != nil {
return []byte{}, err
}
Expand Down

0 comments on commit b92b1a4

Please sign in to comment.