Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup to prep for crypto #160

Closed
wants to merge 3 commits into from

Conversation

dwhutchison
Copy link
Collaborator

A few small updates I wanted incorporated as I work on the server side of the crypto code. Currently restructuring a lot of secure channel logic to allow for incoming server connections as well as outgoing client connections. These are some of the simpler changes from #156 that won't be affected by future secure channel changes.

dwhutchison and others added 3 commits April 3, 2019 20:31
…ockSize()

NonceLength is enforced by some servers and needs to be a specific lenght
for various security policies.
MinPadding was used only in calculating the plain text block size so
it was replaced with the more appropriate PlaintextBlockSize() method
Security header length is required for determining the portion of
the data packet to encrypt and decrypt when utilizng security policies
The GetEndpoints service does not require a session.  Some servers
will reject the ActivateSessionRequest without a specific PolicyID,
which is received from the GetEndpointsRequest.
)
}

// Len returns the Header Length in bytes.
func (h *SymmetricSecurityHeader) Len() int {
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need the Len() methods? I've removed them from all other structs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes; I’ll need these two for the crypto to figure out which bytes to encrypt and which to leave plaintext.
The message header and the (A)symmetricSecurityHeaders stay plaintext and the rest is encrypted so I need a way to find that barrier in the encoded byte stream.
Obviously the Asymmertic one is more important as it’s variable length but having both makes the code easier to understand.

@@ -51,3 +51,14 @@ func (a *AsymmetricSecurityHeader) String() string {
a.ReceiverCertificateThumbprint,
)
}

// Len returns the Header Length in bytes.
func (h *AsymmetricSecurityHeader) Len() int {
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need the Len() methods? I've removed them from all other structs.

@magiconair
Copy link
Member

@dwhutchison I've invited you to the org so that we can work on a branch.

@magiconair
Copy link
Member

Also, let me know if you need help on the secure channel logic for the server. Curious what kind of changes are required.

@dwhutchison
Copy link
Collaborator Author

Awesome, thanks.
I’ll put an issue together with some of the things I noticed and an outline of what I’m thinking then push a WIP branch

@dwhutchison
Copy link
Collaborator Author

Closing; superseded by #166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants