Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-cli
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Operations
Operations
Metrics
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-cli
Commits
a9f6f6e4
Commit
a9f6f6e4
authored
Jan 08, 2019
by
Cristian Maglie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated golang.org/x/crypto from `b49d69b` to `ff983b9`
Fix #113
parent
ae9e4bb4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
16 deletions
+57
-16
Gopkg.lock
Gopkg.lock
+2
-2
vendor/golang.org/x/crypto/ed25519/ed25519.go
vendor/golang.org/x/crypto/ed25519/ed25519.go
+38
-9
vendor/golang.org/x/crypto/ssh/terminal/util.go
vendor/golang.org/x/crypto/ssh/terminal/util.go
+2
-2
vendor/golang.org/x/crypto/ssh/terminal/util_aix.go
vendor/golang.org/x/crypto/ssh/terminal/util_aix.go
+12
-0
vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go
vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go
+1
-1
vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go
vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go
+1
-1
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
+1
-1
No files found.
Gopkg.lock
View file @
a9f6f6e4
...
...
@@ -341,7 +341,7 @@
[[projects]]
branch = "master"
digest = "1:
0faa1e97cfa78445bc4d20d70b40929e88040c8f3110eb497f965d41bb6e593a
"
digest = "1:
cfd661f1a52594117f2a753bb640a86d4dbf3e0d778c2641bfbc750e6a1c8be7
"
name = "golang.org/x/crypto"
packages = [
"ed25519",
...
...
@@ -349,7 +349,7 @@
"ssh/terminal",
]
pruneopts = "UT"
revision = "
b49d69b5da943f7ef3c9cf91c8777c1f78a0cc3c
"
revision = "
ff983b9c42bc9fbf91556e191cc8efb585c16908
"
[[projects]]
branch = "master"
...
...
vendor/golang.org/x/crypto/ed25519/ed25519.go
View file @
a9f6f6e4
...
...
@@ -6,7 +6,10 @@
// https://ed25519.cr.yp.to/.
//
// These functions are also compatible with the “Ed25519” function defined in
// RFC 8032.
// RFC 8032. However, unlike RFC 8032's formulation, this package's private key
// representation includes a public key suffix to make multiple signing
// operations with the same key more efficient. This package refers to the RFC
// 8032 private key as the “seed”.
package
ed25519
// This code is a port of the public domain, “ref10” implementation of ed25519
...
...
@@ -31,6 +34,8 @@ const (
PrivateKeySize
=
64
// SignatureSize is the size, in bytes, of signatures generated and verified by this package.
SignatureSize
=
64
// SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032.
SeedSize
=
32
)
// PublicKey is the type of Ed25519 public keys.
...
...
@@ -46,6 +51,15 @@ func (priv PrivateKey) Public() crypto.PublicKey {
return
PublicKey
(
publicKey
)
}
// Seed returns the private key seed corresponding to priv. It is provided for
// interoperability with RFC 8032. RFC 8032's private keys correspond to seeds
// in this package.
func
(
priv
PrivateKey
)
Seed
()
[]
byte
{
seed
:=
make
([]
byte
,
SeedSize
)
copy
(
seed
,
priv
[
:
32
])
return
seed
}
// Sign signs the given message with priv.
// Ed25519 performs two passes over messages to be signed and therefore cannot
// handle pre-hashed messages. Thus opts.HashFunc() must return zero to
...
...
@@ -61,19 +75,33 @@ func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOp
// GenerateKey generates a public/private key pair using entropy from rand.
// If rand is nil, crypto/rand.Reader will be used.
func
GenerateKey
(
rand
io
.
Reader
)
(
publicKey
PublicKey
,
privateKey
PrivateKey
,
err
error
)
{
func
GenerateKey
(
rand
io
.
Reader
)
(
PublicKey
,
PrivateKey
,
error
)
{
if
rand
==
nil
{
rand
=
cryptorand
.
Reader
}
privateKey
=
make
([]
byte
,
PrivateKeySize
)
publicKey
=
make
([]
byte
,
PublicKeySize
)
_
,
err
=
io
.
ReadFull
(
rand
,
privateKey
[
:
32
])
if
err
!=
nil
{
seed
:=
make
([]
byte
,
SeedSize
)
if
_
,
err
:=
io
.
ReadFull
(
rand
,
seed
);
err
!=
nil
{
return
nil
,
nil
,
err
}
digest
:=
sha512
.
Sum512
(
privateKey
[
:
32
])
privateKey
:=
NewKeyFromSeed
(
seed
)
publicKey
:=
make
([]
byte
,
PublicKeySize
)
copy
(
publicKey
,
privateKey
[
32
:
])
return
publicKey
,
privateKey
,
nil
}
// NewKeyFromSeed calculates a private key from a seed. It will panic if
// len(seed) is not SeedSize. This function is provided for interoperability
// with RFC 8032. RFC 8032's private keys correspond to seeds in this
// package.
func
NewKeyFromSeed
(
seed
[]
byte
)
PrivateKey
{
if
l
:=
len
(
seed
);
l
!=
SeedSize
{
panic
(
"ed25519: bad seed length: "
+
strconv
.
Itoa
(
l
))
}
digest
:=
sha512
.
Sum512
(
seed
)
digest
[
0
]
&=
248
digest
[
31
]
&=
127
digest
[
31
]
|=
64
...
...
@@ -85,10 +113,11 @@ func GenerateKey(rand io.Reader) (publicKey PublicKey, privateKey PrivateKey, er
var
publicKeyBytes
[
32
]
byte
A
.
ToBytes
(
&
publicKeyBytes
)
privateKey
:=
make
([]
byte
,
PrivateKeySize
)
copy
(
privateKey
,
seed
)
copy
(
privateKey
[
32
:
],
publicKeyBytes
[
:
])
copy
(
publicKey
,
publicKeyBytes
[
:
])
return
p
ublicKey
,
privateKey
,
nil
return
p
rivateKey
}
// Sign signs the message with privateKey and returns a signature. It will
...
...
vendor/golang.org/x/crypto/ssh/terminal/util.go
View file @
a9f6f6e4
...
...
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin dragonfly freebsd linux,!appengine netbsd openbsd
// +build
aix
darwin dragonfly freebsd linux,!appengine netbsd openbsd
// Package terminal provides support functions for dealing with terminals, as
// commonly found on UNIX systems.
...
...
@@ -25,7 +25,7 @@ type State struct {
termios
unix
.
Termios
}
// IsTerminal returns
true if
the given file descriptor is a terminal.
// IsTerminal returns
whether
the given file descriptor is a terminal.
func
IsTerminal
(
fd
int
)
bool
{
_
,
err
:=
unix
.
IoctlGetTermios
(
fd
,
ioctlReadTermios
)
return
err
==
nil
...
...
vendor/golang.org/x/crypto/ssh/terminal/util_aix.go
0 → 100644
View file @
a9f6f6e4
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build aix
package
terminal
import
"golang.org/x/sys/unix"
const
ioctlReadTermios
=
unix
.
TCGETS
const
ioctlWriteTermios
=
unix
.
TCSETS
vendor/golang.org/x/crypto/ssh/terminal/util_plan9.go
View file @
a9f6f6e4
...
...
@@ -21,7 +21,7 @@ import (
type
State
struct
{}
// IsTerminal returns
true if
the given file descriptor is a terminal.
// IsTerminal returns
whether
the given file descriptor is a terminal.
func
IsTerminal
(
fd
int
)
bool
{
return
false
}
...
...
vendor/golang.org/x/crypto/ssh/terminal/util_solaris.go
View file @
a9f6f6e4
...
...
@@ -17,7 +17,7 @@ type State struct {
termios
unix
.
Termios
}
// IsTerminal returns
true if
the given file descriptor is a terminal.
// IsTerminal returns
whether
the given file descriptor is a terminal.
func
IsTerminal
(
fd
int
)
bool
{
_
,
err
:=
unix
.
IoctlGetTermio
(
fd
,
unix
.
TCGETA
)
return
err
==
nil
...
...
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
View file @
a9f6f6e4
...
...
@@ -26,7 +26,7 @@ type State struct {
mode
uint32
}
// IsTerminal returns
true if
the given file descriptor is a terminal.
// IsTerminal returns
whether
the given file descriptor is a terminal.
func
IsTerminal
(
fd
int
)
bool
{
var
st
uint32
err
:=
windows
.
GetConsoleMode
(
windows
.
Handle
(
fd
),
&
st
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment