1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:11:21 -06:00
Commit Graph

204 Commits

Author SHA1 Message Date
Adam Langley
057bdfe39d crypto/rsa: flip the CRT code over so that it matches PKCS#1
The CRT is symmetrical in the case of two variables and I picked a
different form from PKCS#1.

R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/4381041
2011-04-06 10:22:04 -04:00
Adam Langley
360ab50a9b crypto/rsa: add support for precomputing CRT values.
This speeds up private key operations by 3.5x (for a 2048-bit
modulus).

R=golang-dev, r, rsc1
CC=golang-dev
https://golang.org/cl/4348053
2011-04-05 18:07:01 -04:00
Dmitry Chestnykh
9f1394d270 crypto/ecdsa, crypto/rsa: use io.ReadFull to read from random source.
R=golang-dev, agl1
CC=golang-dev
https://golang.org/cl/4316057
2011-04-05 17:11:31 -04:00
Adam Langley
906b2e7679 crypto/des: cleanups
R=rsc
CC=golang-dev
https://golang.org/cl/4315050
2011-04-05 15:40:48 -04:00
Adam Langley
2db1769d7b crypto/block: remove deprecated package.
R=rsc
CC=golang-dev
https://golang.org/cl/4315051
2011-04-05 15:23:40 -04:00
Russ Cox
de3aac609c gofix: don't rewrite O_APPEND opens
R=r, rog
CC=golang-dev
https://golang.org/cl/4364041
2011-04-05 11:12:02 -04:00
Yasuhiro Matsumoto
7098f3d442 crypto/des: new package providing implementations of DES and TDEA
Original code by Chris Lennert <cale...@gmail.com>

R=rsc, agl1
CC=golang-dev
https://golang.org/cl/4331054
2011-04-05 10:59:10 -04:00
Rob Pike
8a90fd3c72 os: New Open API.
We replace the current Open with:
OpenFile(name, flag, perm) // same as old Open
Open(name) // same as old Open(name, O_RDONLY, 0)
Create(name) // same as old Open(name, O_RDWR|O_TRUNC|O_CREAT, 0666)

This CL includes a gofix module and full code updates: all.bash passes.
(There may be a few comments I missed.)

The interesting packages are:
        gofix
        os
Everything else is automatically generated except for hand tweaks to:
        src/pkg/io/ioutil/ioutil.go
        src/pkg/io/ioutil/tempfile.go
        src/pkg/crypto/tls/generate_cert.go
        src/cmd/goyacc/goyacc.go
        src/cmd/goyacc/units.y

R=golang-dev, bradfitzwork, rsc, r2
CC=golang-dev
https://golang.org/cl/4357052
2011-04-04 23:42:14 -07:00
Brad Fitzpatrick
cc40870f4b httptest: add NewTLSServer
Enables the use of https servers in tests.

R=agl, rsc, agl1
CC=golang-dev
https://golang.org/cl/4284063
2011-04-04 08:32:59 -07:00
Adam Langley
974d2c98e0 crypto/tls: extend NPN support to the client.
R=bradfitzgo, rsc1, bradfitzwork
CC=golang-dev
https://golang.org/cl/4277085
2011-03-29 17:53:09 -04:00
Rob Pike
d844aae690 prints: fix a couple of formatting errors caught by govet
R=rsc, agl, agl1
CC=golang-dev
https://golang.org/cl/4337041
2011-03-29 14:03:08 -07:00
Adam Langley
9225bbfc0c crypto/cipher: bad CTR IV length now triggers panic
R=rsc
CC=golang-dev
https://golang.org/cl/4326042
2011-03-29 15:47:35 -04:00
Mikkel Krautz
a7bb288f99 crypto/x509: Parse Extended Key Usage extension
This changeset makes it possible for crypto/x509 to parse
certificates that include the 'Extended Key Usage' extension
with the critical bit set.

R=agl1
CC=golang-dev
https://golang.org/cl/4277075
2011-03-29 10:35:34 -04:00
Russ Cox
41f93a430f net: drop laddr from Dial, cname from LookupHost; new functions
Drop laddr argument from Dial.

Drop cname return from LookupHost.

Add LookupIP, LookupCNAME, ParseCIDR, IP.Equal.
Export SplitHostPort, JoinHostPort.
Add AAAA (IPv6) support to host lookups.

Preparations for implementing some of the
lookups using cgo.

ParseCIDR and IP.Equal are logically new in this CL
but accidentally snuck into an earlier CL about unused
labels that was in the same client.

In crypto/tls, drop laddr from Dial to match net.

R=golang-dev, dsymonds, adg, rh
CC=golang-dev
https://golang.org/cl/4244055
2011-03-28 23:28:42 -04:00
Rob Pike
7f9acb53cb testing: shorten some more tests
R=rsc
CC=golang-dev
https://golang.org/cl/4314044
2011-03-26 11:25:22 -07:00
Rob Pike
f0cf7d296c testing: shorten some tests.
These are the top runners.  More to come.
Also print two digits of timing info under -test.v.

R=rsc
CC=golang-dev
https://golang.org/cl/4317044
2011-03-25 16:31:10 -07:00
Rob Pike
d406f8f650 testing: set up structure for faster testing using the new -test.short flag.
New make target "testshort" runs "gotest -test.short" and is invoked
by run.bash, which is invoked by all.bash.

Use -test.short to make one package (crypto ecdsa) run much faster.
More changes to come.

Once this is in, I will update the long-running tests to use the new flag.

R=rsc
CC=golang-dev
https://golang.org/cl/4317043
2011-03-25 14:50:44 -07:00
Adam Langley
df184ff2f0 crypto/openpgp: add DSA signature support.
R=bradfitzgo, nsz
CC=golang-dev
https://golang.org/cl/4280041
2011-03-16 10:50:06 -04:00
Adam Langley
7b094182e4 crypto/ecdsa: truncate hash values.
There is some disagreement about how to deal with hash values larger
than the curve order size. We choose to follow OpenSSL's lead here.

R=bradfitzgo, r
CC=golang-dev
https://golang.org/cl/4273059
2011-03-16 10:42:41 -04:00
Brad Fitzpatrick
5245b27ed8 openpgp: add PublicKey KeyId string accessors
R=agl, agl1
CC=golang-dev
https://golang.org/cl/4297041
2011-03-15 10:06:17 -07:00
Dave Cheney
43ae7da190 crypto/tls: fix compile error
Fixes #1555.

R=rsc, bradfitzgo
CC=golang-dev
https://golang.org/cl/4284047
2011-03-12 19:35:41 -08:00
Adam Langley
ee23ab16da crypto/openpgp: s/serialise/serialize/
(No code changes, Americanization only.)

R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4250075
2011-03-10 10:36:04 -05:00
Brad Fitzpatrick
dc06ad5ad7 tls: move PeerCertificates to ConnectionState
R=agl, agl1
CC=golang-dev, rsc
https://golang.org/cl/4248078
2011-03-10 07:22:53 -08:00
Adam Langley
dd5adcc3c3 crypto/openpgp: bug fixes and fix misnamed function.
R=rsc, bradfitzwork
CC=golang-dev
https://golang.org/cl/4244066
2011-03-10 10:14:31 -05:00
Adam Langley
daf33c3ebe crypto/elliptic: add the N value of each curve.
R=rsc
CC=golang-dev
https://golang.org/cl/4240104
2011-03-10 10:04:06 -05:00
Adam Langley
f422242065 crypto/ecdsa: add package.
R=rsc, cw
CC=golang-dev
https://golang.org/cl/4253073
2011-03-10 09:42:34 -05:00
Rob Pike
54f0040723 crypto/openpgp: fix test prints
R=agl, agl1
CC=golang-dev
https://golang.org/cl/4255041
2011-02-25 13:44:37 -08:00
Adam Langley
6ca009f58d crypto/openpgp: add package
R=bradfitzgo
CC=golang-dev
https://golang.org/cl/3989052
2011-02-24 20:19:53 -05:00
Kyle Consalus
07cc8b9ad2 Make.pkg, doc: Replace references to "-benchmarks" and "-match" with "-test.bench" and "-test.run".
R=r
CC=golang-dev
https://golang.org/cl/4197041
2011-02-22 20:23:21 -08:00
Adam Langley
7b166cd73c crypto/openpgp/packet: comment typo fix.
R=rsc
CC=golang-dev
https://golang.org/cl/4178065
2011-02-19 10:41:57 -05:00
Rob Pike
7e6488f9ad crypto/openpgp/packet: fix testing print (missing arg)
R=agl
CC=golang-dev
https://golang.org/cl/4173062
2011-02-18 10:47:38 -08:00
Adam Langley
193709736f crypto/rsa: left-pad OAEP results when needed.
PKCS#1 v2.1 section 7.1.1 says that the result of an OAEP encryption
is "an octet string of length $k$". Since we didn't left-pad the
result it was previously possible for the result to be smaller when
the most-significant byte was zero.

Fixes #1519.

