Skip to content

Conversation

@jozkee
Copy link
Member

@jozkee jozkee commented Jul 24, 2019

This completes System.Net.Security namespace by documenting the following:

  • CipherSuitesPolicy
    • .ctor
    • AllowedCipherSuites
  • SslStream
    • NegotiatedCipherSuite
  • TlsCipherSuites
    • ~340 enums representing cipher suites

@jozkee jozkee requested a review from karelz as a code owner July 24, 2019 21:18
@jozkee
Copy link
Member Author

jozkee commented Jul 24, 2019

@dotnet/ncl @krwq @bartonjs
@mairaw @rpetrusha @carlossanlop

<remarks>
<format type="text/markdown"><![CDATA[
> [!NOTE]
> Defining a chipher suite policy on <xref:System.Net.Security.SslStream> authentication will prevent the OS of the ability to decide which are the best cipher suites to negotiate with and will need of your attention to manually check and update this code. It is strongly recommended to hold off the use of this property and rely on your constantly updated OS policy.
Copy link
Member

@krwq krwq Jul 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: chipher -> cipher

<remarks>
<format type="text/markdown"><![CDATA[
> [!NOTE]
> Defining a chipher suite policy on <xref:System.Net.Security.SslStream> authentication will prevent the OS of the ability to decide which are the best cipher suites to negotiate with and will need of your attention to manually check and update this code. It is strongly recommended to hold off the use of this property and rely on your constantly updated OS policy.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OS is allowed to further restrict the list so it doesn't strictly speaking prevent OS from deciding (implementation will make the last call) but if new cipher suite shows up in the updated version of the underlying implementation a user won't get it by default (which in some cases might or might not be expected).

Also OS should be replaced with underlying implementation

> Defining a chipher suite policy on <xref:System.Net.Security.SslStream> authentication will prevent the OS of the ability to decide which are the best cipher suites to negotiate with and will need of your attention to manually check and update this code. It is strongly recommended to hold off the use of this property and rely on your constantly updated OS policy.
## Remarks
Unlike the OS underlying SSL/TLS implementation, the order of the <xref:System.Net.Security.TlsCipherSuite> elements in `allowedCipherSuites` does not determine their priority in the client-server negotiation. It is required to use OSX or Unix-based systems with OpenSSL 1.1.1 in order to initialize an instance of this class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd drop Unlike the OS underlying SSL/TLS implementation - not sure what that part means

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not determine their priority => does not guarantee their priority

@carlossanlop carlossanlop added 🏁 Release: .NET Core 3.0 :checkered_flag: Release: .NET Core 3.0 new-content Indicates PRs that contain new articles labels Jul 24, 2019
> Defining a chipher suite policy on <xref:System.Net.Security.SslStream> authentication will prevent the OS of the ability to decide which are the best cipher suites to negotiate with and will need of your attention to manually check and update this code. It is strongly recommended to hold off the use of this property and rely on your constantly updated OS policy.
## Remarks
Unlike the OS underlying SSL/TLS implementation, the order of the <xref:System.Net.Security.TlsCipherSuite> elements in `allowedCipherSuites` does not determine their priority in the client-server negotiation. It is required to use OSX or Unix-based systems with OpenSSL 1.1.1 in order to initialize an instance of this class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the "or" here is lexically ambiguous. IIRC it requires ((macOS) or (Linux with OpenSSL 1.1.1)), but it's possible to parse as ((macOS or Linux) with OpenSSL 1.1.1).

It probably needs some sort of style bubble for OS-specific requirements. Something like

[!IMPORTANT]
This feature is dependent on platform support.
* Microsoft Windows: This feature is not available.
* macOS: This feature is available.
* Linux: This feature is available on systems with OpenSSL 1.1.1 or higher.

But I'd wait for a writer before changing the format.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a suggestion above. See what you think. I've changed from Unix-based to Linux since macOS it's also Unix-based.

> Defining a chipher suite policy on <xref:System.Net.Security.SslStream> authentication will prevent the OS of the ability to decide which are the best cipher suites to negotiate with and will need of your attention to manually check and update this code. It is strongly recommended to hold off the use of this property and rely on your constantly updated OS policy.
## Remarks
Unlike the OS underlying SSL/TLS implementation, the order of the <xref:System.Net.Security.TlsCipherSuite> elements in `allowedCipherSuites` does not determine their priority in the client-server negotiation. It is required to use OSX or Unix-based systems with OpenSSL 1.1.1 in order to initialize an instance of this class.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it actually not determine the order? I thought it did on macOS and Linux (but on Windows it won't).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on OSX I think it does, on Linux it will do some re-ordering (TLS1.3 cipher suites will go first, possibly some null ciphers will go to the back - can't remember the details) but mostly preserves the order. I'd just keep the sentence to order is not guaranteed (or we will do best effort or something along these lines)

<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
<summary>Gets the cipher suite resolved to use by this <see cref="T:System.Net.Security.SslStream"/>.</summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a cipher suite which was already negotiated and is already being used. Comment could be something like:

Cipher suite picked by the server from the client supplied list of allowed cipher suites

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with Gets prefix per @bartonjs comment

<format type="text/markdown"><![CDATA[
## Remarks
This property gets the cipher suite that is going to be used in the communication between a client and server by the underlying SSL/TLS implementation. This property is only available after a successful call to <xref:System.Net.Security.SslStream.AuthenticateAsServer%2A> or <xref:System.Net.Security.SslStream.AuthenticateAsClient%2A>.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the %2A for in the xref?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

URL-encoded star (*), I think is used to refer to the method's name without referring to a specific signature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the %2A for in the xref?

I think is used to refer to the method's name without referring to a specific signature.

Yeah, targets the method group (full overload set) rather than a specific method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's when you want to link to a method in general and not a specific overload. More info at https://github.com/dotnet/docs/blob/master/styleguide/template.md#links-to-apis

@@ -39,7 +46,7 @@
</ReturnValue>
<MemberValue>4869</MemberValue>
<Docs>
<summary>To be added.</summary>
<summary>Represents the TLS_AES_128_CCM_8_SHA256 cipher suite.</summary>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not checking anything after here, let me know if there is something there to check

@mairaw mairaw added this to the July 2019 milestone Jul 24, 2019
@@ -5019,7 +5026,7 @@
</ReturnValue>
<MemberValue>0</MemberValue>
<Docs>
<summary>To be added.</summary>
<summary>Represents the TLS_NULL_WITH_NULL_NULL cipher suite; this is the default value.</summary>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krwq this might worth reviewing. In this field I am stating TLS_NULL_WITH_NULL_NULL is enum's default value; not sure if it should really be included.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is default when you do default(TlsCipherSuite) solely because enums always default to 0 which happens to map to this cipher suite. For the AllowedCipherSuites you will get whatever you pass in and there is only custom or OS default options

Copy link
Contributor

@mairaw mairaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments

> Defining a chipher suite policy on <xref:System.Net.Security.SslStream> authentication will prevent the OS of the ability to decide which are the best cipher suites to negotiate with and will need of your attention to manually check and update this code. It is strongly recommended to hold off the use of this property and rely on your constantly updated OS policy.
## Remarks
Unlike the OS underlying SSL/TLS implementation, the order of the <xref:System.Net.Security.TlsCipherSuite> elements in `allowedCipherSuites` does not determine their priority in the client-server negotiation. It is required to use OSX or Unix-based systems with OpenSSL 1.1.1 in order to initialize an instance of this class.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a suggestion above. See what you think. I've changed from Unix-based to Linux since macOS it's also Unix-based.

<format type="text/markdown"><![CDATA[
## Remarks
This property gets the cipher suite that is going to be used in the communication between a client and server by the underlying SSL/TLS implementation. This property is only available after a successful call to <xref:System.Net.Security.SslStream.AuthenticateAsServer%2A> or <xref:System.Net.Security.SslStream.AuthenticateAsClient%2A>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's when you want to link to a method in general and not a specific overload. More info at https://github.com/dotnet/docs/blob/master/styleguide/template.md#links-to-apis

@mairaw mairaw removed the request for review from rpetrusha July 24, 2019 22:28
* Adding some changes of my own as well.

Co-Authored-By: Maira Wenzel <[email protected]>
Co-Authored-By: Jeremy Barton <[email protected]>
@carlossanlop carlossanlop requested review from davidsh and wfurt July 29, 2019 16:58
@jozkee
Copy link
Member Author

jozkee commented Jul 30, 2019

@mairaw @rpetrusha @bartonjs @krwq @carlossanlop
I committed the suggestions a few days ago, this should be ready for re-review or probably merge.

@krwq
Copy link
Member

krwq commented Jul 30, 2019

@jozkee I haven't seen corefx PR updating xml doc comments

@jozkee
Copy link
Member Author

jozkee commented Jul 31, 2019

@krwq I will do it soon, but that shouldn't stop this PR from merging.
@mairaw @rpetrusha can we merge this?

Copy link
Member

@krwq krwq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM content wise (please get additional sign-off for grammar from some native speaker)

@mairaw mairaw added the changes-addressed Indicates PRs that had all comments addressed and are awaiting for new review label Aug 6, 2019
@carlossanlop
Copy link
Contributor

@mairaw @rpetrusha can we get this PR merged?

@rpetrusha
Copy link

I'll review it quickly now.

Copy link

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left some comments, suggestions, and a question for you to consider, @jozkee.

@mairaw mairaw removed changes-addressed Indicates PRs that had all comments addressed and are awaiting for new review verify-build-before-merge labels Aug 6, 2019
Copy link
Member Author

@jozkee jozkee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressing suggestions for AllowedCipherSuites remarks.

@jozkee
Copy link
Member Author

jozkee commented Aug 6, 2019

@rpetrusha I just addressed your latest suggestions. I think this should be ready to merge once the build passes.

@mairaw mairaw added the changes-addressed Indicates PRs that had all comments addressed and are awaiting for new review label Aug 6, 2019
@carlossanlop
Copy link
Contributor

@rpetrusha the build passed. Is this good to merge?

@carlossanlop carlossanlop added verify-build-before-merge and removed changes-addressed Indicates PRs that had all comments addressed and are awaiting for new review labels Aug 7, 2019
@rpetrusha
Copy link

Yes, this is ready to merge, @jozkee and @carlossanlop. I'll do it now.

@rpetrusha rpetrusha merged commit dc0d883 into dotnet:master Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🏁 Release: .NET Core 3.0 :checkered_flag: Release: .NET Core 3.0 new-content Indicates PRs that contain new articles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants