Commit Graph
18 Commits
Author SHA1 Message Date
Filippo Valsorda a6a393ffd6 all: bump go.mod version and drop compatibility shims
Also, remove the legacy import annotations.

Fixes golang/go#68147

Change-Id: Ibfcc9322f27224c0ba92ea42cd56912a7d8783fd
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/594256
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
2024-06-26 15:12:35 +00:00
Dmitri Shuralyov 8779cbd1c9 all: update go directive to 1.18
Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

Also update avo to v0.5.0 in the curve25519/internal/field/_asm module.
It's newer and produces no diff in the generated code.

For golang/go#60268.

Change-Id: I9bd771ee8561595d7f68aaca76df6e3e33d35013
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/534141
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-10-11 22:02:22 +00:00
Filippo Valsorda a57398324d all: deprecate broken and legacy packages
Fixes golang/go#30141

Change-Id: I76f8eae31cfd6d106440114685cc0d9abba374f8
Reviewed-on: https://go-review.googlesource.com/c/163537
Reviewed-by: Adam Langley <agl@golang.org>
2019-02-22 23:25:34 +00:00
Michael Cook b8fe1690c6 all: fix ineffectual assignments
audited using ineffassign tool from
github.com/gordonklaus/ineffassign
go generate does not generate any changes

Change-Id: Iabbec9ec1aae39081289d503d79fd7b4caadf17b
GitHub-Last-Rev: acd17cce410e9c68ce3c87b5546261be9153e3ea
GitHub-Pull-Request: golang/crypto#70
Reviewed-on: https://go-review.googlesource.com/c/155942
Reviewed-by: Filippo Valsorda <filippo@golang.org>
2019-01-31 18:25:04 +00:00
Adam Langley b8a2a83acf otr: add missing return on error path
Due to a missing return, corrupt TLV data would cause an infinite loop
that consumes memory, eventually crashing the process.

Thanks to Ivan Markin for pointing this out.

Change-Id: Iaaf7c5f7ce911d3e542b86f6b942b15e2ccbdf3b
Reviewed-on: https://go-review.googlesource.com/35247
Run-TryBot: Adam Langley <agl@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-18 18:54:26 +00:00
Adam Langley 88e46b5e95 otr: reject private keys with parameters <= 0.
This serves as a basic sanity check and also prevents malformed private
keys from setting P=0 and consuming large amounts of CPU and memory in
the Exp call.

Change-Id: Ife22069b989a7347d8deaaf13030df82ee59e87b
Reviewed-on: https://go-review.googlesource.com/35246
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-01-18 18:34:45 +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
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
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
David Symonds 1fbbd62cfe crypto: add import comments.
Change-Id: I33240faf1b8620d0cd600de661928d8e422ebdbc
Reviewed-on: https://go-review.googlesource.com/1235
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 23:26:36 +00:00
Frithjof Schulze a3c6050446 go.crypto/otr: Reset Conversation.myKeyId for each AKE.
This shouldn't be necessary according to the OTRv2 spec,
but is expected by at least one other client.

CC=golang-dev
https://golang.org/cl/13823043
2013-09-22 15:38:36 -04:00
Adam Langley c9c0e06eed go.crypto/otr: expose IsEncrypted.
It's useful to expose this bit of state because, although callers can
keep track of it themselves, it's already in the Conversation so it
seems wasteful to make them do so.

R=golang-dev, ioerror
CC=golang-dev
https://golang.org/cl/6724056
2012-10-17 14:58:16 -04:00
Shenghou Ma 2aed6cb9f1 otr: fix compilation
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6446054
2012-07-26 19:56:54 -04:00
Adam Langley 327f456371 otr: support signaling the end of a conversation.
The explicit OTR termination signal tells the peer that they should
discard their session keys and, more importantly, tells them that
*you* have done so and therefore cannot decrypt future messages.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6430043
2012-07-24 19:21:47 -04:00
Adam Langley 929dedf39d otr: add package
otr implements the Off-the-Record messaging protocol from
http://www.cypherpunks.ca/otr/. It's often used on IRC and Jabber
for private conversations.

R=golang-dev, rsc, dchest
CC=golang-dev
https://golang.org/cl/6300064
2012-06-14 13:36:13 -04:00