You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_content/doc/go1.24: extend, fix, and cleanup crypto release notes
FIPS 140 commented out for now, will add a section in a follow-up CL.
It's ok for those to come after rc1, also because it's a bit unclear yet
what we can assert about the FIPS 140-3 status of the release. Note that
none of the changes affect existing programs that don't opt in with the
new switches.
For golang/go#68545
Change-Id: I9779a0976127e5fdc65b4b8ae3c6c2de4739390b
Reviewed-on: https://go-review.googlesource.com/c/website/+/635595
Auto-Submit: Filippo Valsorda <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Roland Shoemaker <[email protected]>
Reviewed-by: Daniel McCarney <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
The new [`crypto/sha3`](/pkg/crypto/sha3/) package implements the SHA-3 hash function, and SHAKE and
246
-
cSHAKE extendable-output functions. It is based on the pre-existing
247
-
`golang.org/x/crypto/sha3` package.
248
+
All three packages are based on pre-existing `golang.org/x/crypto/...` packages.
248
249
249
250
### New weak package {#weak}
250
251
@@ -300,116 +301,205 @@ The [`bytes`](/pkg/bytes) package adds several functions that work with iterator
300
301
-[`FieldsFuncSeq`](/pkg/bytes#FieldsFuncSeq) returns an iterator
301
302
over substrings of s split around runs of Unicode code points satisfying f(c).
302
303
304
+
#### [`crypto/aes`](/pkg/crypto/aes/)
305
+
306
+
The value returned by [`NewCipher`](/pkg/crypto/aes#NewCipher) no longer
307
+
implements the `NewCTR`, `NewGCM`, `NewCBCEncrypter`, and `NewCBCDecrypter`
308
+
methods. These methods were undocumented and not available on all architectures.
309
+
Instead, the [`Block`](/pkg/crypto/cipher#Block) value should be passed
310
+
directly to the relevant [`crypto/cipher`](/pkg/crypto/cipher/) functions.
311
+
For now, `crypto/cipher` still checks for those methods on `Block` values,
312
+
even if they are not used by the standard library anymore.
313
+
303
314
#### [`crypto/cipher`](/pkg/crypto/cipher/)
304
315
305
-
[`NewOFB`](/pkg/crypto/cipher#NewOFB), [`NewCFBEncrypter`](/pkg/crypto/cipher#NewCFBEncrypter), and [`NewCFBDecrypter`](/pkg/crypto/cipher#NewCFBDecrypter) are now deprecated. OFB and
306
-
CFB mode are not authenticated, which generally enables active attacks to
316
+
The new [`NewGCMWithRandomNonce`](/pkg/crypto/cipher#NewGCMWithRandomNonce)
317
+
function returns an [`AEAD`](/pkg/crypto/cipher#AEAD) that implements AES-GCM by
318
+
generating a random nonce during Seal and prepending it to the ciphertext.
319
+
320
+
The [`Stream`](/pkg/crypto/cipher#Stream) implementation returned by
321
+
[`NewCTR`](/pkg/crypto/cipher#NewCTR) when used with
322
+
[`crypto/aes`](/pkg/crypto/aes/) is now several times faster on amd64 and arm64.
323
+
324
+
[`NewOFB`](/pkg/crypto/cipher#NewOFB),
325
+
[`NewCFBEncrypter`](/pkg/crypto/cipher#NewCFBEncrypter), and
326
+
[`NewCFBDecrypter`](/pkg/crypto/cipher#NewCFBDecrypter) are now deprecated.
327
+
OFB and CFB mode are not authenticated, which generally enables active attacks to
307
328
manipulate and recover the plaintext. It is recommended that applications use
308
-
[`AEAD`](/pkg/crypto/cipher#AEAD) modes instead. If an unauthenticated [`Stream`](/pkg/crypto/cipher#Stream) mode is required, use
329
+
[`AEAD`](/pkg/crypto/cipher#AEAD) modes instead. If an unauthenticated
330
+
[`Stream`](/pkg/crypto/cipher#Stream) mode is required, use
309
331
[`NewCTR`](/pkg/crypto/cipher#NewCTR) instead.
310
332
311
-
The new [`NewGCMWithRandomNonce`](/pkg/crypto/cipher#NewGCMWithRandomNonce) function returns an [`AEAD`](/pkg/crypto/cipher#AEAD) that implements
312
-
AES-GCM by generating a random nonce during Seal and prepending it to the
313
-
ciphertext.
333
+
#### [`crypto/ecdsa`](/pkg/crypto/ecdsa/)
334
+
335
+
<!-- go.dev/issue/64802 -->
336
+
[`PrivateKey.Sign`](/pkg/crypto/ecdsa#PrivateKey.Sign) now produces a
337
+
deterministic signature according to
338
+
[RFC 6979](https://www.rfc-editor.org/rfc/rfc6979.html) if rand is nil.
314
339
315
-
#### [`crypto/fips140`](/pkg/crypto/fips140/)
340
+
<!--#### [`crypto/fips140`](/pkg/crypto/fips140/)
316
341
317
342
TODO: FIPS 140 will be covered in its own section.
[`GenerateKey`](/pkg/crypto/rsa#GenerateKey) may return new errors for broken
392
+
random sources. See also the changes to [`crypto/x509`](#cryptox509pkgcryptox509) below.
393
+
394
+
<!-- go.dev/issue/43923 -->
395
+
[`SignPKCS1v15`](/pkg/crypto/rsa#SignPKCS1v15) and
396
+
[`VerifyPKCS1v15`](/pkg/crypto/rsa#VerifyPKCS1v15) now support
397
+
SHA-512/224, SHA-512/256, and SHA-3.
398
+
399
+
<!-- CL 626957 -->
400
+
Public and private key operations are now up to two times faster on wasm.
346
401
347
402
#### [`crypto/sha1`](/pkg/crypto/sha1/)
348
403
349
-
The value returned by [`sha1.New`](/pkg/sha1#New) now also implements the [`encoding.BinaryAppender`](/pkg/encoding#BinaryAppender) interface.
404
+
The value returned by [`sha1.New`](/pkg/sha1#New) now also implements
405
+
the [`encoding.BinaryAppender`](/pkg/encoding#BinaryAppender) interface.
350
406
351
407
#### [`crypto/sha256`](/pkg/crypto/sha256/)
352
408
353
-
The values returned by [`sha256.New`](/pkg/sha256#New) and [`sha256.New224`](/pkg/sha256#New224) now also implement the [`encoding.BinaryAppender`](/pkg/encoding#BinaryAppender) interface
409
+
The values returned by [`sha256.New`](/pkg/sha256#New) and
410
+
[`sha256.New224`](/pkg/sha256#New224) now also implement the
The values returned by [`sha512.New`](/pkg/sha512#New), [`sha512.New384`](/pkg/sha512#New384), [`sha512.New512_224`](/pkg/sha512#New512_224) and [`sha512.New512_256`](/pkg/sha512#New512_256) now also implement the [`encoding.BinaryAppender`](/pkg/encoding#BinaryAppender) interface.
415
+
The values returned by [`sha512.New`](/pkg/sha512#New),
416
+
[`sha512.New384`](/pkg/sha512#New384),
417
+
[`sha512.New512_224`](/pkg/sha512#New512_224) and
418
+
[`sha512.New512_256`](/pkg/sha512#New512_256) now also implement the
The [`WithDataIndependentTiming`](/pkg/crypto/subtle#WithDataIndependentTiming) function allows the user to run a function with
362
-
architecture specific features enabled which guarantee specific instructions are
363
-
data value timing invariant. This can be used to make sure that code designed to
364
-
run in constant time is not optimized by CPU-level features such that it
365
-
operates in variable time. Currently, [`WithDataIndependentTiming`](/pkg/crypto/subtle#WithDataIndependentTiming) uses the
366
-
PSTATE.DIT bit on arm64, and is a no-op on all other architectures.
423
+
The new [`WithDataIndependentTiming`](/pkg/crypto/subtle#WithDataIndependentTiming)
424
+
function allows the user to run a function with architecture specific features
425
+
enabled which guarantee specific instructions are data value timing invariant.
426
+
This can be used to make sure that code designed to run in constant time is not
427
+
optimized by CPU-level features such that it operates in variable time.
428
+
Currently, `WithDataIndependentTiming` uses the PSTATE.DIT bit on arm64, and is
429
+
a no-op on all other architectures. [GODEBUG setting](/doc/godebug)
430
+
`dataindependenttiming=1` enables the DIT mode for the entire Go program.
367
431
368
-
#### [`crypto/tls`](/pkg/crypto/tls/)
432
+
<!-- CL 622276 -->
433
+
The [`XORBytes`](/pkg/crypto/subtle#XORBytes) output must overlap exactly or not
434
+
at all with the inputs. Previously, the behavior was otherwise undefined, while
435
+
now `XORBytes` will panic.
369
436
370
-
The[`ClientHelloInfo`](/pkg/crypto/tls#ClientHelloInfo) struct passed to [`Config.GetCertificate`](/pkg/crypto/tls#Config.GetCertificate) now includes an `Extensions` field, which can be useful for fingerprinting TLS clients.<!-- go.dev/issue/32936 -->
437
+
####[`crypto/tls`](/pkg/crypto/tls/)
371
438
372
439
The TLS server now supports Encrypted Client Hello (ECH). This feature can be
373
440
enabled by populating the [`Config.EncryptedClientHelloKeys`](/pkg/crypto/tls#Config.EncryptedClientHelloKeys) field.
374
441
375
-
`crypto/tls` now supports the post-quantum [`X25519MLKEM768`](/pkg/crypto/tls#X25519MLKEM768) key exchange. Support
376
-
for the experimental X25519Kyber768Draft00 key exchange has been removed.
442
+
The new post-quantum [`X25519MLKEM768`](/pkg/crypto/tls#X25519MLKEM768) key
443
+
exchange mechanism is now supported and is enabled by default when
444
+
[`Config.CurvePreferences`](/pkg/crypto/tls#Config.CurvePreferences) is nil.
445
+
[GODEBUG setting](/doc/godebug)`tlsmlkem=0` reverts the default.
446
+
447
+
Support for the experimental `X25519Kyber768Draft00` key exchange has been removed.
377
448
378
449
<!-- go.dev/issue/69393, CL 630775 -->
379
-
Key exchange ordering is now handled entirely by the `crypto/tls` package. The order of [`Config.CurvePreferences`](/pkg/crypto/tls#Config.CurvePreferences) is now ignored, and the contents are only used to determine which key exchanges to enable when the field is populated.
450
+
Key exchange ordering is now handled entirely by the `crypto/tls` package. The
451
+
order of [`Config.CurvePreferences`](/pkg/crypto/tls#Config.CurvePreferences) is
452
+
now ignored, and the contents are only used to determine which key exchanges to
453
+
enable when the field is populated.
454
+
455
+
<!-- go.dev/issue/32936 -->
456
+
The new [`ClientHelloInfo.Extensions`](/pkg/crypto/tls#ClientHelloInfo.Extensions)
457
+
field lists the IDs of the extensions received in the Client Hello message.
458
+
This can be useful for fingerprinting TLS clients.
380
459
381
460
#### [`crypto/x509`](/pkg/crypto/x509/)
382
461
383
-
The `x509sha1` GODEBUG setting has been removed. [`Certificate.Verify`](/pkg/crypto/x509#Certificate.Verify) will no
384
-
longer consider SHA-1 based signatures valid when this GODEBUG setting is set.
462
+
<!-- go.dev/issue/41682 -->
463
+
The `x509sha1`[GODEBUG setting](/doc/godebug) has been removed.
464
+
[`Certificate.Verify`](/pkg/crypto/x509#Certificate.Verify) no longer
465
+
supports SHA-1 based signatures.
385
466
386
-
[`OID`](/pkg/crypto/x509#OID) now implements the [`encoding.BinaryAppender`](/pkg/encoding#BinaryAppender) and [`encoding.TextAppender`](/pkg/encoding#TextAppender)
387
-
interfaces.
467
+
[`OID`](/pkg/crypto/x509#OID) now implements the
468
+
[`encoding.BinaryAppender`](/pkg/encoding#BinaryAppender) and
The default certificate policies field has changed from
390
-
[`Certificate.PolicyIdentifiers`](/pkg/crypto/x509#Certificate.PolicyIdentifiers) to [`Certificate.Policies`](/pkg/crypto/x509#Certificate.Policies). When parsing
[`Certificate.Verify`](/pkg/crypto/x509#Certificate.Verify) now supports policy validation, as defined by RFC 5280 and
401
-
RFC 9618. In order to enable policy validation,
402
-
[`VerifyOptions.CertificatePolicies`](/pkg/crypto/x509#VerifyOptions.CertificatePolicies) must be set to an acceptable set of policy
403
-
[`OIDs`](/pkg/crypto/x509#OIDs). When enabled, only certificate chains with valid policy graphs will be
404
-
returned from [`Certificate.Verify`](/pkg/crypto/x509#Certificate.Verify).
405
-
406
-
[`MarshalPKCS8PrivateKey`](/pkg/crypto/x509#MarshalPKCS8PrivateKey) now returns an error instead of marshaling an invalid
407
-
RSA key. ([`MarshalPKCS1PrivateKey`](/pkg/crypto/x509#MarshalPKCS1PrivateKey) doesn't have an error return, and its behavior
408
-
when provided invalid keys continues to be undefined.)
409
-
410
-
[`ParsePKCS1PrivateKey`](/pkg/crypto/x509#ParsePKCS1PrivateKey) and [`ParsePKCS8PrivateKey`](/pkg/crypto/x509#ParsePKCS8PrivateKey) now use and validate the
411
-
encoded CRT values, so might reject invalid keys that were previously accepted.
412
-
Use `GODEBUG=x509rsacrt=0` to revert to recomputing them.
485
+
[`Certificate.Verify`](/pkg/crypto/x509#Certificate.Verify) now supports policy
486
+
validation, as defined in RFC 5280 and RFC 9618. The new
0 commit comments