From d3dedd76a1487259ec613ee8dbedf84055769af2 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Sat, 21 Jun 2014 03:44:13 +0000 Subject: [PATCH] Use the new cryptlib patch. It is NO LONGER POSSIBLE to use Cryptlib from upstream, you MUST use the included one now, so it really needs to be statically linked. --- src/syncterm/ssh.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/syncterm/ssh.c b/src/syncterm/ssh.c index 4e7e32585f..186523ac44 100644 --- a/src/syncterm/ssh.c +++ b/src/syncterm/ssh.c @@ -12,6 +12,7 @@ #include "bbslist.h" #include "conn.h" #include "uifcinit.h" +#include "ciolib.h" #include "st_crypt.h" @@ -140,6 +141,8 @@ int ssh_connect(struct bbslist *bbs) int status; char password[MAX_PASSWD_LEN+1]; char username[MAX_USER_LEN+1]; + struct winsize ws; + struct text_info ti; init_uifc(TRUE, TRUE); pthread_mutex_init(&ssh_mutex, NULL); @@ -227,6 +230,38 @@ int ssh_connect(struct bbslist *bbs) return(-1); } + uifc.pop(NULL); + uifc.pop("Setting Terminal Type"); + status=cl.SetAttributeString(ssh_session, CRYPT_SESSINFO_SSH_TERMINAL, "syncterm", 8); + + /* Horrible way to determine the screen size */ + textmode(screen_to_ciolib(bbs->screen_mode)); + + gettextinfo(&ti); + if(ti.screenwidth < 80) + ws.ws_col=40; + else { + if(ti.screenwidth < 132) + ws.ws_col=80; + else + ws.ws_col=132; + } + ws.ws_row=ti.screenheight; + if(!bbs->nostatus) + ws.ws_row--; + if(ws.ws_row<24) + ws.ws_row=24; + + uifc.pop(NULL); + uifc.pop("Setting Terminal Width"); + /* Pass socket to cryptlib */ + status=cl.SetAttribute(ssh_session, CRYPT_SESSINFO_SSH_WIDTH, ws.ws_col); + + uifc.pop(NULL); + uifc.pop("Setting Terminal Height"); + /* Pass socket to cryptlib */ + status=cl.SetAttribute(ssh_session, CRYPT_SESSINFO_SSH_HEIGHT, ws.ws_row); + /* Activate the session */ uifc.pop(NULL); uifc.pop("Activating Session"); -- GitLab