R=rsc
CC=golang-dev
https://golang.org/cl/4175059
2011-02-18 11:31:10 -05:00
Albert Strasheim
712888910b crypto/rand: Added read buffer to speed up requests for small amounts of bytes.
R=agl1, rsc
CC=golang-dev
https://golang.org/cl/4170056
2011-02-17 15:14:41 -05:00
Adam Langley
a0c3b96065 crypto/tls: make protocol negotiation failure fatal
R=r, r2
CC=golang-dev
https://golang.org/cl/4178054
2011-02-15 16:38:45 -05:00
Adam Langley
4ee90b764e crypto/openpgp: minor updates to subpackages
Now that packet/ is checked in, we can add its Makefile. Also, a couple
of updates to error/ and s2k/ for bugfixes and to use the new crypto
package.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4179043
2011-02-11 08:34:19 -05:00
Adam Langley
28a2369414 crypto/openpgp/packet: add remainder of packet types.
(The unittest for Signature may seem a little small, but it's tested by
the higher level code.)

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4173043
2011-02-10 19:59:12 -05:00
Alex Brainman
cf75c86cdf syscall: change windows apis with bool return value to return errno instead
This change is to make these apis similar to their unix counterparts.

R=rsc
CC=golang-dev
https://golang.org/cl/4185042
2011-02-11 10:15:51 +11:00
Adam Langley
9fe490ee38 crypto/openpgp/packet: four more packet types.
R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4156044
2011-02-10 07:56:30 -05:00
Rob Pike
34fc17a820 src/*: fix incorrect prints found by govet
R=gri
CC=golang-dev
https://golang.org/cl/4169044
2011-02-09 17:11:01 -08:00
Adam Langley
531fb5413e crypto/x509: add name constraints support.
R=golang-dev, r, rsc
CC=golang-dev
https://golang.org/cl/4130047
2011-02-09 08:39:31 -05:00
Adam Langley
1b8d373463 crypto/openpgp/packet: add UserId packet type
This was split from CL 4124054

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4126057
2011-02-07 21:40:33 -05:00
Adam Langley
ab2aca5e52 crypto/tls: select best ciphersuite, not worst.
Previously, the outer loop would continue until we selected the
client's least preferable ciphersuite.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4029056
2011-02-05 13:56:36 -05:00
Adam Langley
5626bd9e38 crypto/tls: load a chain of certificates from a file.
Many recently issued certificates are chained: there's one or more
intermediate certificates between the host certificate and the root CA
certificate. This change causes the code to load any number of
certificates from the certificate file. This matches the behaviour of
common webservers, and the output of OpenSSL's command line tools.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/4119057
2011-02-05 13:54:25 -05:00
Adam Langley
c63a88072b crypto/openpgp/packet: two more packet types.
R=bradfitzgo, r
CC=golang-dev
https://golang.org/cl/4124054
2011-02-05 12:06:42 -05:00
Adam Langley
4a14bc524b crypto/openpgp/packet: add public key support
Note that DSA public key support is nascent and the verification
functions clearly don't support it yet. I'm intending to get RSA keys
working first.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/3973054
2011-02-04 09:00:17 -05:00
Adam Langley
364cb831f7 crypto/openpgp/packet: add basic routines
Since nobody suggested major changes to the higher level API, I'm
splitting up the lower level code for review. This is the first of the
changes for the packet reading/writing code.

It deliberately doesn't include a Makefile because the package is
incomplete.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4080051
2011-02-03 09:22:40 -05:00
Adam Langley
2a2995cec8 crypto/openpgp/armor: bug fixes
* Don't require lines to be full.
* Don't forget to flush the line buffer.
* Update the test so that it doesn't happen to include only full lines
  in order to test the above.
* Always write the line after the header as GNUPG expects it.

R=bradfitzgo
CC=golang-dev
https://golang.org/cl/4124043
2011-02-03 09:19:20 -05:00
Adam Langley
fc5c1f0a18 crypto/cipher: add resync open to OCFB mode.
OpenPGP changed its OCFB mode for more modern packets (for example, the
MDC symmetrically encrypted packet). This change adds a bool to
determine which mode is used.

R=bradfitzgo, r, rsc
CC=golang-dev
https://golang.org/cl/4126041
2011-02-03 09:17:42 -05:00
Adam Langley
e308d55973 crypto: add package.
The crypto package is added as a common place to store identifiers for
hash functions. At the moment, the rsa package has an enumeration of
hash functions and knowledge of their digest lengths. This is an
unfortunate coupling and other high level crypto packages tend to need
to duplicate this enumeration and knowledge (i.e. openpgp).

crypto pulls this code out into a common location.

It would also make sense to add similar support for ciphers to crypto,
but the problem there isn't as acute that isn't done in this change.

R=bradfitzgo, r, rsc
CC=golang-dev
https://golang.org/cl/4080046
2011-02-01 11:02:48 -05:00
Adam Langley
166008b988 crypto/dsa: add support for DSA
R=bradfitzgo, r, bradfitzwork, nsz, rsc
CC=golang-dev
https://golang.org/cl/3990043
2011-01-25 12:25:53 -05:00