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

NLA-redirection fix for #342: rely on host and port #343

Merged
merged 3 commits into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ For a detailed view of what has changed, refer to the {uri-repo}/commits/master[
=== Enhancements

* Minor CLI improvements
* Improved type hints

=== Bug fixes

* Fixed NLA redirection problems if original target and NLA redirection target are the same ({uri-issue}342[#342], {uri-issue}343[#343])

=== Infrastructure

Expand Down
6 changes: 3 additions & 3 deletions pyrdp/mitm/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the GPLv3 or later.
#

from typing import Dict, Optional
from typing import Dict, List, Optional

from Crypto.PublicKey import RSA

Expand Down Expand Up @@ -34,7 +34,7 @@ def __init__(self, config: MITMConfig, sessionID: str):
self.securitySettings = SecuritySettings()
"""The security settings for the connection"""

self.channelDefinitions: [ClientChannelDefinition] = []
self.channelDefinitions: List[ClientChannelDefinition] = []
"""The channel definitions from the client"""

self.channelMap: Dict[int, str] = {}
Expand Down Expand Up @@ -118,7 +118,7 @@ def canRedirect(self) -> bool:
return None not in [self.config.redirectionHost, self.config.redirectionPort] and not self.isRedirected()

def isRedirected(self) -> bool:
return self.effectiveTargetHost == self.config.redirectionHost
return self.effectiveTargetHost == self.config.redirectionHost and self.effectiveTargetPort == self.config.redirectionPort

def useRedirectionHost(self):
self.effectiveTargetHost = self.config.redirectionHost
Expand Down