Skip to content

Commit 280652e

Browse files
grpc: add session crypto information to grpc server
Signed-off-by: John Mulligan <[email protected]>
1 parent e62658a commit 280652e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

sambacc/grpc/server.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ def _get_info(backend: Backend) -> pb.GeneralInfo:
7272
)
7373

7474

75+
def _convert_crypto(
76+
crypto: Optional[rbe.SessionCrypto],
77+
) -> Optional[pb.SessionCrypto]:
78+
if not crypto:
79+
return None
80+
return pb.SessionCrypto(cipher=crypto.cipher, degree=crypto.degree)
81+
82+
7583
def _convert_session(session: rbe.Session) -> pb.SessionInfo:
7684
info = pb.SessionInfo(
7785
session_id=session.session_id,
@@ -80,6 +88,8 @@ def _convert_session(session: rbe.Session) -> pb.SessionInfo:
8088
remote_machine=session.remote_machine,
8189
hostname=session.hostname,
8290
session_dialect=session.session_dialect,
91+
encryption=_convert_crypto(session.encryption),
92+
signing=_convert_crypto(session.signing),
8393
)
8494
# python side takes -1 to mean not found uid/gid. in protobufs
8595
# that would mean the fields are unset

0 commit comments

Comments
 (0)