summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2020-01-18 17:46:14 -0700
committerEduardo Chappa <chappa@washington.edu>2020-01-18 17:46:14 -0700
commit16b49fa63ad28aab44cde5096a706e6cc7520b1f (patch)
tree7ba6d75f6d8d2a3d52252d1732f52a39b670db92
parente328ab4a9dd90b53a4ae71cd97b699b1dd13e9a2 (diff)
downloadalpine-16b49fa63ad28aab44cde5096a706e6cc7520b1f.tar.xz
* Adding pith_ssl_encryption function to linkage.h.
-rw-r--r--imap/src/osdep/nt/proc.c2
-rw-r--r--imap/src/osdep/nt/ssl_libressl.c10
-rw-r--r--imap/src/osdep/nt/ssl_win.c7
-rw-r--r--imap/src/osdep/unix/Makefile1
-rw-r--r--imap/src/osdep/unix/ssl_unix.c8
-rw-r--r--pith/pine.hlp2
6 files changed, 18 insertions, 12 deletions
diff --git a/imap/src/osdep/nt/proc.c b/imap/src/osdep/nt/proc.c
index 8fc3c4e..0c13712 100644
--- a/imap/src/osdep/nt/proc.c
+++ b/imap/src/osdep/nt/proc.c
@@ -64,6 +64,8 @@ main(int argc, char *argv[])
else if(!strcmp(opt, "sslinit")){
fpc = fopen("linkage.c", "a");
fprintf(fpc, "%s\n", "ssl_onceonlyinit();");
+ fph = fopen("linkage.h", "a");
+ fprintf(fph, "%s\n", "int pith_ssl_encryption_version(char *);");
}
else if(!strcmp(opt, "version")){
fpc = fopen("linkage.c", "a");
diff --git a/imap/src/osdep/nt/ssl_libressl.c b/imap/src/osdep/nt/ssl_libressl.c
index a70a4ab..81f3f0d 100644
--- a/imap/src/osdep/nt/ssl_libressl.c
+++ b/imap/src/osdep/nt/ssl_libressl.c
@@ -100,7 +100,7 @@ int
pith_ssl_encryption_version(char *s)
{
SSL_VERSIONS_S ssl_versions[] = {
- { "no_min", 0 },
+ { "no_min", 0 },
{ "ssl3", SSL3_VERSION },
{ "tls1", TLS1_VERSION },
{ "tls1_1", TLS1_1_VERSION },
@@ -890,20 +890,18 @@ char *ssl_getsize (SSLSTREAM *stream, unsigned long size)
{
char *ret = NIL;
unsigned long got = 0L, need = size, n;
- int done = 0;
- while(!done){
+ do {
if(!ssl_getdata (stream)) return ret; /* return what we have */
n = stream->ictr < need ? stream->ictr : need;
- fs_resize((void **) &ret, got + n + 1);
+ fs_resize((void **) &ret, (got + n + 1)*sizeof(char));
memcpy(ret + got, stream->iptr, n);
ret[got+n] = '\0';
got += n;
need -= n;
stream->iptr += n;
stream->ictr -= n;
- if(need == 0L) done++;
- }
+ } while (need > 0);
return ret;
}
diff --git a/imap/src/osdep/nt/ssl_win.c b/imap/src/osdep/nt/ssl_win.c
index 0e77ee3..5b8606a 100644
--- a/imap/src/osdep/nt/ssl_win.c
+++ b/imap/src/osdep/nt/ssl_win.c
@@ -497,6 +497,13 @@ static char *ssl_getline_work (SSLSTREAM *stream,unsigned long *size,
return ret;
}
+/* not implemented yet */
+int pith_ssl_encryption_version(char *s)
+{
+return 0;
+}
+
+
char *ssl_getsize(SSLSTREAM* stream, unsigned long size)
{
char *ret = NIL;
diff --git a/imap/src/osdep/unix/Makefile b/imap/src/osdep/unix/Makefile
index 7b1bff3..a30e8d5 100644
--- a/imap/src/osdep/unix/Makefile
+++ b/imap/src/osdep/unix/Makefile
@@ -1003,6 +1003,7 @@ onceenv:
./drivers $(EXTRADRIVERS) $(DEFAULTDRIVERS) dummy
./mkauths $(EXTRAAUTHENTICATORS) $(DEFAULTAUTHENTICATORS)
echo " mail_versioncheck (CCLIENTVERSION);" >> linkage.c
+ sh -c '(test $(SSLTYPE) != none) && echo "int pith_ssl_encryption_version(char *);" >> linkage.h || true'
$(LN) os_$(OS).h osdep.h
$(LN) os_$(OS).c osdepbas.c
$(LN) log_$(LOGINPW).c osdeplog.c
diff --git a/imap/src/osdep/unix/ssl_unix.c b/imap/src/osdep/unix/ssl_unix.c
index 020cfd7..93fb1a9 100644
--- a/imap/src/osdep/unix/ssl_unix.c
+++ b/imap/src/osdep/unix/ssl_unix.c
@@ -636,20 +636,18 @@ char *ssl_getsize (SSLSTREAM *stream, unsigned long size)
{
char *ret = NIL;
unsigned long got = 0L, need = size, n;
- int done = 0;
- while(!done){
+ do {
if(!ssl_getdata (stream)) return ret; /* return what we have */
n = stream->ictr < need ? stream->ictr : need;
- fs_resize((void **) &ret, got + n + 1);
+ fs_resize((void **) &ret, (got + n + 1)*sizeof(char));
memcpy(ret + got, stream->iptr, n);
ret[got+n] = '\0';
got += n;
need -= n;
stream->iptr += n;
stream->ictr -= n;
- if(need == 0L) done++;
- }
+ } while (need > 0);
return ret;
}
diff --git a/pith/pine.hlp b/pith/pine.hlp
index 8618aea..1256704 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 392 2020-01-18 13:08:29
+Alpine Commit 393 2020-01-18 17:46:09
============= h_news =================
<HTML>
<HEAD>