Commit Graph
322 Commits
Author SHA1 Message Date
Han-Wen Nienhuys 5dc8cb4b8a x/crypto/ssh/agent: add a client example and tweak package doc.
Change-Id: I373fdbb6351d71b12fcfed31cf4b08975a443294
Reviewed-on: https://go-review.googlesource.com/19894
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-26 16:32:03 +00:00
Adam Langley 1f22c01038 x/crypto/ocsp: return errors to reflect OCSP errors.
Previously, OCSP errors (like “malformed request”, not “that certificate
is revoked”) were intended to result in a Response being returned with
Status set to ServerFailed. However, since an “optional” tag was missing
in the ASN.1, a parse error was actually returned.

This CL changes that behaviour so that ParseResponse will now return an
error for these responses. That error will be a ResponseError, allowing
callers to find the exact error code.

Change-Id: I4f8ae5ba39203c2c204fb1d65471d1427bf68b25
Reviewed-on: https://go-review.googlesource.com/18944
Reviewed-by: Adam Langley <agl@golang.org>
2016-01-26 18:40:38 +00:00
Peter Moody 3760e01685 x/crypto/ssh: add function to parse known_hosts files.
Change-Id: I9258ecf2b38258e31bcb6e73ac042ad8125fd2d1
Reviewed-on: https://go-review.googlesource.com/18106
Reviewed-by: Peter Moody <peter.moody@gmail.com>
Reviewed-by: Adam Langley <agl@golang.org>
2016-01-13 19:11:26 +00:00
Sami Commerot d67eb63455 x/crypto/openpgp: add ElGamal support when writing GPG keys.
When writing keys that contain ElGamal subkeys, the openpgp
package would previously return an error.

Change-Id: I1c487f4a9cfb92b40e99e9be6aa4ed5928e36dbe
Reviewed-on: https://go-review.googlesource.com/18254
Reviewed-by: Adam Langley <agl@golang.org>
2016-01-11 18:26:45 +00:00
Adam Langley 803f01ea27 x/crypto/ssh: allow a custom Config to specify CBC mode.
Cryptographic flaws are so hard to kill it can only be a matter of time
before they start crying “brains!” and holding their arms out straight.

Fixes golang/go#13776.

Change-Id: Iee1c19dbe823eb8728e283dd11083638e41f7189
Reviewed-on: https://go-review.googlesource.com/18482
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-01-10 18:39:22 +00:00
Brad Fitzpatrick f23ba3a5ee x/crypto/pkcs12: fix typo in struct tag
No test, though, because I don't know this code. Sad that it passes
with the typo, though.

Fixes golang/go#13855

Change-Id: I1170baa0f94ae4b671f5ca654cb7dcc393d1cc4d
Reviewed-on: https://go-review.googlesource.com/18363
Reviewed-by: Adam Langley <agl@golang.org>
2016-01-07 16:18:51 +00:00
Richard Barnes 552e9d568f ocsp: add support for OCSP response extensions
Some current uses of OCSP require extensions. In particular, Certificate
Transparency (RFC 6962) can use an OCSP extension to carry a Signed
Certificate Timestamp. This patch adds support for OCSP extensions (in
particular, singleExtensions), by adding Extensions and ExtraExtensions
fields with the same semantics as in x509.Certificate.

As a side-effect, trying to parse a response with a critical extension
will now return an error, just like parsing a certificate.

This change does not enable extensions in OCSP requests, just responses.

Change-Id: I5918f26ea1bb9d1ece96e85a6bb7691c7c017467
Reviewed-on: https://go-review.googlesource.com/18202
Reviewed-by: Adam Langley <agl@golang.org>
2016-01-04 21:17:08 +00:00
Mark Severson f18420efc3 x/crypto/ssh/agent: Fix keyring removing the wrong key(s)
The Remove method for the keyring sliced the internal keys list
incorrectly when removing a key. This caused the wrong key to be removed
or sometimes multiple keys were removed. Additionally, if the key to be
removed was the last key, the method never returned.

Fixes golang/go#13628

Change-Id: I0facbcb8f8b65709222067ce37ea26e3fb5ba8e8
Reviewed-on: https://go-review.googlesource.com/17870
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-12-15 19:15:01 +00:00
Carl Jackson 7b85b097bf x/crypto/ssh: run go fmt
Change-Id: Ibb071aa550ca7392543c2d1eba8f8a69ba1d86fa
Reviewed-on: https://go-review.googlesource.com/17270
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-12-01 00:25:08 +00:00
Adam Langley beef0f4390 x/crypto/otr: reformat the libotr test harness with clang-format.
We have clang-format these days to eliminate any worries about C-code
formatting.

Change-Id: I86433d99f786ac4091c39eb4a41422c5a18d4d4a
Reviewed-on: https://go-review.googlesource.com/16937
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-20 20:14:19 +00:00
Adam Langley 8270119ea2 x/crypto/otr: update libotr test code for version 4.
The test for this package contains a test case (disabled by default)
that exercises the code against libotr (the reference implementation).
Since that test was written, libotr has updated to version 4 which
contains non-backwards-compatible API changes.

This change updates the test harness for version 4 of libotr.

Change-Id: Ib40c899c609cc827903ae18fd80476d179bf0a33
Reviewed-on: https://go-review.googlesource.com/16936
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-20 20:13:31 +00:00
Adam Langley fb90bd22f5 x/crypto/otr: make errors fatal.
Since the test against libotr (disabled by default) runs forever, any
errors should be fatal otherwise they'll never be noticed.

Change-Id: Idf07dd963260f140be1950afcbd04331b56bd627
Reviewed-on: https://go-review.googlesource.com/16935
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-20 20:13:25 +00:00
Adam Langley d438f321d3 x/crypto/otr: clear key slots when handshaking.
The OTR implementation had a bug where key slots would not be marked as
unused after a rehandshake. Since handshaking resets the key ids, some
key slots would be left over with much higher key ids. These key slots
would lead to an error when the code ran out of slots.

Fixes agl/xmpp-client#96.

Change-Id: I013bbc4eaf0616373ab52f14b7f7757c353983ca
Reviewed-on: https://go-review.googlesource.com/16934
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-20 20:11:45 +00:00
Jonathan Boulle 346896d577 crypto/ssh: fix typo in error string.
cound -> could
Also change fmt.Errorf -> errors.New for consistency.

Change-Id: I0b6900a76b70cd37ab2e8d61327868b46366ec64
Reviewed-on: https://go-review.googlesource.com/11235
Reviewed-by: Adam Langley <agl@golang.org>
2015-11-15 23:11:30 +00:00
Adam Langley b270509459 x/crypto/openpgp/packet: fix message for errors resulting from an unknown cipher.
Change-Id: Icebde4a001b220a64aa4bcddd206484feed5ad79
Reviewed-on: https://go-review.googlesource.com/15155
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-11-15 20:56:08 +00:00
Arlo Breault ccca2aa616 otr: smpFailureError processing tlvTypeSMP3 prevents sending tlvTypeSMP4
* The other side is left hanging, waiting for their chance to do the
   comparison.

Change-Id: I186933ebb53a30e190414c5572206851681e0a37
Reviewed-on: https://go-review.googlesource.com/15260
Reviewed-by: Adam Langley <agl@golang.org>
2015-11-15 17:51:08 +00:00
Cedric Staub 575fdbe86e x/crypto/pkcs12: deal with short byte array in PBKDF
A bug in the PBKDF implementation in the pkcs12 package caused certain
inputs to produce the wrong output. In step 6C, we treat Ij as a big.Int
of v bytes and compute Ij + B + 1. The resulting big.Int can have
leading zero bytes, such that Ij.Bytes() produces a byte array that is
smaller than v bytes. In this case we must zero-pad the output to make
Ijb properly sized.

Change-Id: I6e672e6f6bbbd5bea419355d318db289731bb174
Reviewed-on: https://go-review.googlesource.com/16520
Reviewed-by: Adam Langley <agl@golang.org>
2015-11-02 18:45:47 +00:00
Paul Meyer c8b9e6388e x/crypto: Add pkcs12 package for reading pkcs12 data
Package pkcs12 provides some Go implementations of PKCS#12.
This implementation is distilled from https://tools.ietf.org/html/rfc7292 and
referenced documents. It is intented for decoding P12/PFX-stored certificate+key
for use with the crypto/tls package.

Package includes @dgryski's RC2 implementation as a sub package as requested in
https://github.com/golang/go/issues/10621.

