Commit Graph
408 Commits
Author SHA1 Message Date
Alok Menghrajani 7ac97ebec9 openpgp: fix a typo in a comment
Change-Id: I9fe23643ae644c4cc4a36b14ad6efe99197c8beb
Reviewed-on: https://go-review.googlesource.com/29959
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-28 22:09:27 +00:00
Peter Moody 8e06e8ddd9 x/crypto/ssh/agent: honor constraints on keys in the keyring.
If a key is added to an agent keyring with constraints, honor them.
This will remove keys when they've been on the keyring for
LifetimeSecs seconds or longer and will ask the user to confirm a
signing operation if ConfirmBeforeUse is set.

Change-Id: I633713c5f78b13a628a5d752f11b306b6e16a2ef
Reviewed-on: https://go-review.googlesource.com/28956
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-09-22 17:06:29 +00:00
Kaleb Elwert 6ab629be5e ssh: properly handle wrong guess for FirstKexFollows in server
In the initial key exchange, a client has the option of sending a
guessed key exchange packet. This guess is considered wrong (RFC 4253
Section 7) if "the kex algorithm and/or the host key algorithm is
guessed wrong (server and client have different preferred algorithm),
or if any of the other algorithms cannot be agreed upon...".

The library should be checking the first algorithm in the supported
algorithms, not the agreed algorithm. It also needs to check both the
kex algorithm and the host key algorithm.

Fixes golang/go#16962

Change-Id: I6b62b1f5b39731326280571d373635085135a2a1
Reviewed-on: https://go-review.googlesource.com/28750
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-09-20 07:34:01 +00:00
Jonathan Rudenberg 81372b2fc2 acme/autocert: cache ACME account key
If no key is provided in the *acme.Client, one is generated, but it
is not cached. This means that every restart of the server process
will use a new account.

This change caches the account key, if one is generated, so that
restarts of the server process use the same key.

Change-Id: I80f127b2cc79745a854b220b8918724ca228e87a
Reviewed-on: https://go-review.googlesource.com/28980
Run-TryBot: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
2016-09-15 07:14:17 +00:00
Jessica Frazelle 119f50887f opengpg: set SelfSignature.PreferredHash in NewEntity
Say the user wants to create a NewEntity, then Serialize the private and public
keys. Then call Encrypt. The Hash used first for Encrypt will be `RIPEMD160`,
which is not compiled in by default. So say they _specifically_ pass
crypto.SHA256 as the Default hash to NewEntity, this should set the
PreferredHash in the SelfSignature so they can be encrypted with that hash.

Related to golang/go#12153

Change-Id: I3d89f9d60f9abb29ec8365f81da38b8cd0594587
Reviewed-on: https://go-review.googlesource.com/23209
Reviewed-by: Adam Langley <agl@golang.org>
2016-09-13 21:11:04 +00:00
Péter Szilágyi 80b25ed484 crypto/sha3: use the assembly optimized KeccakF on amd64
NIST published a Keccak Code Package following the SHA-3 workshop
organized in 2014, containing optimized versions of various Keccak
functions for various architectures. This CL converts the GNU asm
code of the Keccak permutation for the x86_64 architecture into Go
assembly.

The code here is almost an identical copy of KeccakF1600_StatePermute,
with the only modification of converting the input state into the
implementation's internal representation and vice versa before return.
This keeps the algorithm an in-place version and avoids requiring
extra external state inits and data XORs before and after the permute.

The speed difference is:

benchmark                          old ns/op     new ns/op     delta
BenchmarkPermutationFunction-8     476           411           -13.66%
BenchmarkSha3_512_MTU-8            9910          8681          -12.40%
BenchmarkSha3_384_MTU-8            7124          6249          -12.28%
BenchmarkSha3_256_MTU-8            5666          4986          -12.00%
BenchmarkSha3_224_MTU-8            5401          4750          -12.05%
BenchmarkShake128_MTU-8            4614          3980          -13.74%
BenchmarkShake256_MTU-8            4935          4295          -12.97%
BenchmarkShake256_16x-8            71850         63798         -11.21%
BenchmarkShake256_1MiB-8           3784244       3285733       -13.17%
BenchmarkSha3_512_1MiB-8           7098875       6163359       -13.18%

