Branch: master

59e52358 2015-09-03 13:14:32 Timothy Pearson
Fix compiler warning regarding missing braces
M tdeio/kssl/ksslinfodlg.cc
diff --git a/tdeio/kssl/ksslinfodlg.cc b/tdeio/kssl/ksslinfodlg.cc
index fa1e380..5958190 100644
--- a/tdeio/kssl/ksslinfodlg.cc
+++ b/tdeio/kssl/ksslinfodlg.cc
@@ -134,24 +134,28 @@
 
 
 void KSSLInfoDlg::setSecurityInQuestion(bool isIt) {
-    d->inQuestion = isIt;
-    if (KSSL::doesSSLWork())
-        if (isIt) {
-            d->pixmap->setPixmap(BarIcon("halfencrypted"));
-            if (d->m_secCon) {
-                d->info->setText(i18n("The main part of this document is secured with SSL, but some parts are not."));
-            } else {
-                d->info->setText(i18n("Some of this document is secured with SSL, but the main part is not."));
-            }
-        } else {
-            if (d->m_secCon) {
-                d->pixmap->setPixmap(BarIcon("encrypted"));
-                d->info->setText(i18n("Current connection is secured with SSL."));
-            } else {
-                d->pixmap->setPixmap(BarIcon("decrypted"));
-                d->info->setText(i18n("Current connection is not secured with SSL."));
-            }
-        }
+	d->inQuestion = isIt;
+	if (KSSL::doesSSLWork()) {
+		if (isIt) {
+			d->pixmap->setPixmap(BarIcon("halfencrypted"));
+			if (d->m_secCon) {
+				d->info->setText(i18n("The main part of this document is secured with SSL, but some parts are not."));
+			}
+			else {
+				d->info->setText(i18n("Some of this document is secured with SSL, but the main part is not."));
+			}
+		}
+		else {
+			if (d->m_secCon) {
+				d->pixmap->setPixmap(BarIcon("encrypted"));
+				d->info->setText(i18n("Current connection is secured with SSL."));
+			}
+			else {
+				d->pixmap->setPixmap(BarIcon("decrypted"));
+				d->info->setText(i18n("Current connection is not secured with SSL."));
+			}
+		}
+	}
 }
 
 
5e9959ef 2015-09-03 13:23:05 Timothy Pearson
Fix compiler warnings
M tdeio/tdeio/kshred.cpp
diff --git a/tdeio/tdeio/kshred.cpp b/tdeio/tdeio/kshred.cpp
index 0bc01c2..b013e20 100644
--- a/tdeio/tdeio/kshred.cpp
+++ b/tdeio/tdeio/kshred.cpp
@@ -206,9 +206,11 @@
 bool
 KShred::shred()
 {
-  unsigned char p[6][3] = {{'\222', '\111', '\044'}, {'\111', '\044', '\222'},
-                           {'\044', '\222', '\111'}, {'\155', '\266', '\333'},
-                           {'\266', '\333', '\155'}, {'\333', '\155', '\266'}};
+  // WARNING
+  // These numbers are octal.  Do not remove the leading zeros!
+  unsigned char p[6][3] = {{0222, 0111,  044}, {0111,  044, 0222},
+                           { 044, 0222, 0111}, {0155, 0266, 0333},
+                           {0266, 0333, 0155}, {0333, 0155, 0266}};
   TQString msg = i18n("Shredding:  pass %1 of 35");
 
   emit processedSize(0);
c51a15f0 2015-09-03 13:24:43 Timothy Pearson
Fix unused variable compiler warnings
M tdeio/kssl/ksslkeygen.cc
diff --git a/tdeio/kssl/ksslkeygen.cc b/tdeio/kssl/ksslkeygen.cc
index 65bd2d0..86fe471 100644
--- a/tdeio/kssl/ksslkeygen.cc
+++ b/tdeio/kssl/ksslkeygen.cc
@@ -122,7 +122,6 @@
 int KSSLKeyGen::generateCSR(const TQString& name, const TQString& pass, int bits, int e) {
 #ifdef KSSL_HAVE_SSL
 	KOSSL *kossl = KOSSL::self();
-	int rc;
 
 	X509_REQ *req = kossl->X509_REQ_new();
 	if (!req) {
@@ -142,9 +141,9 @@
 		return -3;
 	}
 
-	rc = kossl->EVP_PKEY_assign(pkey, EVP_PKEY_RSA, (char *)rsakey);
+	kossl->EVP_PKEY_assign(pkey, EVP_PKEY_RSA, (char *)rsakey);
 
-	rc = kossl->X509_REQ_set_pubkey(req, pkey);
+	kossl->X509_REQ_set_pubkey(req, pkey);
 
 	// Set the subject
 	X509_NAME *n = kossl->X509_NAME_new();
@@ -157,10 +156,10 @@
 	kossl->X509_NAME_add_entry_by_txt(n, (char*)LN_commonName, MBSTRING_UTF8, (unsigned char*)name.local8Bit().data(), -1, -1, 0);
 	kossl->X509_NAME_add_entry_by_txt(n, (char*)LN_pkcs9_emailAddress, MBSTRING_UTF8, (unsigned char*)name.local8Bit().data(), -1, -1, 0);
 	
-	rc = kossl->X509_REQ_set_subject_name(req, n);
+	kossl->X509_REQ_set_subject_name(req, n);
 
 
-	rc = kossl->X509_REQ_sign(req, pkey, kossl->EVP_md5());
+	kossl->X509_REQ_sign(req, pkey, kossl->EVP_md5());
 
 	// We write it to the database and then the caller can obtain it
 	// back from there.  Yes it's inefficient, but it doesn't happen
70bb9dde 2015-09-03 13:32:46 Timothy Pearson
Fix compiler warnings from ignored write return values
M tdeio/misc/tdesendbugmail/smtp.cpp
diff --git a/tdeio/misc/tdesendbugmail/smtp.cpp b/tdeio/misc/tdesendbugmail/smtp.cpp
index d282782..470f240 100644
--- a/tdeio/misc/tdesendbugmail/smtp.cpp
+++ b/tdeio/misc/tdesendbugmail/smtp.cpp
@@ -128,20 +128,22 @@
 
 void SMTP::sendMessage(void)
 {
-    if(!connected)
-        connectTimerTick();
-    if(state == FINISHED && connected){
-        kdDebug() << "state was == FINISHED\n" << endl;
-        finished = false;
-        state = IN;
-        writeString = TQString::fromLatin1("helo %1\r\n").arg(domainName);
-        write(sock->socket(), writeString.ascii(), writeString.length());
-    }
-    if(connected){
-        kdDebug() << "enabling read on sock...\n" << endl;
-        interactTimer.start(timeOut, true);
-        sock->enableRead(true);
-    }
+	if(!connected)
+		connectTimerTick();
+	if(state == FINISHED && connected){
+		kdDebug() << "state was == FINISHED\n" << endl;
+		finished = false;
+		state = IN;
+		writeString = TQString::fromLatin1("helo %1\r\n").arg(domainName);
+		if (write(sock->socket(), writeString.ascii(), writeString.length()) < 0) {
+			// Error
+		}
+	}
+	if(connected){
+		kdDebug() << "enabling read on sock...\n" << endl;
+		interactTimer.start(timeOut, true);
+		sock->enableRead(true);
+	}
 }
 #include <stdio.h>
 
@@ -246,91 +248,121 @@
 
 void SMTP::processLine(TQString *line)
 {
-    int i, stat;
-    TQString tmpstr;
+	int i, stat;
+	TQString tmpstr;
 
-    i = line->find(' ');
-    tmpstr = line->left(i);
-    if(i > 3)
-        kdDebug() << "warning: SMTP status code longer then 3 digits: " << tmpstr << endl;
-    stat = tmpstr.toInt();
-    serverState = (SMTPServerStatus)stat;
-    lastState = state;
+	i = line->find(' ');
+	tmpstr = line->left(i);
+	if(i > 3)
+		kdDebug() << "warning: SMTP status code longer then 3 digits: " << tmpstr << endl;
+	stat = tmpstr.toInt();
+	serverState = (SMTPServerStatus)stat;
+	lastState = state;
 
-    kdDebug() << "smtp state: [" << stat << "][" << *line << "]" << endl;
+	kdDebug() << "smtp state: [" << stat << "][" << *line << "]" << endl;
 
-    switch(stat){
-    case GREET:     //220
-        state = IN;
-        writeString = TQString::fromLatin1("helo %1\r\n").arg(domainName);
-        kdDebug() << "out: " << writeString << endl;
-	write(sock->socket(), writeString.ascii(), writeString.length());
-        break;
-    case GOODBYE:   //221
-        state = QUIT;
-        break;
-    case SUCCESSFUL://250
-        switch(state){
-        case IN:
-            state = READY;
-            writeString = TQString::fromLatin1("mail from: %1\r\n").arg(senderAddress);
-            kdDebug() << "out: " << writeString << endl;
-            write(sock->socket(), writeString.ascii(), writeString.length());
-            break;
-        case READY:
-            state = SENTFROM;
-            writeString = TQString::fromLatin1("rcpt to: %1\r\n").arg(recipientAddress);
-             kdDebug() << "out: " << writeString << endl;
-            write(sock->socket(), writeString.ascii(), writeString.length());
-            break;
-        case SENTFROM:
-            state = SENTTO;
-            writeString = TQString::fromLatin1("data\r\n");
-             kdDebug() << "out: " << writeString << endl;
-            write(sock->socket(), writeString.ascii(), writeString.length());
-            break;
-        case DATA:
-            state = FINISHED;
-            finished = true;
-            sock->enableRead(false);
-            emit messageSent();
-            break;
-        default:
-            state = CERROR;
-            kdDebug() << "smtp error (state error): [" << lastState << "]:[" << stat << "][" << *line << "]" << endl;
-            socketClose(sock);
-            emit error(COMMAND);
-            break;
-        }
-        break;
-    case READYDATA: //354
-        state = DATA;
-        writeString = TQString::fromLatin1("Subject: %1\r\n").arg(messageSubject);
-        writeString += messageHeader;
-        writeString += "\r\n";
-        writeString += messageBody;
-        writeString += TQString::fromLatin1(".\r\n");
-        kdDebug() << "out: " << writeString;
-        write(sock->socket(), writeString.ascii(), writeString.length());
-        break;
-    case ERROR:     //501
-        state = CERROR;
-        kdDebug() << "smtp error (command error): [" << lastState << "]:[" << stat << "][" << *line << "]\n" << endl;
-        socketClose(sock);
-        emit error(COMMAND);
-        break;
-    case UNKNOWN:   //550
-        state = CERROR;
-        kdDebug() << "smtp error (unknown user): [" << lastState << "]:[" << stat << "][" << *line << "]" << endl;
-        socketClose(sock);
-        emit error(UNKNOWNUSER);
-        break;
-    default:
-        state = CERROR;
-        kdDebug() << "unknown response: [" << lastState << "]:[" << stat << "][" << *line << "]" << endl;
-        socketClose(sock);
-        emit error(UNKNOWNRESPONSE);
-    }
+	switch(stat){
+	case GREET:     //220
+		state = IN;
 ** Diff limit reached (max: 250 lines) **
5896a404 2015-09-03 13:36:26 Timothy Pearson
Add initial CRL support to KSSLCertificate
M tdeio/kssl/kopenssl.cc
M tdeio/kssl/kopenssl.h
M tdeio/kssl/ksslcertificate.cc
M tdeio/kssl/ksslcertificate.h
 ** Diff limit reached (max: 250 lines) **