Change-Id: I78401241e39cd0099e9082a3a227cf0a3a36e6d1
Reviewed-on: https://go-review.googlesource.com/11986
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-10-04 18:58:11 +00:00
Adam Langley 0c93e1ff9f golang.org/x/crypto/openssh: don't loop forever after a bad password.
SymmetricKeyEncrypted cached the results of decryption so, if a bad
password was given, ReadMessage would prompt forever because a later,
correct password wouldn't override the cached decryption.

The SymmetricKeyEncrypted object can't know whether a given passphrase
is correct so it should never have been a mutable object in the first
place. This change makes it so that it doesn't cache anything.

Fixes #9315

Change-Id: Ic2b75f7f60a575e2182ac7e5c5d4198597c5d0a2
Reviewed-on: https://go-review.googlesource.com/14038
Reviewed-by: Andrew Gerrand <adg@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
2015-09-30 00:38:34 +00:00
Lewin Bormann 59a4410d82 x/crypto/ssh: Add protocol version to ServerVersion
280be00 introduced custom server versions; however, at least OpenSSH
clients do not accept a server version that doesn't start with a
protocol version like "SSH-2.0-"; this is not documented in this
library, and automatically adding it in case that the user did not does
no harm.

Change-Id: Iafc23b23160a8277b10cbf29778dc64a96351bd7
Reviewed-on: https://go-review.googlesource.com/14018
Reviewed-by: Adam Langley <agl@golang.org>
2015-09-28 22:51:19 +00:00
Evan Broder e74b0352e5 crypto/ssh: Support turning a crypto.Signer into an ssh.Signer
This adds a NewSignerFromSigner to crypto/ssh which takes a
crypto.Signer and turns it into an ssh.Signer, helpful if, e.g., your
crypto.Signer is backed by some sort of hardware device.

The interfaces are very similar - the biggest differences are that a
crypto.Signer accepts hashed data, while an ssh.Signer does not, and
some differences in encoding for DSA and ECDSA signatures.

This also adjusts NewSignerFromKey to use NewSignerFromSigner where
possible, dropping the rsaPrivateKey and ecdsaPrivateKey types in
favor of wrappedSigner. (However, because *dsa.PrivateKey is not a
crypto.Signer, we still have to keep dsaPrivateKey)

Change-Id: Ia2e20ece9c9d3844b4e5a64c1a7d997178ec8781
Reviewed-on: https://go-review.googlesource.com/10953
Reviewed-by: Adam Langley <agl@golang.org>
2015-09-24 18:35:42 +00:00
Reinaldo de Souza Jr aedad9a179 otr: Fix revealing MAC keys when a DH key is rotated
The existing implementation did not save all the fields in keySlot, which not
only caused a cache miss on every calcDataKeys() but also caused the rotate keys
functions to not find the MAC keys that should be revealed.

It also stops revealing the sending MAC keys. The finite-state analysis of the
otr v2 spec[1] revealed an attack on message integrity when sending MAC keys are
revealed. The spec had been updated accordingly [2].

1 - http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.165.7945&rep=rep1&type=pdf
2 - http://sourceforge.net/p/otr/libotr/ci/58fd90cb77c836ff9fa762e91d2b2becc6d5aae8/

Change-Id: Iee36205994ebdb27d8c890ae25fd9981326401df
Reviewed-on: https://go-review.googlesource.com/12781
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-30 18:06:42 +00:00
Matt Bostock d5c5f1769f crypto/ssh: Parse ECDSA key using struct
Change parseECDSA() to unmarshal the key's contents into a struct
representing the wire format, consistent with the parseRSA() and
parseDSA(), to make the code more readable and its intent clearer.

Change-Id: Iea85630107ac0b3e681807d2278390c8c50ce141
Reviewed-on: https://go-review.googlesource.com/13663
Reviewed-by: Han-Wen Nienhuys <hanwenn@gmail.com>
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-29 22:25:31 +00:00
SeanBurford 2b8f0970a8 openpgp: Handle signatures that have multiple signature packets
Fixes #12242

Change-Id: Ie40e84bc9e7db390219d85a7eddea99accb19cb8
Reviewed-on: https://go-review.googlesource.com/13781
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-29 22:14:55 +00:00
Peter Tseng fc08251b06 openpgp/clearsign: Correctly handle whitespace-only lines
clearsign.Encode currently creates bad signatures for inputs containing
lines that that consist of only whitespace (gpg --verify and
clearsign.Decode both agree the signature is bad).

RFC 4880 section 7.1 says trailing whitespace is removed when generating
the signature. The previous code correctly handled this for the case of
not being at the beginning of the line by buffering the whitespace.

The previous code had incorrect behavior for the case of being at the
beginning of a line. It was only special-casing dashes and newlines,
directly hashing all other characters.

This happened to work for lines that had leading whitespace followed by
non-whitespace characters, since in that case the leading whitespace is
not trailing.

However, this behavior is incorrect for whitespace-only lines: The
previous code would incorrectly add the first whitespace character to
the hash, when instead it should have been dropped.

This commit moves the whitespace check so that it always happens,
regardless of whether we are at the beginning of a line.

This adds a few tests to capture the expected behavior. The last three
tests fail without the included code change.

Change-Id: I17848b8aaad6f7a4cee414d486be236f7edddd0b
Reviewed-on: https://go-review.googlesource.com/13681
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-29 19:39:25 +00:00
Thomas Desrosiers 6c2080b3cc crypto/ssh: clearer error messages when "no ciphers in common"
The error message reported by the ssh client when it can't find a
"cipher" in common between the client and server was overly vague.  This
adds more detailed error messages to findAgreedAlgorithms so that the
user can more easily identify which of the components can't reach
agreement.

Change-Id: I4d985e92fea964793213e5600b52b3141e712000
Reviewed-on: https://go-review.googlesource.com/13817
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-29 19:16:37 +00:00
Richard Barnes 287a1d87db ocsp: use asn1.Enumerated for revocation reason
In the initial patch enabling generation of OCSP responses, the Reason
field in the revokedInfo struct used for serializing responses was set
to type int. That type maps to the ASN.1 type INTEGER, not ENUMERATED,
as required by RFC 6960. As a result, if you serialize an OCSP
resonse with the Reason field populated, then it will be rejected as
malformed by compliant OCSP parsers.

This patch changes the type of the Reason field in revokedInfo to
asn1.Enumerated. It leaves the RevocationReason field in the public
Response struct as int, and converts between the two.  The patch
also adds constant for the defined revocation reasons.

Change-Id: I97205319503f447cde12d9a0bb0bd1a8db7a66ee
Reviewed-on: https://go-review.googlesource.com/13964
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-29 18:47:43 +00:00
Jungho Ahn 81bf7719a6 x/crypto/poly1305: fix memory alignment fault in ARM
The current ARM implementation assumes that the input message
  is memory aligned and so it can cause alignment fault when it
  is not enabled. Also it may generate incorrect outputs in ARMv5.

  This change fixes this issue by temporarily copying the input
  to a local aligned space. Although there may be a better way
  to handle unaligned access, this would be a safe way in all
  ARM versions.

  This change also added a test and benchmarks with unaligned
  data. The benchmark result on RasberryPI 2 is

  Benchmark64  2000000         812 ns/op    78.81 MB/s
  Benchmark1K   200000        7809 ns/op   131.12 MB/s
  Benchmark64Unaligned   2000000         967 ns/op    66.13 MB/s
  Benchmark1KUnaligned    200000       10316 ns/op    99.26 MB/s

Change-Id: I189cc1b7bb6c67a04c9877271fb27326f2896e82
Reviewed-on: https://go-review.googlesource.com/12797
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-19 00:13:40 +00:00
Han-Wen Nienhuys c169681727 crypto/ssh: fix deadlock during error condition.
Unblock writers if a read error occurs while writers are blocked on a
pending key change.

Add test to check for deadlocks in error paths in handshake.go

Fixes golang/go#11992.

Change-Id: Id098bd9fec3d4fe83daeb2b7f935e5647c19afd3
Reviewed-on: https://go-review.googlesource.com/13594
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-17 22:20:11 +00:00
Han-Wen Nienhuys 4e213c0672 x/crypto/ssh: close memPipe after running kex test.
Change-Id: I6022d669946a7cb3403757a7c0dbf21a474e1c95
Reviewed-on: https://go-review.googlesource.com/13590
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-17 22:17:06 +00:00
hanwen aca188fab6 x/crypto/ssh: implement curve25519-sha256@libssh.org key agreement.
Fixes golang/go#11004.

Change-Id: Ic37cf9d620e3397b7ad769ae16abdaee63a7733b
Reviewed-on: https://go-review.googlesource.com/13592
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-17 22:16:34 +00:00
Han-Wen Nienhuys e3ebf1a8d3 x/crypto/ssh/test: test all key exchanges against sshd.
Change-Id: I9d775d6e9c39bee1f2bf914ba3659acb6b0029dd
Reviewed-on: https://go-review.googlesource.com/13591
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-17 21:45:12 +00:00
Richard Barnes 173ce04bfa ocsp: Remove "explicit" tag from "revokedInfo"
The current implementation is not compliant with the ASN.1 structure
for an OCSP response in RFC 6960. In the RFC, the "revoked" field is
marked "implicit". The "explicit" tag in the current struct causes
the encoder to emit an additional SEQUENCE, which cases some parsers
(notably OpenSSL) to reject OCSP responses as malformed.  This patch
simply removes the "explicit" tag, so that the emitted DER is
compliant with the RFC.

Change-Id: Ifa65a73a8d24f08fe3c2794309df772edc8bb114
Reviewed-on: https://go-review.googlesource.com/13572
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-12 10:57:53 +00:00
Eric Garrido 83f1503f77 crypto/ssh: Handle error in dial to avoid a goroutine leak
If the channel open request failed, a nil channel would be provided to
DiscardRequests, which would never return.

We return the error early to avoid this goroutine leak.

Change-Id: I4c0e0a7698f7623c042f2a04941b8c50e8031d33
Reviewed-on: https://go-review.googlesource.com/13390
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-08-08 08:51:02 +00:00
hanwen 2f3083f616 crypto/ssh: allow client to specify host key algorithms.
Fixes golang/go#11722.

Change-Id: I4fa2a1db14050151f9269427ca35cf7ebd21440a
Reviewed-on: https://go-review.googlesource.com/12907
Reviewed-by: Adam Langley <agl@golang.org>
2015-08-04 13:06:53 +00:00
Dave Cheney 77de70a8d4 ssh: fix flake in TestHostKeyCert
Update golang/go#11811

The increased default concurrency in Go 1.5 showed up a test flake in
the TestHostKeyCert test. Under load, when the client provided incorrect
data, both sides would race to tear down the connection, which would often
lead to the server side, running in its own goroutine to see an unexpected
EOF or connection reset.

Fix this flake (and the incorrect use of t.Fatalf) by passing the error back
to the main goroutine for inspection. This also lets us ignore the expected
error in the unsuccessful path

Change-Id: I5a95c6d240479e9d537f34177e5ca8023b1b08e9
Reviewed-on: https://go-review.googlesource.com/12916
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-08-02 23:53:45 +00:00
Dave Cheney 7f27901cb9 ssh: fix deadlock during error path
Fixes golang/go#11882

If an error occurs during handshakeTransport.writePacket the lock may not be
released. Fix this by using defer rather than manually unlocking in all paths.

Change-Id: I0010284b4f7d99907c86b4c0e140ab6cf37b0441
Reviewed-on: https://go-review.googlesource.com/12888
Reviewed-by: Adam Langley <agl@golang.org>
2015-07-30 21:10:58 +00:00
David du Colombier fcdb74e78f ssh: skip TestHandshakeBasic on Plan 9
Updates golang/go#7797.

Change-Id: I7aa57f3fb812ecf644c8f8c065848938868e473b
Reviewed-on: https://go-review.googlesource.com/12767
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-30 09:22:02 +00:00
Dhiru Kholia e7913d6af1 x/crypto: add support for Tiny Encryption Algorithm (TEA)
TEA is still in use, particularly in old software.

The algorithm is described at,
http://www.cix.co.uk/~klockstone/tea.pdf
http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm#Reference_code

Reduced-round variations of TEA are annoyingly common, like,
http://daniel.haxx.se/sansa/mi4code.html

Change-Id: I28d7d584d398e3a96371f344624dc60dec75aea3
Reviewed-on: https://go-review.googlesource.com/10825
Reviewed-by: Adam Langley <agl@golang.org>
2015-07-29 20:20:17 +00:00
Michael Gehring f2c09b05fa x/crypto/openpgp/packet: validate parsed rsa private keys
parseRSAPrivateKey calls rsa.PrivateKey.Precompute which triggers
divide-by-zero panic if either p or q is 1. Sanity check the parsed
values by calling rsa.PrivateKey.Validate.

Fixes golang/go#11505

Change-Id: Ia6c9eccca0cfa49aaa58716e708c557a788bb204
Reviewed-on: https://go-review.googlesource.com/12356
Reviewed-by: Adam Langley <agl@golang.org>
2015-07-29 16:51:43 +00:00
Jeff R. Allen 56474dfd62 crypto/openpgp: make it possible to set the key length
Fixes golang/go#6693.

Change-Id: I7322e107bd5f7ad07062dcaadeaa3e85a101015a
Reviewed-on: https://go-review.googlesource.com/12473
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
2015-07-28 19:24:17 +00:00
Brian Gitonga Marete ae8e58be79 openpgp: Fix panic on v3 public keys with too-short modulus.
Found using gofuzz.

Fixes golang/go#11504

Change-Id: I49cf01e75e37c5d87dad58c5349161d79d0b72f5
Reviewed-on: https://go-review.googlesource.com/12635
Reviewed-by: Adam Langley <agl@golang.org>
2015-07-27 22:43:05 +00:00
Brian Gitonga Marete cb32d3bd66 openpgp: Fix panic on opaque subpackets with length 0.
Some invalid input may be parsed so that the length of an opaque
subpacket turns out to be 0. In such cases, arrange for a
StructuralError to be returned indicating truncation.

Found using gofuzz.

Fixes golang/go#11503

Change-Id: Ib9ce8c604f35a31f852adfcd56a22dfd143a9443
Reviewed-on: https://go-review.googlesource.com/12634
Reviewed-by: Adam Langley <agl@golang.org>
2015-07-27 22:29:30 +00:00
Peter Moody 7d5b0be716 crypto/ssh: allow identities to be constrained.
The ssh-agent protocol allows the usage of keys and certs added to a
given agent to be constrained in certain ways. The only constraints
currently supported are lifetime (keys expire after some number of
seconds) and confirmation (the agent requires user confirmation before
performing any operations with the private key).

Change-Id: Idba5760db929805bf3da43fdcaca53ae6c479ca4
Reviewed-on: https://go-review.googlesource.com/12260
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Peter Moody <pmoody@uber.com>
2015-07-16 17:35:58 +00:00
Andrew Gerrand 4d8f0cfeca ssh: fix spelling of test so that it runs
Change-Id: I65ebae299f272d5f1367ca4c2e47e51f9c392b6a
Reviewed-on: https://go-review.googlesource.com/12229
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-07-15 23:39:58 +00:00
Dmitry Savintsev 02a186af8b crypto/ssh: fix a comment (trivial)
Comment in Agent made to conform the godoc style.

Change-Id: I4e1e8ce1a15ca346715fae257ae2178f5093d40d
Reviewed-on: https://go-review.googlesource.com/12183
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-14 19:39:11 +00:00
Alexander Neumann f6a608df62 poly1305/arm: allow building with Go 1.3
This is the same as https://golang.org/cl/154120043

Since the file textflag.h is not available on Go 1.3, the macros defined
in textflag.h are replaced with their respective value.

Fixes golang/go#11448

Change-Id: I0d4aed67b7afe50d8e4e88915edd2cefeac4cc96
Reviewed-on: https://go-review.googlesource.com/12033
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-11 23:27:05 +00:00
Michael Gehring 4831188890 x/crypto/ssh: fix comment
Fixes golang/go#11603

Change-Id: I019af73f5e036b47b8bd6c4a5541c06b97b44f11
Reviewed-on: https://go-review.googlesource.com/11866
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-06 16:48:17 +00:00
Adam Langley 2f677ffe0a go.crypto/openpgp/packet: fix comment typo.
Thanks to Matt Goodall for pointing this out.

Change-Id: I30225299de2a6aba381f38bd753672c1137c3d5f
Reviewed-on: https://go-review.googlesource.com/11873
Reviewed-by: Adam Langley <agl@golang.org>
2015-07-04 16:26:55 +00:00
Michael Gehring cc04154d65 x/crypto/ssh: fix bounds check in parseString
Fixes #11348

Change-Id: If083744343256a2a53eb813411ba0c9a359d6dbd
Reviewed-on: https://go-review.googlesource.com/11332
Reviewed-by: Adam Langley <agl@golang.org>
2015-06-27 22:03:05 +00:00