tesoro

package module
v0.0.0-...-3607189 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

README

ETHSORO

NOTE: This repo is a fork of tesoro that adds eth specific funcionality, and I'm using it as a foundation for some tools I'm building. work in progress.

License

This is distributed under the Apache License v2.0

Copyright 2016 Daniel Esteban - [email protected] Copyright 2018 Matthew Di Ferrante - [email protected]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AES256GCMDecrypt

func AES256GCMDecrypt(cipheredText, key, nonce, tag []byte) ([]byte, error)

func AES256GCMMEncrypt

func AES256GCMMEncrypt(plainText, key []byte) ([]byte, []byte)

func BIP32Path

func BIP32Path(keys []uint32) string

func DecryptEntry

func DecryptEntry(content, key string) (string, error)

func EncryptEntry

func EncryptEntry(content, key string) []byte

func EncryptStorage

func EncryptStorage(s Storage, key string) []byte

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

func GetFileEncKey

func GetFileEncKey(masterKey string) (string, string, string)

func PNGToString

func PNGToString(filename string) ([]byte, error)

func StringToBIP32Path

func StringToBIP32Path(str string) []uint32

func URIToIdentity

func URIToIdentity(uri string) types.IdentityType

func ValidBIP32

func ValidBIP32(path string) bool

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func (*Client) ButtonAck

func (c *Client) ButtonAck() []byte

func (*Client) Call

func (c *Client) Call(msg []byte) (string, uint16)

func (*Client) ChangePin

func (c *Client) ChangePin() []byte

func (*Client) CipherKeyValue

func (c *Client) CipherKeyValue(encrypt bool, key string, value []byte, address []uint32, iv []byte, askOnEncrypt, askOnDecrypt bool) []byte

func (*Client) ClearSession

func (c *Client) ClearSession() []byte

func (*Client) CloseTransport

func (c *Client) CloseTransport()

func (*Client) DecryptMessage

func (c *Client) DecryptMessage(path string, nonce, message, hmac []byte) []byte

func (*Client) EncryptMessage

func (c *Client) EncryptMessage(pubkey, message string, displayOnly bool, path, coinName string) []byte

func (*Client) EntropyAck

func (c *Client) EntropyAck(entropy []byte) []byte

func (*Client) EstimateTxSize

func (c *Client) EstimateTxSize(outputsCount, inputsCount uint32, coinName string) []byte

func (*Client) EthereumGetAddress

func (c *Client) EthereumGetAddress(addressN []uint32, showDisplay bool) []byte

func (*Client) EthereumSignMessage

func (c *Client) EthereumSignMessage(addressN []uint32, message []byte) []byte

func (*Client) EthereumSignTx

func (c *Client) EthereumSignTx(addressN []uint32, nonce big.Int, gasprice big.Int, gaslimit big.Int, to string, value big.Int, data []byte, datalength uint32, chainid uint32) []byte

func (*Client) EthereumTxAck

func (c *Client) EthereumTxAck(data []byte) []byte

func (*Client) FirmwareErase

func (c *Client) FirmwareErase() []byte

func (*Client) FirmwareUpload

func (c *Client) FirmwareUpload(payload []byte) []byte

func (*Client) GetAddress

func (c *Client) GetAddress(addressN []uint32, showDisplay bool, coinName string) []byte

func (*Client) GetECDHSessionKey

func (c *Client) GetECDHSessionKey(uri string, index uint32, peerPublicKey []byte, ecdsaCurveName string) []byte

func (*Client) GetEntropy

func (c *Client) GetEntropy(size uint32) []byte

func (*Client) GetEntryNonce

func (c *Client) GetEntryNonce(title, username, nonce string) []byte

func (*Client) GetFeatures

func (c *Client) GetFeatures() []byte

func (*Client) GetMasterKey

func (c *Client) GetMasterKey() []byte

func (*Client) GetPublicKey

func (c *Client) GetPublicKey(address []uint32) []byte

func (*Client) Header

func (c *Client) Header(msgType messages.MessageType, msg []byte) []byte

func (*Client) Initialize

