[Pkg-wmaker-commits] [wmbiff] 05/09: Removed unneeded Apop support code, now integrated in Neil and Jay's patch.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Thu Aug 20 02:59:58 UTC 2015
- Previous message: [Pkg-wmaker-commits] [wmbiff] 04/09: Added my other SF account, which I intend to use now.
- Next message: [Pkg-wmaker-commits] [wmbiff] 06/09: * Big patch from Neil Spring which adds lots of crypto support to WMBiff. * WMBiff can now speak IMAP over TLS and CRAM-MD5, and APOP using libgcrypt. * Known problems: - gnutls is being developed still, so it may have security related bugs. - A bug in gnutls (a too-small buffer) may cause problems in the parsing of openssl certificates. This should be fixed by gnutls soon, hopefully. Added error messages if this bug is tickled. If you've got problems with IMAP SSL, please try upgrading gnutls. If the problem persists, let us know. - IMAP has totally been rewritten, so bugs may crop up. - Pop3 hasn't been rewritten to use the TLS primitives, though it probably could be if someone wanted to. * There's a new interface for reading and writing to the socket in tlsComm.[ch]. This makes the IMAP code somewhat independent of whether ssl is used, and provides nicer primitives to help skip 'informational' messages. * WITH_TLS and WITH_GCRYPT are on-by-default in the Makefile. TLS applies to encryption, GCRYPT to cram-md5 and apop authentication. Since gnutls depends on libgcrypt anyway, these probably don't need to be independent. Some compile warnings may be generated when these are disabled. * Added code to optionally include dmalloc.h and link -ldmalloc. This doesn't do anything at the moment, but shouldn't hurt. It's off-by-default. * IMAP connections are now persistent. persistent. This is to cut down on the need to re-negotiate an SSL connection every time you want to check mail. It tries to use just one connection per (server/username/password/port number), which means multiple mailboxes need only one connection. * There are a handful of lclint (http://lclint.cs.virginia.edu) annotations in tlsComm.[ch]. These should also not hurt anyone, and are meant to keep the signal to noise ratio of lclint high. * The rewritten IMAP code uses the GNU regex library to handle the configuration line. I think its clearer than the cascading strtok() solution, but the regex might not be perfect. * Removed an unnecessary "inline" keyword from charutil.h. * Added a TODO document with the bits that are missing from the picture. * Please bow in awe at NAKAYAMA Takao, Jay T. Francis and specially Neil Spring for all of this.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to tag wmbiff_0_3_2
in repository wmbiff.
commit 83e6359355c3817b584e3819ccb1bd1b482a4894
Author: jordi <jordi>
Date: Thu Oct 4 09:21:39 2001 +0000
Removed unneeded Apop support code, now integrated in Neil and Jay's patch.
---
wmbiff/ApopClient.c | 255 ----------------------------------------------------
1 file changed, 255 deletions(-)
diff --git a/wmbiff/ApopClient.c b/wmbiff/ApopClient.c
deleted file mode 100644
index c86b7b4..0000000
--- a/wmbiff/ApopClient.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/* Author : NAKAYAMA Takao ( hoehoe at wakaba.jp )
- *
- * Apop Email checker.
- *
- * Last Updated : Mon Sep 3 21:47:25 JST 2001
- *
- */
-
-#include "Client.h"
-#include <sys/types.h>
-#include <md5.h>
-
-#define PCU (pc->u).pop
-
-FILE *apopLogin(Pop3 pc)
-{
- int fd;
- FILE *fp;
- char buf[BUF_SIZE];
- char md5con[128], md5key[128], md5tmp[128];
- char chksum[64];
-
- if ((fd = sock_connect(PCU.serverName, PCU.serverPort)) == -1) {
- fprintf(stderr, "Not Connected To Server '%s:%d'\n",
- PCU.serverName, PCU.serverPort);
- return NULL;
- }
-
- fp = fdopen(fd, "r+");
- fgets(buf, BUF_SIZE, fp);
-
-
- /* cut md5 keyword from pop server */
-
- bzero(md5key, 128);
- bzero(md5tmp, 128);
- bzero(md5con, 128);
- strncpy(md5tmp, strchr(buf, '<'), 128);
- strncpy(md5key, md5tmp,
- strlen(md5tmp) - strlen(strchr(md5tmp, '>')) + 1);
-
-#ifdef DEBUG_APOP
- fprintf(stderr, "md5key=%s\n", md5key);
-#endif
-
- /* calculate MD5-chkcksum for APOP */
- strncpy(md5con, md5key, strlen(md5key));
- strncat(md5con, PCU.password, strlen(PCU.password));
- MD5Data(md5con, strlen(md5con), chksum);
-
-#ifdef DEBUG_APOP
- fprintf(stderr, "md5con=%s\n", md5con);
- fprintf(stderr, "chksum=%s\n", chksum);
- fflush(stderr);
-#endif
-
- fflush(fp);
- fprintf(fp, "APOP %s %s\r\n", PCU.userName, chksum);
- fflush(fp);
- fgets(buf, BUF_SIZE, fp);
- if (buf[0] != '+') {
- fprintf(stderr, "Invalid checksum '%s@%s:%d'\n",
- PCU.userName, PCU.serverName, PCU.serverPort);
-#ifdef DEBUG_APOP
- fprintf(stderr, "%s\n", buf);
-#endif
- fprintf(fp, "QUIT\r\n");
- fclose(fp);
- return NULL;
- };
-
- fflush(fp);
-
- return fp;
-}
-
-int apopCheckMail(Pop3 pc)
-{
- FILE *f;
- int read;
- char buf[BUF_SIZE];
-
- f = pc->open(pc);
- if (f == NULL)
- return -1;
-
- fflush(f);
- fprintf(f, "STAT\r\n");
- fflush(f);
- fgets(buf, 256, f);
- if (buf[0] != '+') {
- fprintf(stderr, "Error Receiving Stats '%s@%s:%d'\n",
- PCU.userName, PCU.serverName, PCU.serverPort);
- return -1;
- } else {
- sscanf(buf, "+OK %d", &(pc->TotalMsgs));
- }
-
- /* - Updated - Mark Hurley - debian4tux at telocity.com
- * In compliance with RFC 1725
- * which removed the LAST command, any servers
- * which follow this spec will return:
- * -ERR unimplimented
- * We will leave it here for those servers which haven't
- * caught up with the spec.
- */
- fflush(f);
- fprintf(f, "LAST\r\n");
- fflush(f);
- fgets(buf, 256, f);
- if (buf[0] != '+') {
- /* it is not an error to receive this according to RFC 1725 */
- /* no error should be returned */
- pc->UnreadMsgs = pc->TotalMsgs;
- } else {
- sscanf(buf, "+OK %d", &read);
- pc->UnreadMsgs = pc->TotalMsgs - read;
- }
-
- fprintf(f, "QUIT\r\n");
- fclose(f);
-
- return 0;
-}
-
-int apopCreate(Pop3 pc, char *str)
-{
- /* APOP format: apop:user:password at server[:port] */
- /* new APOP format: apop:user password server [port] */
- /* If 'str' line is badly formatted, wmbiff won't display the mailbox. */
-
- /* old config file style... */
- if (parse_old_apop_path(pc, str) != 0)
-
- /* new config file style... */
- if (parse_new_apop_path(pc, str) != 0) {
-
- /* The line is badly formatted,
- * we're not creating the mailbox line */
- pc->label[0] = 0;
- fprintf(stderr, "config line with bad format '%s'.\n", str);
- return -1;
- }
-
- return 0;
-}
-
-/* parse the apop config line
- * one simple function with a delimiter won't work,
- * because of the '@' before server in old style!
- */
-int parse_old_apop_path(Pop3 pc, char *str)
-{
- char *tmp;
- char *p;
-
-#ifdef DEBUG_APOP
- printf("apop: str = '%s'\n", str);
-#endif
-
- strcpy(PCU.password, "");
- strcpy(PCU.userName, "");
- strcpy(PCU.serverName, "");
- PCU.serverPort = 110;
-
- tmp = strdup(str);
-
- p = strtok(tmp, ":"); /* cut off 'apop:' */
-
- if ((p = strtok(NULL, ":"))) { /* p -> username */
- strcpy(PCU.userName, p);
- if ((p = strtok(NULL, "@"))) { /* p -> password */
- strcpy(PCU.password, p);
- if ((p = strtok(NULL, ":"))) { /* p -> server */
- strcpy(PCU.serverName, p);
- strcpy(pc->path, ""); /* p -> mailbox */
- if ((p = strtok(NULL, ":"))) { /* p -> port */
- PCU.serverPort = atoi(p);
- }
- free(tmp);
-
-#ifdef DEBUG_APOP
- printf("apop: userName= '%s'\n", PCU.userName);
- printf("apop: password= '%s'\n", PCU.password);
- printf("apop: serverName= '%s'\n", PCU.serverName);
- printf("apop: serverPort= '%d'\n", PCU.serverPort);
-#endif
- pc->open = apopLogin;
- pc->checkMail = apopCheckMail;
- pc->TotalMsgs = 0;
- pc->UnreadMsgs = 0;
- pc->OldMsgs = -1;
- pc->OldUnreadMsgs = -1;
- return 0;
- }
- }
- }
-
- return 1;
-}
-
-/* delimiter is a "space" */
-int parse_new_apop_path(Pop3 pc, char *str)
-{
- char *tmp;
- char *p;
- char *delim = " ";
-
-#ifdef DEBUG_APOP
- printf("apop: str = '%s'\n", str);
-#endif
-
- strcpy(PCU.password, "");
- strcpy(PCU.userName, "");
- strcpy(PCU.serverName, "");
- PCU.serverPort = 110;
-
- tmp = strdup(str);
-
- p = strtok(tmp, ":"); /* cut off 'apop:' */
-
- if ((p = strtok(NULL, delim))) { /* p -> username */
- strcpy(PCU.userName, p);
- if ((p = strtok(NULL, delim))) { /* p -> password */
- strcpy(PCU.password, p);
- if ((p = strtok(NULL, delim))) { /* p -> server */
- strcpy(PCU.serverName, p);
- strcpy(pc->path, ""); /* p -> mailbox */
- if ((p = strtok(NULL, delim))) { /* p -> port */
- PCU.serverPort = atoi(p);
- }
- free(tmp);
-
-#ifdef DEBUG_APOP
- printf("apop: userName= '%s'\n", PCU.userName);
- printf("apop: password= '%s'\n", PCU.password);
- printf("apop: serverName= '%s'\n", PCU.serverName);
- printf("apop: serverPort= '%d'\n", PCU.serverPort);
-#endif
- pc->open = apopLogin;
- pc->checkMail = apopCheckMail;
- pc->TotalMsgs = 0;
- pc->UnreadMsgs = 0;
- pc->OldMsgs = -1;
- pc->OldUnreadMsgs = -1;
- return 0;
- }
- }
- }
-
- return 1;
-}
-
-
-/* vim:set ts=4: */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git
- Previous message: [Pkg-wmaker-commits] [wmbiff] 04/09: Added my other SF account, which I intend to use now.
- Next message: [Pkg-wmaker-commits] [wmbiff] 06/09: * Big patch from Neil Spring which adds lots of crypto support to WMBiff. * WMBiff can now speak IMAP over TLS and CRAM-MD5, and APOP using libgcrypt. * Known problems: - gnutls is being developed still, so it may have security related bugs. - A bug in gnutls (a too-small buffer) may cause problems in the parsing of openssl certificates. This should be fixed by gnutls soon, hopefully. Added error messages if this bug is tickled. If you've got problems with IMAP SSL, please try upgrading gnutls. If the problem persists, let us know. - IMAP has totally been rewritten, so bugs may crop up. - Pop3 hasn't been rewritten to use the TLS primitives, though it probably could be if someone wanted to. * There's a new interface for reading and writing to the socket in tlsComm.[ch]. This makes the IMAP code somewhat independent of whether ssl is used, and provides nicer primitives to help skip 'informational' messages. * WITH_TLS and WITH_GCRYPT are on-by-default in the Makefile. TLS applies to encryption, GCRYPT to cram-md5 and apop authentication. Since gnutls depends on libgcrypt anyway, these probably don't need to be independent. Some compile warnings may be generated when these are disabled. * Added code to optionally include dmalloc.h and link -ldmalloc. This doesn't do anything at the moment, but shouldn't hurt. It's off-by-default. * IMAP connections are now persistent. persistent. This is to cut down on the need to re-negotiate an SSL connection every time you want to check mail. It tries to use just one connection per (server/username/password/port number), which means multiple mailboxes need only one connection. * There are a handful of lclint (http://lclint.cs.virginia.edu) annotations in tlsComm.[ch]. These should also not hurt anyone, and are meant to keep the signal to noise ratio of lclint high. * The rewritten IMAP code uses the GNU regex library to handle the configuration line. I think its clearer than the cascading strtok() solution, but the regex might not be perfect. * Removed an unnecessary "inline" keyword from charutil.h. * Added a TODO document with the bits that are missing from the picture. * Please bow in awe at NAKAYAMA Takao, Jay T. Francis and specially Neil Spring for all of this.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Pkg-wmaker-commits
mailing list