benchmark                          old MB/s     new MB/s     speedup
BenchmarkPermutationFunction-8     420.11       486.35       1.16x
BenchmarkSha3_512_MTU-8            136.22       155.51       1.14x
BenchmarkSha3_384_MTU-8            189.49       216.03       1.14x
BenchmarkSha3_256_MTU-8            238.23       270.71       1.14x
BenchmarkSha3_224_MTU-8            249.91       284.19       1.14x
BenchmarkShake128_MTU-8            292.58       339.15       1.16x
BenchmarkShake256_MTU-8            273.53       314.28       1.15x
BenchmarkShake256_16x-8            228.03       256.81       1.13x
BenchmarkShake256_1MiB-8           277.09       319.13       1.15x
BenchmarkSha3_512_1MiB-8           147.71       170.13       1.15x

For further details, please see:
 - http://csrc.nist.gov/groups/ST/hash/sha-3/Aug2014/documents/vanassche_keccak_code.pdf
 - https://github.com/gvanas/KeccakCodePackage

Change-Id: I5b0b9395bba7d8c9acfe2b9c79f6e9c2cf858c7c
Reviewed-on: https://go-review.googlesource.com/17962
Reviewed-by: Adam Langley <agl@golang.org>
2016-09-13 20:24:05 +00:00
Alex Vaghin e311231e83 acme: add WithTemplate option for tls-sni certs
This change allows for more customizations when creating a tls-sni
challenge response.

Same reason as with https://go-review.googlesource.com/27750.

Change-Id: Ia702ede2f4dd867814cfdc1f8925557d3eb455e9
Reviewed-on: https://go-review.googlesource.com/29053
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-12 15:03:27 +00:00
Jonathan Rudenberg 0e31b188fd acme/autocert: use ECDSA P-256 for account key and issued certs
ECDSA P-256 keys are smaller than RSA 2048 keys and signing
operations are faster.

Change-Id: I735f358f17ada4569de307a7af2934d4abf69b91
Reviewed-on: https://go-review.googlesource.com/28851
Run-TryBot: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
2016-09-11 05:36:18 +00:00
Sam Whited aa2481cbfe scrypt: fix broken example in documentation
Fixes golang/go#17046

Change-Id: I7fa7e0b700212992125de32524801048b56ac5d1
Reviewed-on: https://go-review.googlesource.com/28952
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-10 03:01:29 +00:00
Alex Vaghin 05d11b2ca1 acme/autocert: make tests more well-behaved
This change also gets the Manager closer to being able
to cleanup in short-lived HTTP servers running in a long-lived binary.

Change-Id: I49db36156896acc76d4757146c26b99e1665423b
Reviewed-on: https://go-review.googlesource.com/28491
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-09 12:02:17 +00:00
Alex Vaghin f944096df8 acme: implement authorization revocation
As with other methods of the Client, this is an implementation
for the v2 version of the spec.

Change-Id: I7fa7e0b700212992125de32524801048b56ac5d0
Reviewed-on: https://go-review.googlesource.com/28593
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-09-09 11:58:37 +00:00
Reinaldo de Souza Jr 6318898455 crypto/openpgp: return error from userIdSignatureHash
Signature#SignUserId was ignoring the error returned by userIdSignatureHash.
This error can happen, for example, when the Signature's Hash property is
uninitialized. Not returning the error makes it hard for the user to detect
the problem.

Change-Id: I0ae0033e77bfb1ea1c06b0769f949e48c713adc6
Reviewed-on: https://go-review.googlesource.com/27997
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-09-08 19:28:14 +00:00
Brad Fitzpatrick 9e590154d2 acme/autocert: fix data race in tests
Change-Id: I0b5001db9a3541592b4ac0d4bba760b974f9b1a0
Reviewed-on: https://go-review.googlesource.com/28415
Reviewed-by: Alex Vaghin <ddos@google.com>
2016-09-02 16:08:30 +00:00
Alex Vaghin f160b6bf95 acme/autocert: support earlier versions of Go
The package was incorrectly importing both, x/net/context
and the new context packages.

This change makes autocert use only x/net/context to provide
compatibility with the older versions of Go.

Change-Id: I520efcaab9cbe919159e4671cee62335a6e107d9
Reviewed-on: https://go-review.googlesource.com/28299
Reviewed-by: Alex Vaghin <ddos@google.com>
2016-08-31 20:24:46 +00:00
Alex Vaghin dfc9fd3102 acme/autocert: correct acme package import
An internal import slipped through in autocert renewal tests
during https://go-review.googlesource.com/28297 submission.

No internal imports should be found in autocert anymore.

Change-Id: Ib1fc1e0acaf59f363611cec3cd2b81e19f41d6eb
Reviewed-on: https://go-review.googlesource.com/28298
Run-TryBot: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Vaghin <ddos@google.com>
2016-08-31 20:11:01 +00:00
Alex Vaghin d3c1194e7c acme: expose internal/acme as acme package
This moves all of internal/acme into the acme package,
making the lower level API accessible by any other package.

Fixes golang/go#16938.

Change-Id: Ie35f4b6b6b42ebb7fb4ad03ba067df8c3063feff
Reviewed-on: https://go-review.googlesource.com/28297
TryBot-Result: Gobot Gobot <gobot@golang.org>
Run-TryBot: Alex Vaghin <ddos@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-31 19:38:21 +00:00
Alex Vaghin 33b41827e6 acme/autocert: implement certificates renewal
A cert renewal loop is started when a certificate is fetched
from cache for the first time or a new one is created.
At most one renew loop is running per domain.

Closes #16851

Change-Id: I3d5821d8d76e9f2d9b551d0976ebc4cf91647092
Reviewed-on: https://go-review.googlesource.com/27611
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-31 18:15:28 +00:00
Kevin Burke 055d4bfb5c nacl/secretbox: add license header and package prefix
Name the example package "secretbox_test" so we use the public
interface for secretbox in examples. This way the code appears the
same way a user would have to type it.

Change-Id: I0487e39927ddae297ea45e09a3fa397779a8e21d
Reviewed-on: https://go-review.googlesource.com/28222
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-08-31 13:18:26 +00:00
Alex Vaghin b13fc1fd38 acme: take a user provided key in TLSSNIxChallengeCert
Some systems can only operate with a certain key type, for instance RSA,
which makes it impossible for them to use Client provided certificates
to fulfill tls-sni-x challenges since TLSSNIxChallengeCert methods
of the Client always generate ECDSA-based certificates.

At the same time we want to keep using ECDSA-based certificates
in autocert.Manager.

This change allows for a user supplied key when generating tls-sni-x
challenge certficates.

Change-Id: I04f617ff99794a71ef23ad259cb333839f13ae1c
Reviewed-on: https://go-review.googlesource.com/27750
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-30 15:40:08 +00:00
Alex Vaghin 351dc6a5bf acme: add client.DNS01ChallengeRecord
This change adds implementation for dns-01 challenge responses.

Change-Id: I22b2b304ca4a2caeec2980feff19a6c2bc277d8c
Reviewed-on: https://go-review.googlesource.com/27613
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-24 17:30:33 +00:00
Sven Blumenstein 986d331358 crypto/ssh: keep user in ConnMetadata if NoClientAuth is used
The current behaviour of the crypto/ssh server implementation is to
remove the username from ConnMetadata if the connection is done without
authentication (NoClientAuth). This appears to be a bug.

This behaviour is different from other SSH server implementations like
for example Paramiko (Python) which keeps the username.

Additionally RFC4252 (https://www.ietf.org/rfc/rfc4252.txt) section
5 states the username has to be included in every USERAUTH message.

Change-Id: I27fa50db92eb535e90fe088453faa6f2a76ee31f
Reviewed-on: https://go-review.googlesource.com/27612
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-08-24 15:16:49 +00:00
Alex Vaghin b35ccbc95a acme: add Client.WaitAuthorization for polling
It is quite often the case users need to poll an authorization until it
reaches a final state.

This change adds a handy method to do exactly that,
as well as updating autocert.Manager to use the new method.

Change-Id: I4d25e4ee751731815b77980caab6da98d3440b5d
Reviewed-on: https://go-review.googlesource.com/27431
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-22 20:33:07 +00:00
Alex Vaghin 1ba5ec0bf2 acme: add StatusValid to expected values for Authorize
Let's Encrypt may respond with the "valid" value in status
field to authorization requests:
https://github.com/letsencrypt/boulder/blob/0543691d9e2cbcc1b94baf3b9fab4e64ca2750ef/ra/ra.go#L373-L402

The spec isn't clear on this:
https://tools.ietf.org/html/draft-ietf-acme-acme-02#section-6.4

Either way, this change follows common sense and should not produce
unexpected results.

Change-Id: Iac55aa1fb17d458f6d62e8da875ed86e3e4afbc3
Reviewed-on: https://go-review.googlesource.com/27432
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-22 17:42:09 +00:00
Alex Vaghin 7e016f1856 acme: use EC keys where possible
This change improves tests speed further by switching to EC keys where
possible.

We are also switching to EC-based token certs for TLS-SNI-x challenges
in this change. I've confirmed it works with Let's Encrypt production
servers as well, by fulfilling TLS-SNI-01 challenge for a test domain
using autocert.Manager.

Change-Id: I07c532d535ba413af97463dd97cca3d650dfccee
Reviewed-on: https://go-review.googlesource.com/27439
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-22 17:01:11 +00:00
Alex Vaghin 3461a682e1 acme: add support for ECDSA-based signatures
A previous change, https://go-review.googlesource.com/25462, added
support only for encoding JWK with a public ECDSA key.
Client users weren't actually able to make any request
using a EC key because of invalid JWS header and signature.

This change adds EC-based header and signature, which makes the Client
to have full support for ECDSA keys now.

Change-Id: Ia88f08465ce941f72d2001019f5aa47441a17d6e
Reviewed-on: https://go-review.googlesource.com/27438
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-22 15:57:48 +00:00
Alex Vaghin b3cc731755 acme/autocert: replace DNSNames with HostPolicy
Sanjay came up with this idea of a more flexible way
to place restrictions on the Manager using a HostPolicy hook
instead of the static DNSNames field.

HostPolicy allows for user-made custom policies,
as well as makes it possible to change the set of host names
dynamically, without restarting the Manager.

Change-Id: Ib7c6b047469edc6856b59c5e8365690e66f2a3a4
Reviewed-on: https://go-review.googlesource.com/27251
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-21 12:25:19 +00:00
Kevin Burke 88d0005bf4 nacl: use HTTPS for nacl.cr.yp.to links
nacl.cr.yp.to is available over HTTPS and presents a valid certificate, so
seems useful to use it.

Change-Id: I64d86e52cc314641b4169167fe5123d38c2904c0
Reviewed-on: https://go-review.googlesource.com/26812
Reviewed-by: Jonathan Rudenberg <jonathan@titanous.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-19 14:58:26 +00:00
Alex Vaghin 9fbab14f90 acme: add Client.RevokeCert for certificate revocation
This change adds RevokeCert method to Client, implemented as described
in https://tools.ietf.org/html/draft-ietf-acme-acme-02#section-6.6
and https://tools.ietf.org/html/draft-ietf-acme-acme-03#section-6.5.

Change-Id: Ib0defbc299b46268c0f36dbe0f29f0081a3598d5
Reviewed-on: https://go-review.googlesource.com/27092
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-17 14:31:42 +00:00
Alex Vaghin a8a4eedf8c acme/autocert: improve test speed on 386
This change makes the tests run considerably faster on GOARCH=386
by reducing test RSA keys to 512-bit size.

It also increases GetCertificate test timeout to allow for slower
computations.

Change-Id: I7a27ffa5130f9ba08ee2069dad29aed74fa8c521
Reviewed-on: https://go-review.googlesource.com/27094
Run-TryBot: Alex Vaghin <ddos@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-16 21:05:27 +00:00
Alex Vaghin 1f83de14df acme: improve http-01 challenge API
This makes http-01 handling more consistent with tls-sni-* methods
and, hopefully, future implementation such as dns-01 and oob-01.

Change-Id: If1a4a47ee8528ef19960fee4e6860392c1813fe6
Reviewed-on: https://go-review.googlesource.com/27011
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-16 19:51:47 +00:00
Alex Vaghin f0e11a3ccc acme/autocert: new high-level package for automatic cert management
Package autocert provides automatic access to certificates
from Let's Encrypt and any other ACME-based CA.

It is heavily based on the ideas from rsc.io/letsencrypt.

Change-Id: I62021452a918cd49093162f3d6c74e9d7f452fb8
Reviewed-on: https://go-review.googlesource.com/23970
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-16 18:52:56 +00:00
Kevin Burke 1ce41b6ca7 nacl/secretbox: add Seal, Open example
I read the docs and wasn't sure how to use the package - what is
the best way to generate a nonce? Do I need to use the same nonce
for encrypting and decrypting the same message? I read through some
code that used this package, and the tests, found the answers I was
looking for, and used them to generate an example, which hopefully
will be helpful to other users of this package.

Change-Id: I24f9682fecb6632f34b4d8d13fed6eb002993677
Reviewed-on: https://go-review.googlesource.com/26810
Reviewed-by: Adam Langley <agl@golang.org>
2016-08-16 17:48:58 +00:00
Alex Vaghin 807ffeae6d acme: context-aware Client methods
This change adds a context to all exported methods of Client
which may perform network requests, to allow for easier control
over request timeouts and cancellation.

Change-Id: I635a4d7ad39a63ed9e6823b1af12fbb201c19647
Reviewed-on: https://go-review.googlesource.com/27091
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-16 16:58:05 +00:00
Alex Vaghin 6575f7ea32 acme: build up full chain certs when requested
The latest ACME spec (v3) changed the wording to:

    ... the server MUST send one or more link relation header
    fields [RFC5988] with relation "up", each indicating a single
    certificate resource for the issuer of this certificate.  The server
    MAY also include the "up" links from these resources to enable the
    client to build a full certificate chain.

See https://tools.ietf.org/html/draft-ietf-acme-acme-03#section-6.3.1.

Before this change, Client was fetching only the first "up" link, but never
checked to follow the chain further. To my knowledge, Let's Encrypt never
provided a chain longer than 1, this is just to make the Client future proof.

Also fixes google/acme#26.

Change-Id: I35cf5f1997b21a0b2a2d0a732043a7e04b7f1c45
Reviewed-on: https://go-review.googlesource.com/26693
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-15 19:30:22 +00:00
Alex Vaghin a548aac93e acme: format Client and errors
- move required fields before optional in the Client struct
- prefix all errors with "acme: "
- rename tos to tosURL (Terms of Service)

Change-Id: I6914b7e75d1e0559ff8303d390238c2a27145c8e
Reviewed-on: https://go-review.googlesource.com/27010
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-13 21:12:40 +00:00
Alex Vaghin 6c932297e1 acme: preserve account URI on get and update
Let's Encrypt has always provided Account URI in a response
to any registration request (new, get and update) in the Location
header, up until recently (?).

Today, LE's servers provide Account URI only for new-reg requests.
In fact, the spec does not say anything about Account URI and Location
header for "get" and "update" requests.

This change preserves Account URI in return values for "get" and "update"
requests, which is already provided by the caller anyway.

Change-Id: I8b1112d7443935715e9184a511b5e30a27008e8c
Reviewed-on: https://go-review.googlesource.com/26931
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-12 21:42:43 +00:00
Alex Vaghin 595bbbd7f5 acme: improve TLSSNI{01,02}ChallengeCert methods
This is a split of https://go-review.googlesource.com/23970 (patch set 8)
to address only Client changes:

1. Expose expected server name value of TLS SNI ClientHello message
2. Fix a bug where returned error value was nil.

Change-Id: I21f571652e9bbef80a2222dc34fce767270b7c48
Reviewed-on: https://go-review.googlesource.com/26852
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-11 15:23:48 +00:00
Alex Vaghin 5f961cd492 acme: simplify TLS-SNI challenge cert
There's no need to PEM-encode key/cert pair to create a tls.Certificate.

All tls.X509KeyPair does is decode back to DER and verify that the
key corresponds to the cert. But we already know it does.

Change-Id: Icccdaf7fd86317147476fb03cbc71ee7b4a06edb
Reviewed-on: https://go-review.googlesource.com/26694
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-10 14:59:58 +00:00
Anmol Sethi e0d166c33c acme: support for ECDSA keys
Change-Id: I4956b8277969718e70bb4f5f9893213b58e159fc
Reviewed-on: https://go-review.googlesource.com/25462
Reviewed-by: Alex Vaghin <ddos@google.com>
2016-08-05 15:12:09 +00:00
Alex Vaghin 7a1054f3ac acme: TLS-SNI challenges implementation
Current and N-1 versions of the spec adopted TLS-SNI-02, but Let's
Encrypt seems to support TLS-SNI-01, devised in v1 of the spec.

This change implements both, older 01 and current 02 versions of TLS-SNI
challenges.

Change-Id: I2bb76ad852e105098f703cb6113d3996c0e0b118
Reviewed-on: https://go-review.googlesource.com/25450
Reviewed-by: Alex Vaghin <ddos@google.com>
2016-08-04 08:26:12 +00:00
Alex Vaghin 611beeb3d5 acme: specify which version exactly is implemented
The WG has recently published v3 of the spec.
The package implementation is still at v2. So is Let's Encrypt, to be
honest.

Regardless, I think it makes sense to point to the exact version
the package is compatible with.

Change-Id: Ibb3fc51aae363d72f67f7e876ef46c4f51c8da0b
Reviewed-on: https://go-review.googlesource.com/25451
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-08-03 21:26:26 +00:00
Han-Wen Nienhuys bc89c49641 ssh: clarify error type if a SendRequest goes unanswered
This came up in the discussion of issue #16194.

Change-Id: Ibb4cadf3be975377819eca2e41e0992794ada77b
Reviewed-on: https://go-review.googlesource.com/24820
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-25 12:15:03 +00:00
Faiyaz Ahmed 911fafb28f x/crypto/ssh/terminal: have MakeRaw mirror cfmakeraw.
Rather than guessing at which terminal flags should be set or cleared by
MakeRaw, this change tries to make it mirror the behaviour documented
for cfmakeraw() in the termios(3) manpage.

Fixes golang/go#15625

Change-Id: Icd6b18ffb57ea332147c8c9b25eac5e41eb0863a
Reviewed-on: https://go-review.googlesource.com/22964
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Faiyaz Ahmed <ahmedf@vmware.com>
Reviewed-by: Adam Langley <agl@golang.org>
2016-07-18 21:10:49 +00:00
Brad Fitzpatrick f28b56427a ssh: disable known-flaky test from the Go build dashboard
This failure is tracked already. Remove it from the dashboard
while it's fixed so it doesn't hide more interesting failures.

Updates golang/go#15198

Change-Id: Ib48d1e37ac97914ac082b2602c812151147393e4
Reviewed-on: https://go-review.googlesource.com/24986
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-07-17 04:49:09 +00:00
Peter Moody 10c26747e6 x/crypto/ssh: add ed25519 certs to supportedHostKeyAlgos
Change-Id: I46bb7721c081b8a9b0395a4f7c49b7f3e27bbc49
Reviewed-on: https://go-review.googlesource.com/24831
Reviewed-by: Adam Langley <agl@golang.org>
2016-07-14 17:11:52 +00:00
Alex Vaghin 1da79bda50 acme: prompt for terms agreement
Allow Client.Register callers to report CA terms agreement,
simplifying the registration usage.

Change-Id: Ia2c237f31c8375b5ae669bbd07d9294c329f59b8
Reviewed-on: https://go-review.googlesource.com/23973
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-14 16:03:19 +00:00
Fedor Indutny 2c99acdd1e ocsp: fix default value of Version in ResponseData
ASN.1 specification of `ResponseData` is:

    ResponseData ::= SEQUENCE {
          version              [0] EXPLICIT Version DEFAULT v1,
          responderID              ResponderID,
          producedAt               GeneralizedTime,
          responses                SEQUENCE OF SingleResponse,
          responseExtensions   [1] EXPLICIT Extensions OPTIONAL }

Where `Version` is:

    Version ::= INTEGER { v1(0) }

Invalid default value results in a presence of a field that otherwise
should not be present.

See: https://github.com/openssl/openssl/issues/1297
Fixes: golang/#16321

Change-Id: Ibb065a67624e1877cfbe62e0483d781d783f74f0
Reviewed-on: https://go-review.googlesource.com/24841
Reviewed-by: Adam Langley <agl@golang.org>
2016-07-11 18:24:12 +00:00
Peter Moody 9a6bac9c27 x/crypto/ssh/agent: ecdsa key/cert typo
Introduced by me in 21536

Change-Id: I4a5f3507270a3d6eea9779508642ea5789d1efca
Reviewed-on: https://go-review.googlesource.com/24811
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-11 17:04:49 +00:00
Alex Vaghin c2f4947f41 acme: default values and discovery
Add Directory to the Client fields. This removes ACME resource URL
argument from almost all of the Client methods and makes it easier to
use.

Change-Id: I245c975fda914d50fe62ebbec55a4fcf34cb57f2
Reviewed-on: https://go-review.googlesource.com/23972
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-07-09 14:46:51 +00:00
Han-Wen Nienhuys d81fdb778b x/crypto/ssh: handle missing exit status more gracefully.
According to RFC 4254 section 6.10, SSH server implementations may
omit the exit-status and exit-signal messages.  If this happens, we
now return &ExitMissingError{}, so clients can handle this case
specifically.

This came up in the discussion of issue #16194.

Change-Id: Iae5e916b18aa5bd8e95618e9fcfcab8b19e147d9
Reviewed-on: https://go-review.googlesource.com/24727
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-07-06 18:05:22 +00:00