func (c *Client) Initialize() []byte

func (*Client) LoadDevice

func (c *Client) LoadDevice(mnemonic string, passphraseProtection bool, label, pin string, SkipChecksum bool, U2FCounter uint32) []byte

func (*Client) PassphraseAck

func (c *Client) PassphraseAck(str string) []byte

func (*Client) PinMatrixAck

func (c *Client) PinMatrixAck(str string) []byte

func (*Client) Ping

func (c *Client) Ping(str string, pinProtection, passphraseProtection, buttonProtection bool) []byte

func (*Client) Read

func (c *Client) Read() (string, uint16)

func (*Client) ReadUntil

func (c *Client) ReadUntil() (string, uint16)

func (*Client) RecoveryDevice

func (c *Client) RecoveryDevice(wordCount uint32, passphraseProtection, pinProtection bool, label string, EnforceWordList bool, U2FCounter uint32) []byte

func (*Client) ResetDevice

func (c *Client) ResetDevice(displayRandom bool, strength uint32, passphraseProtection, pinProtection bool, label string, U2FCounter uint32) []byte

func (*Client) SetEntryNonce

func (c *Client) SetEntryNonce(title, username, nonce string) []byte

func (*Client) SetHomescreen

func (c *Client) SetHomescreen(homescreen []byte) []byte

func (*Client) SetLabel

func (c *Client) SetLabel(label string) []byte

func (*Client) SetTransport

func (c *Client) SetTransport(t transport.Transport)

func (*Client) SetU2FCounter

func (c *Client) SetU2FCounter(U2FCounter uint32) []byte

func (*Client) SignIdentity

func (c *Client) SignIdentity(uri string, challengeHidden []byte, challengeVisual string, index uint32) []byte

func (*Client) SignMessage

func (c *Client) SignMessage(message []byte) []byte

func (*Client) SignTx

func (c *Client) SignTx(outputsCount, inputsCount uint32, coinName string, version, lockTime uint32) []byte

func (*Client) TxAck

func (c *Client) TxAck(tx types.TransactionType) []byte

func (*Client) VerifyMessage

func (c *Client) VerifyMessage(address, signature string, message []byte) []byte

func (*Client) WipeDevice

func (c *Client) WipeDevice() []byte

func (*Client) WordAck

func (c *Client) WordAck(str string) []byte

type Config

type Config struct {
	OrderType string `json:"orderType"`
}

type EncryptedData

type EncryptedData struct {
	Type string `json:"type"`
	Data []byte `json:"data"`
}

func (EncryptedData) MarshalJSON

func (e EncryptedData) MarshalJSON() ([]byte, error)

TPM uses []int instead of []byte

type Entry

type Entry struct {
	Title    string        `json:"title"`
	Username string        `json:"username"`
	Nonce    string        `json:"nonce"`
	Note     string        `json:"note"`
	Password EncryptedData `json:"password"`
	SafeNote EncryptedData `json:"safe_note"`
	Tags     []int         `json:"tags"`
}

func (*Entry) Equal

func (e *Entry) Equal(entry Entry) bool

TODO : Work on this

type Storage

type Storage struct {
	Version string           `json:"version"`
	Config  Config           `json:"config"`
	Tags    map[string]Tag   `json:"tags"`
	Entries map[string]Entry `json:"entries"`
}

func DecryptStorage

func DecryptStorage(content, key string) (Storage, error)

type Tag

type Tag struct {
	Title  string `json:"title"`
	Icon   string `json:"icon"`
	Active string `json:"active"`
}

type TxRequest

type TxRequest struct {
	Details *types.TxRequestDetailsType `json:"details,omitempty"`
	Type    types.RequestType           `json:"type,omitempty"`
}

Directories

Path Synopsis
pb
google/protobuf
Package google_protobuf is a generated protocol buffer package.
Package google_protobuf is a generated protocol buffer package.
messages
Package messages is a generated protocol buffer package.
Package messages is a generated protocol buffer package.
types
Package types is a generated protocol buffer package.
Package types is a generated protocol buffer package.
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL