Commit Graph
600 Commits
Author SHA1 Message Date
Kevin Burke 34d0413e1b scrypt: update recommended parameters for 2017
Previously we documented recommended parameters for scrypt from 2009,
which was eight years ago. Update those parameters and also provide
some guidance to users for configuring those settings in 2017. On my
late 2015 Macbook Pro, the scrypt benchmark with N=1<<15, r=8, p=1
completes in 91 milliseconds.

Add an Example with a salt.

Fixes golang/go#22082.

Change-Id: I23e3920db67583c9fce093768a32e67ab9c979f5
Reviewed-on: https://go-review.googlesource.com/67070
Reviewed-by: Adam Langley <agl@golang.org>
2017-09-30 16:10:57 +00:00
Russ Cox 76eec36fa1 acme/autocert: add Cache to Manager example
If you don't use a cache you're just begging for Let's Encrypt
to ban you for a week due to duplicate certificate requests.
Don't encourage users to get banned.

Change-Id: Icf999c7f28817990bb45931d30692d4040c0ed71
Reviewed-on: https://go-review.googlesource.com/66550
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
2017-09-28 14:24:50 +00:00
Tobias Klauser c84b36c635 blake2b: fix typo in error message
io.EOF is expected by the test, but the error message mentions os.EOF.
Adjust it to io.EOF.

Change-Id: I1a42da8d72f96f8757319183a6bb3281a64b3a40
Reviewed-on: https://go-review.googlesource.com/65870
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-27 20:05:19 +00:00
Tobias Klauser 847319b7fc ssh: remove unused buffer.eof return value
buffer.eof always returns nil and none of the callers check the return
value.

Change-Id: I2053cb6e48dea3a2cd371644a1a5d1a835efda10
Reviewed-on: https://go-review.googlesource.com/56831
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-09-25 11:19:01 +00:00
namusyaka 7d9177d700 acme: reword the godoc to be more human readable
Updates #21902

Change-Id: I2988ba001450339d196da3a0f0687897e807e886
Reviewed-on: https://go-review.googlesource.com/64090
Reviewed-by: JBD <jbd@google.com>
2017-09-16 19:02:15 +00:00
namusyaka b0c9c05bfe all: fix article typos
a -> an

Change-Id: I95a940df64cb825887b75a80eadc822095b49781
Reviewed-on: https://go-review.googlesource.com/63991
Run-TryBot: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
2017-09-15 13:46:28 +00:00
Adam Langley faadfbdc03 cryptobyte: include changes from review of 57810
I forgot to upload the final set of changes before submitting.

Change-Id: I3e60c6e2aad25af7f5007fc5ffbf8a1a1e1a91f3
Reviewed-on: https://go-review.googlesource.com/63331
Reviewed-by: Adam Langley <agl@golang.org>
2017-09-12 19:18:25 +00:00
Adam Langley 2bcb7b5baf cryptobyte: various API and documentation updates.
Change-Id: I83236ecea0774d4ec49e978a391eb3ff5dabdeb6
Reviewed-on: https://go-review.googlesource.com/57810
Reviewed-by: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: Adam Langley <agl@golang.org>
2017-09-12 17:47:39 +00:00
Han-Wen Nienhuys 88e95fbb56 ssh: reject unsupported DSA key sizes
Fixes golang/go#19424.

Change-Id: I73370603dd612979420d608b73d67e673a52362b
Reviewed-on: https://go-review.googlesource.com/62870
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <hi@filippo.io>
Reviewed-by: Adam Langley <agl@golang.org>
2017-09-12 12:23:26 +00:00
Filippo Valsorda 74b34b9dd6 all: make overlap rules wording consistent
Updates golang/go#21279

Change-Id: I686835c644f52e3d5ea2b7e6431ef096d188c19d
Reviewed-on: https://go-review.googlesource.com/61133
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-09-11 15:03:43 +00:00
Adam Langley 9ba3862cf6 nacl/[secret]box: clarify message size comment.
While package comments shouldn't be novels, this throwaway word was not
sufficient (and wasn't mirrored in the `box` package).

This change attempts to include more reasoning without using too many
words.

Fixes golang/go#17673,golang/go#21139

Change-Id: I7fa11e2cd5b8e2010420cc14d784f9b0c65db6d2
Reviewed-on: https://go-review.googlesource.com/35910
Reviewed-by: Russ Cox <rsc@golang.org>
2017-09-09 20:47:57 +00:00
Russ Cox 8f297cd68b openpgp: check errors from ReadKeyRing during test
Otherwise if ReadKeyRing is buggy the errors point elsewhere.

Change-Id: Id2df4b6763ddf93fad5a9824f94af426bf0b7700
Reviewed-on: https://go-review.googlesource.com/62153
Reviewed-by: Adam Langley <agl@golang.org>
2017-09-09 19:24:44 +00:00
Michael Munday 81e90905da sha3: delete unused field
Change-Id: I7dcb8a5ee07cc39e0c503f211f8f77732f006ad6
Reviewed-on: https://go-review.googlesource.com/59170
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-08-25 22:01:21 +00:00
Tobias Klauser eb71ad9bd3 ssh/terminal: set termios VMIN and VTIME in MakeRaw
The Solaris version of MakeRaw already sets VMIN and VTIME explicitly
such that a read returns when one character is available.
cfmakeraw (whose behavior MakeRaw replicate) in glibc and the BSD's libc
also set these values explicitly, so it should be done in the Linux/BSD
versions of MakeRaw as well to be consistent.

Change-Id: I531641ec87fd6a21b7a544b9a464bb90045b0bb1
Reviewed-on: https://go-review.googlesource.com/53570
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Avelino <t@avelino.xxx>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-18 13:51:34 +00:00
Gh0u1L5 b176d7def5 ssh/agent: use right message to unlock agent, with related integration tests
Change-Id: Ie2e7618be63179fb65b8eea60684254712149a77
Reviewed-on: https://go-review.googlesource.com/50810
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-08 11:21:55 +00:00
Kevin Burke 81db3efc71 nacl/auth: add crypto_auth primitive
This matches the implementation in NaCL, so a user can generate
a crypto_auth digest in another language and verify it with Go, or
vice versa.

Fixes golang/go#20265.

Change-Id: Ice96abb9347a5318a16ced5152ebfa7d9ebdd285
Reviewed-on: https://go-review.googlesource.com/51932
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-07 22:21:51 +00:00
Artyom Pervukhin 76c7c60c07 ssh: fix documentation on ServerConfig.PublicKeyCallback
Fix leftovers from the old days to match today's method signature.

Fixes golang/go#21325

Change-Id: Iac5d49bc7cf9e80d07e21148b5e6e1b9bbb59d74
Reviewed-on: https://go-review.googlesource.com/53472
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-07 17:44:02 +00:00
Tobias Klauser 42ff06aea7 ssh/terminal: use console functions, types and consts from x/sys/windows
Use GetConsoleMode, SetConsoleMode and GetConsoleScreenBufferInfo and
the corresponding types and constants from golang.org/x/sys/windows
instead of locally defining them.

Change-Id: I69292a47114d071be261ffda6ca620a0b9820d00
Reviewed-on: https://go-review.googlesource.com/52990
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-08-04 07:50:21 +00:00
Adam Langley c412588e25 ed25519: don't use constant-time functions in Verify.
Verify operates only on public data and thus is not constant-time. The
use of a constant-time function in Verify was thus misleading.

Fixes golang/go#21137

Change-Id: I1ff5a0371fbe8abe62420f19acf3e416fe1b1428
Reviewed-on: https://go-review.googlesource.com/53074
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Kevin Burke <kev@inburke.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-08-03 20:31:46 +00:00
mdp 418008d618 openpgp/packet: fix AES-192 encrypted session keys
The existing implementation checks to see if the session key size is a
multiple of the cipher blocksize. This fails for AES-192, which has a
keysize of 24 bytes and a 16 byte block size. Instead it should simply
check to ensure that the Session Key length is equal to the cipher
KeySize.

Fixes golang/go#17060

Change-Id: I1dc78129f7fb2ca5ec71b650a2adcb3752dca885
Reviewed-on: https://go-review.googlesource.com/35848
Reviewed-by: Adam Langley <agl@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-03 18:24:56 +00:00
Wei Congrui 358f15eacb salsa20/salsa: fix out of bounds write
Fixes golang/go#21104

Change-Id: I59054f9e2beed8a0c7efd513eb84795dc0308353
Reviewed-on: https://go-review.googlesource.com/52391
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-02 16:21:30 +00:00
Tobias Klauser 558b6879de ssh/terminal: use termios ioctl read/write constants from x/sys/unix
Use the TCGETS/TCSETS and TIOCGETA/TIOCSETA definitions from x/sys/unix
instead of manually declaring them or using the corresponding
definitions from syscall.

Change-Id: I37c2c8124d251eb47467b4184a7cc39781775f11
Reviewed-on: https://go-review.googlesource.com/51690
Reviewed-by: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-28 18:30:02 +00:00
Joe Kyo 27b9897dfc acme: clarify the purpose of CertOption interface
This change also moves CertOption and its relevant types and
functions from acme.go to types.go.

Change-Id: I575c2eb39c137a304111883c275c2a2fb1d0bcd2
Reviewed-on: https://go-review.googlesource.com/51650
Run-TryBot: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
2017-07-28 08:04:30 +00:00
Gh0u1L5 2faea1465d ssh/agent: parse constraints when adding keys
Change-Id: I264fc3e3e441d6e5ff7c5aa624eee1018cf9e4de
Reviewed-on: https://go-review.googlesource.com/50811
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
2017-07-26 17:27:32 +00:00
Tobias Assarsson 8c55ac71e0 ssh: add Session.WindowChange to send window change events
Change-Id: Ib89c0a4e46c9a7f90a53f21b06fcddfdf13c7fd9
Reviewed-on: https://go-review.googlesource.com/50490
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-26 09:56:17 +00:00
Brad Fitzpatrick 6914964337 md4: move the example to the right directory
Mistake from https://golang.org/cl/49030 (noted in comments after submission)

Change-Id: Id1c94e875487f380ab04d9797259243f31fe72c8
Reviewed-on: https://go-review.googlesource.com/50390
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
2017-07-20 17:59:35 +00:00
sukrithanda 4bc1c249b1 md4: add example for New
Change-Id: I221d65fd495594ee409b999c7e0f0407b2331ac2
Reviewed-on: https://go-review.googlesource.com/49030
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-19 20:49:34 +00:00
Kevin Burke 4d70248d17 README: add improvements
Move the README to README.md so Gerrit can render it; currently
Gerrit only renders files named exactly "README.md" (for example at
https://go.googlesource.com/go).

Add more links to the README explaining how to file issues,
how to submit code changes, where to download the code to and
how to get it. Hopefully this should help people who go to
https://go.googlesource.com/crypto or https://github.com/golang/crypto
figure out how to get started with development.

Change-Id: I5406d0e6a562ef4a4146b66edc53a6fba7a9c3ee
Reviewed-on: https://go-review.googlesource.com/49811
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-19 14:12:01 +00:00
sbuss 7f7c0c2d75 sha3: added example output
Output for sha3.ShakeSum256 and sha3.NewShake256 examples is now
verified.

Change-Id: I31e186a025cbea20d206a253fccea44e1f8a6e49
Reviewed-on: https://go-review.googlesource.com/48870
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-15 21:18:42 +00:00
Martin Kreichgauer dd85ac7e6a ocsp: remove a redundant conditional expression from an if statement
cert can never be nil here. The statement was incorrectly moved in
e1a4589.

Change-Id: I1fb2aa0bb26a2ad21e6f070952365233fb39a216
Reviewed-on: https://go-review.googlesource.com/48070
Reviewed-by: Adam Langley <agl@golang.org>
2017-07-11 14:53:18 +00:00
Spencer Tung 3627ff35f3 ssh: fix a formatting bug in a test
Change-Id: I34cc1a5a8c59c5e4c0313d7a41c3f31cdbad9e98
Reviewed-on: https://go-review.googlesource.com/47933
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-10 17:40:29 +00:00
Andreas Auernhammer 08a7dbd3d9 blake2b: implement BLAKE2X
This CL implements the BLAKE2X, a extensible-output function (XOF), on
top of BLAKE2b. BLAKE2X is described in https://blake2.net/blake2x.pdf

Fixes golang/go#19513

Change-Id: Ibf33c764c9902e90fd9c8e375583ed153f4de1c7
Reviewed-on: https://go-review.googlesource.com/38055
Reviewed-by: Andreas Auernhammer <aead@mail.de>
Reviewed-by: Adam Langley <agl@golang.org>
2017-07-09 16:53:45 +00:00
Han-Wen Nienhuys a48ac81e47 ssh: allow up to 255 bytes of padding in AES-GCM
The writing side would generate a maximum of 19 bytes of padding, so
the reading side erroneously checked this. However, RFC 5647 specifies
255 as the maximum amount of padding for AES-GCM.

Fixes golang/go#18953.

Change-Id: I416b0023c6e4cbd91a6a1b4214a03f1663b77248
Reviewed-on: https://go-review.googlesource.com/47590
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-06 15:27:25 +00:00
Spencer Tung d625dfd805 ssh: fix if/else returns to adhere to Go style guidelines
Change-Id: Iea55e6397c49046d7d3e0eb66a392f1779d91802
Reviewed-on: https://go-review.googlesource.com/47050
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-06 07:43:13 +00:00
Andreas Auernhammer b286ef4198 blake2s: implement BLAKE2X
This CL implements BLAKE2X, a extensible-output functions (XOF) on top of BLAKE2s.
BLAKE2x is described in https://blake2.net/blake2x.pdf

Change-Id: I20838811e270f4767b8bd5e239a1fe1fb994fe1c
Reviewed-on: https://go-review.googlesource.com/38054
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
2017-07-05 21:44:04 +00:00
Joe Kyo 51714a8c4a acme, acme/autocert: use canonical http header keys
Change-Id: I6aebbd0c351c1dcc27504f5a6fe02bfe7ebe805b
Reviewed-on: https://go-review.googlesource.com/47361
Run-TryBot: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
2017-07-04 13:58:51 +00:00
Spencer Tung 69be088f86 ssh: return authErr array if all authentication attempts fail
Change-Id: I4d6cab266410a8c7960073665eddf8935693087f
Reviewed-on: https://go-review.googlesource.com/44332
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-07-03 16:10:49 +00:00
Joe Kyo 5746f0a2e2 acme: fix mismatched format arguments in acme_test.go
Change-Id: I4d685309e375fd0bb50d1d32c60ac48a7f2515fc
Reviewed-on: https://go-review.googlesource.com/47358
Run-TryBot: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
2017-07-03 13:47:28 +00:00
Joe Kyo 368a6044bc acme/autocert: clean up temporary directories in TestDirCache()
Change-Id: I5de781adf4071158404da6252d06e4c2c33f298b
Reviewed-on: https://go-review.googlesource.com/47356
Reviewed-by: Alex Vaghin <ddos@google.com>
2017-07-03 08:48:21 +00:00
Kevin Burke 5ef0053f77 all: use HTTPS for links that support it
Many websites now support HTTPS that may not at the time the code was
committed; let's use the HTTPS links where we can.

Change-Id: I7099dfa0dbb213294e65b4387f343d6e8f955b97
Reviewed-on: https://go-review.googlesource.com/47131
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-29 04:21:55 +00:00
Yasuhiro Matsumoto 84f24dfdf3 ssh: signal incorrect private key passwords with x509.IncorrectPasswordError
Fixes golang/go#20781

Change-Id: Iae42fff3c9b0b9984509e44a92f9bc99a1a12470
Reviewed-on: https://go-review.googlesource.com/46439
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-28 15:01:44 +00:00
Dave Cheney adbae1b6b6 all: gofmt ./...
Change-Id: I8ffee4dc712091e424b83a9f5a3cc2a6724abefc
Reviewed-on: https://go-review.googlesource.com/46050
Reviewed-by: Matt Layher <mdlayher@gmail.com>
2017-06-19 20:42:22 +00:00
Han-Wen Nienhuys 2ad6eb5ede ssh: clarify intended use of Permissions.
The Permissions struct should be used to pass information from
authentication callback to server application.

Fixes golang/go#20094.

Change-Id: I5542b657d053452327260707a24925286546bfdd
Reviewed-on: https://go-review.googlesource.com/45311
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-19 17:21:03 +00:00
Jeff Hodges 93b5df3bf3 nacl/secretbox: add benchmarks
Initial results on an Ivy Bridge system for reference:

BenchmarkSeal8Bytes-8     	 5000000	       310 ns/op	  25.77 MB/s
BenchmarkSeal100Bytes-8   	 3000000	       599 ns/op	 166.76 MB/s
BenchmarkSeal1K-8         	 1000000	      1825 ns/op	 561.06 MB/s
BenchmarkSeal8K-8         	  100000	     10997 ns/op	 744.88 MB/s
BenchmarkOpen8Bytes-8     	 5000000	       327 ns/op	  24.39 MB/s
BenchmarkOpen100Bytes-8   	 2000000	       630 ns/op	 158.49 MB/s
BenchmarkOpen1K-8         	 1000000	      1752 ns/op	 584.21 MB/s
BenchmarkOpen8K-8         	  200000	     10420 ns/op	 786.12 MB/s

Fixes golang/go#20563

Change-Id: Iaacd9715840c1f5c7ee2459759e79c98a4b6f62a
Reviewed-on: https://go-review.googlesource.com/46039
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-18 20:15:51 +00:00
Johan Brandhorst 850760c427 acme/autocert: enable HTTP/2 on listener
Enables HTTP/2 on any servers used with the autocert listener
by setting "h2" in NextProtos of the listener *tls.Config.
Also adds a warning to the listener documentation that it
enables HTTP/2.

Fixes golang/go#20572

Change-Id: If7c0f5722f0b1781789219fc4e84da3f19a89ab7
Reviewed-on: https://go-review.googlesource.com/45630
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-13 21:03:32 +00:00
Yasuhiro Matsumoto fea6c2c835 ssh: add ParsePrivateKeysWithPassphrase
ssh package doesn't provide way to parse private keys with passphrase.

Fixes golang/go#18692

Change-Id: Ic139f11b6dfe7ef61690d6125e0673d50a48db16
Reviewed-on: https://go-review.googlesource.com/36079
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
2017-06-13 13:45:37 +00:00
Kevin Burke e7ba826830 nacl/box: Add examples
These largely follow the pattern laid out in the secretbox example
file. Hopefully they should demonstrate the best ways to use the `box`
primitives.

Change-Id: I99be5f886e6ffe5f859268d6caa282e263eeacd0
Reviewed-on: https://go-review.googlesource.com/44736
Reviewed-by: Adam Langley <agl@golang.org>
2017-06-06 16:30:16 +00:00
Mathias Hall-Andersen 6e3a28fe26 blake2s: add 128-bit digest support.
Although a 128-bit digest provides little collision resistance it can be
used as a MAC, as found in the WireGuard protocol.

Change-Id: I06ee528e5711035da8f1b254c223a6fda8890abf
Reviewed-on: https://go-review.googlesource.com/39370
Reviewed-by: Adam Langley <agl@golang.org>
2017-06-06 16:20:18 +00:00
Martin Kreichgauer e1a4589e7d ocsp: enhance errors for responses without a matching SingleResponse
ParseResponseForCert would previously complain about an invalid hash OID
if the response contained no SingleResponse matching the certificate
provided by the caller.

Fixes golang/go#19540

Change-Id: I0354c4048707a788ed3d184cc88b4f13f65544ba
Reviewed-on: https://go-review.googlesource.com/44005
Reviewed-by: Adam Langley <agl@golang.org>
2017-06-01 17:31:14 +00:00
Andreas Auernhammer 976dfd0a58 xts: fix incorrect length check
This change does two things:
 1. Fix a length checking bug in the Decrypt function.
 2. Use binary.LittleEndian for byte conversions.

Fixes golang/go#19881

Change-Id: I9d33b92f2bd7e6ca8f69308388f1e8a5c6df2be8
Reviewed-on: https://go-review.googlesource.com/39954
Reviewed-by: Adam Langley <agl@golang.org>
2017-06-01 17:27:53 +00:00