@@ -440,66 +440,60 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
440
440
< dl id ="crypto/hmac "> < dt > < a href ="/pkg/crypto/hmac/ "> crypto/hmac</ a > </ dt >
441
441
< dd >
442
442
< p > <!-- CL 261960 -->
443
- < a href ="/pkg/crypto/hmac/#New "> New</ a > will now panic if separate calls to
444
- the hash generation function fail to return new values. Previously, the
445
- behavior was undefined and invalid outputs were sometimes generated.
443
+ < a href ="/pkg/crypto/hmac/#New "> < code > New</ code > </ a > will now panic if
444
+ separate calls to the hash generation function fail to return new values.
445
+ Previously, the behavior was undefined and invalid outputs were sometimes
446
+ generated.
446
447
</ p >
447
448
</ dd >
448
449
</ dl > <!-- crypto/hmac -->
449
450
450
451
< dl id ="crypto/tls "> < dt > < a href ="/pkg/crypto/tls/ "> crypto/tls</ a > </ dt >
451
452
< dd >
452
453
< p > <!-- CL 256897 -->
453
- I/O operations on closing or closed TLS connections can now be detected using
454
- the new < a href ="/pkg/net/#ErrClosed "> ErrClosed</ a > error. A typical use
455
- would be < code > errors.Is(err, net.ErrClosed)</ code > . In earlier releases
456
- the only way to reliably detect this case was to match the string returned
457
- by the < code > Error</ code > method with < code > "tls: use of closed connection"</ code > .
454
+ I/O operations on closing or closed TLS connections can now be detected
455
+ using the new < a href ="/pkg/net/#ErrClosed "> < code > net.ErrClosed</ code > </ a >
456
+ error. A typical use would be < code > errors.Is(err, net.ErrClosed)</ code > .
458
457
</ p >
459
458
460
459
< p > <!-- CL 266037 -->
461
- A default deadline is set in < a href ="/pkg/crypto/tls/#Conn.Close "> Close</ a >
462
- before sending the close notify alert, in order to prevent blocking
460
+ A default write deadline is now set in
461
+ < a href ="/pkg/crypto/tls/#Conn.Close "> < code > Conn.Close</ code > </ a >
462
+ before sending the "close notify" alert, in order to prevent blocking
463
463
indefinitely.
464
464
</ p >
465
465
466
466
< p > <!-- CL 246338 -->
467
- < a href ="/pkg/crypto/tls#Conn.HandshakeContext "> (*Conn).HandshakeContext</ a > was added to
468
- allow the user to control cancellation of an in-progress TLS Handshake.
469
- The context provided is propagated into the
470
- < a href ="/pkg/crypto/tls#ClientHelloInfo "> ClientHelloInfo</ a >
471
- and < a href ="/pkg/crypto/tls#CertificateRequestInfo "> CertificateRequestInfo</ a >
472
- structs and accessible through the new
473
- < a href ="/pkg/crypto/tls#ClientHelloInfo.Context "> (*ClientHelloInfo).Context</ a >
474
- and
475
- < a href ="/pkg/crypto/tls#CertificateRequestInfo.Context ">
476
- (*CertificateRequestInfo).Context
477
- </ a > methods respectively. Canceling the context after the handshake has finished
478
- has no effect.
467
+ The new < a href ="/pkg/crypto/tls#Conn.HandshakeContext "> < code > Conn.HandshakeContext</ code > </ a >
468
+ method allows cancellation of an in-progress handshake. The provided
469
+ context is accessible through the new
470
+ < a href ="/pkg/crypto/tls#ClientHelloInfo.Context "> < code > ClientHelloInfo.Context</ code > </ a >
471
+ and < a href ="/pkg/crypto/tls#CertificateRequestInfo.Context ">
472
+ < code > CertificateRequestInfo.Context</ code > </ a > methods. Canceling the
473
+ context after the handshake has finished has no effect.
479
474
</ p >
480
475
481
476
< p > <!-- CL 239748 -->
482
- Clients now ensure that the server selects
477
+ Clients now return a handshake error if the server selects
483
478
< a href ="/pkg/crypto/tls/#ConnectionState.NegotiatedProtocol ">
484
- an ALPN protocol</ a > from
479
+ an ALPN protocol</ a > that was not in
485
480
< a href ="/pkg/crypto/tls/#Config.NextProtos ">
486
481
the list advertised by the client</ a > .
487
482
</ p >
488
483
489
484
< p > <!-- CL 262857 -->
490
- TLS servers will now prefer other AEAD cipher suites (such as ChaCha20Poly1305)
485
+ Servers will now prefer other available AEAD cipher suites (such as ChaCha20Poly1305)
491
486
over AES-GCM cipher suites if either the client or server doesn't have AES hardware
492
- support, unless the application set both
493
- < a href =" /pkg/crypto/tls/#Config.PreferServerCipherSuites " > < code > Config.PreferServerCipherSuites</ code > </ a >
487
+ support, unless both < a href =" /pkg/crypto/tls/#Config.PreferServerCipherSuites " >
488
+ < code > Config.PreferServerCipherSuites</ code > </ a >
494
489
and < a href ="/pkg/crypto/tls/#Config.CipherSuites "> < code > Config.CipherSuites</ code > </ a >
495
- or there are no other AEAD cipher suites supported.
496
- The client is assumed not to have AES hardware support if it does not signal a
497
- preference for AES-GCM cipher suites.
490
+ are set. The client is assumed not to have AES hardware support if it does
491
+ not signal a preference for AES-GCM cipher suites.
498
492
</ p >
499
493
500
494
< p > <!-- CL 246637 -->
501
- < a href ="/pkg/crypto/tls/#Config.Clone "> < code > Config.Clone</ code > </ a > now returns
502
- a nil < code > *Config </ code > if the source is nil, rather than panicking.
495
+ < a href ="/pkg/crypto/tls/#Config.Clone "> < code > Config.Clone</ code > </ a > now
496
+ returns nil if the receiver is nil, rather than panicking.
503
497
</ p >
504
498
</ dd >
505
499
</ dl > <!-- crypto/tls -->
@@ -514,25 +508,26 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
514
508
</ p >
515
509
516
510
< p > <!-- CL 235078 -->
517
- < a href ="/pkg/crypto/x509/#ParseCertificate "> ParseCertificate</ a > and
518
- < a href ="/pkg/crypto/x509/#CreateCertificate "> CreateCertificate</ a > both
519
- now enforce string encoding restrictions for the fields < code > DNSNames</ code > ,
520
- < code > EmailAddresses</ code > , and < code > URIs</ code > . These fields can only
521
- contain strings with characters within the ASCII range.
511
+ < a href ="/pkg/crypto/x509/#ParseCertificate "> < code > ParseCertificate</ code > </ a > and
512
+ < a href ="/pkg/crypto/x509/#CreateCertificate "> < code > CreateCertificate</ code > </ a >
513
+ now enforce string encoding restrictions for the < code > DNSNames</ code > ,
514
+ < code > EmailAddresses</ code > , and < code > URIs</ code > fields . These fields
515
+ can only contain strings with characters within the ASCII range.
522
516
</ p >
523
517
524
518
< p > <!-- CL 259697 -->
525
- < a href ="/pkg/crypto/x509/#CreateCertificate "> CreateCertificate</ a > now
526
- verifies the generated certificate's signature using the signer's
527
- public key. If the signature is invalid, an error is returned, instead
528
- of a malformed certificate.
519
+ < a href ="/pkg/crypto/x509/#CreateCertificate "> < code > CreateCertificate</ code > </ a >
520
+ now verifies the generated certificate's signature using the signer's
521
+ public key. If the signature is invalid, an error is returned, instead of
522
+ a malformed certificate.
529
523
</ p >
530
524
531
525
< p > <!-- CL 233163 -->
532
526
A number of additional fields have been added to the
533
- < a href ="/pkg/crypto/x509/#CertificateRequest "> CertificateRequest</ a > type.
534
- These fields are now parsed in < a href ="/pkg/crypto/x509/#ParseCertificateRequest "> ParseCertificateRequest</ a >
535
- and marshalled in < a href ="/pkg/crypto/x509/#CreateCertificateRequest "> CreateCertificateRequest</ a > .
527
+ < a href ="/pkg/crypto/x509/#CertificateRequest "> < code > CertificateRequest</ code > </ a > type.
528
+ These fields are now parsed in < a href ="/pkg/crypto/x509/#ParseCertificateRequest ">
529
+ < code > ParseCertificateRequest</ code > </ a > and marshalled in
530
+ < a href ="/pkg/crypto/x509/#CreateCertificateRequest "> < code > CreateCertificateRequest</ code > </ a > .
536
531
</ p >
537
532
538
533
< p > <!-- CL 257939 -->
@@ -548,19 +543,21 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
548
543
</ p >
549
544
550
545
< p > <!-- CL 262343 -->
551
- TODO: < a href ="https://golang.org/cl/262343 "> https://golang.org/cl/262343</ a > : add Unwrap to SystemRootsError
546
+ The new < a href ="/pkg/crypto/x509/#SystemRootsError.Unwrap "> < code > SystemRootsError.Unwrap</ code > </ a >
547
+ method allows accessing the < a href ="/pkg/crypto/x509/#SystemRootsError.Err "> < code > Err</ code > </ a >
548
+ field through the < a href ="/pkg/errors "> < code > errors</ code > </ a > package functions.
552
549
</ p >
553
550
</ dd >
554
551
</ dl > <!-- crypto/x509 -->
555
552
556
553
< dl id ="encoding/asn1 "> < dt > < a href ="/pkg/encoding/asn1 "> encoding/asn1</ a > </ dt >
557
554
< dd >
558
555
< p > <!-- CL 255881 -->
559
- < a href ="/pkg/encoding/asn1/#Unmarshal "> Unmarshal</ a > and
560
- < a href ="/pkg/encoding/asn1/#UnmarshalWithParams "> UnmarshalWithParams</ a >
561
- now return an error instead of panic when the argument is not
556
+ < a href ="/pkg/encoding/asn1/#Unmarshal "> < code > Unmarshal</ code > </ a > and
557
+ < a href ="/pkg/encoding/asn1/#UnmarshalWithParams "> < code > UnmarshalWithParams</ code > </ a >
558
+ now return an error instead of panicking when the argument is not
562
559
a pointer or is nil. This change matches the behavior of other
563
- encoding packages such as < a href ="/pkg/encoding/json "> encoding/json</ a > .
560
+ encoding packages such as < a href ="/pkg/encoding/json "> < code > encoding/json</ code > </ a > .
564
561
</ p >
565
562
</ dd >
566
563
</ dl >
@@ -693,15 +690,16 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
693
690
</ p >
694
691
695
692
< p > <!-- CL 256498, golang.org/issue/36990 -->
696
- Cookies set with < code > SameSiteDefaultMode</ code > now behave according to the current
697
- spec (no attribute is set) instead of generating a SameSite key without a value.
693
+ Cookies set with < a href ="/pkg/net/http/#SameSiteDefaultMode "> < code > SameSiteDefaultMode</ code > </ a >
694
+ now behave according to the current spec (no attribute is set) instead of
695
+ generating a SameSite key without a value.
698
696
</ p >
699
697
700
698
< p > <!-- CL 246338 -->
701
- The < a href ="/pkg/net/http/ "> < code > net/http</ code > </ a > package now uses the new
702
- < a href ="/pkg/crypto/tls#Conn.HandshakeContext "> < code > (*tls.Conn).HandshakeContext </ code > </ a >
703
- with the < a href ="/pkg/net/http/#Request "> < code > Request </ code > </ a > context
704
- when performing TLS handshakes in the client or server .
699
+ The < a href ="/pkg/net/http/ "> < code > net/http</ code > </ a > package now passes the
700
+ < a href ="/pkg/net/http/#Request.Context "> < code > Request </ code > context </ a > to
701
+ < a href ="/pkg/crypto/tls#Conn.HandshakeContext "> < code > tls.Conn.HandshakeContext </ code > </ a >
702
+ when performing TLS handshakes.
705
703
</ p >
706
704
707
705
< p > <!-- CL 250039 -->
0 commit comments