[CalendarServer-changes] [3378] CalendarServer/trunk/twistedcaldav/tap.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Nov 13 13:11:59 PST 2008


Revision: 3378
          http://trac.macosforge.org/projects/calendarserver/changeset/3378
Author:   sagen at apple.com
Date:     2008-11-13 13:11:56 -0800 (Thu, 13 Nov 2008)
Log Message:
-----------
Remove extra whitespace from passphrase

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/tap.py

Modified: CalendarServer/trunk/twistedcaldav/tap.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/tap.py	2008-11-13 20:40:28 UTC (rev 3377)
+++ CalendarServer/trunk/twistedcaldav/tap.py	2008-11-13 21:11:56 UTC (rev 3378)
@@ -271,7 +271,8 @@
                 % (description, dirpath,)
             )
 
-def getSSLPassphrase(*args):
+def getSSLPassphrase(*ignored):
+
     if not config.SSLPrivateKey:
         return None
 
@@ -289,23 +290,23 @@
             log.error("Could not get passphrase for %s: %s"
                       % (config.SSLPrivateKey, error))
         else:
-            return output
+            return output.strip()
 
     if config.SSLPassPhraseDialog and os.path.isfile(config.SSLPassPhraseDialog):
         sslPrivKey = open(config.SSLPrivateKey)
         try:
-            type = None
+            keyType = None
             for line in sslPrivKey.readlines():
                 if "-----BEGIN RSA PRIVATE KEY-----" in line:
-                    type = "RSA"
+                    keyType = "RSA"
                     break
                 elif "-----BEGIN DSA PRIVATE KEY-----" in line:
-                    type = "DSA"
+                    keyType = "DSA"
                     break
         finally:
             sslPrivKey.close()
 
-        if type is None:
+        if keyType is None:
             log.error("Could not get private key type for %s"
                       % (config.SSLPrivateKey,))
         else:
@@ -313,7 +314,7 @@
                 args=[
                     config.SSLPassPhraseDialog,
                     "%s:%s" % (config.ServerHostName, config.SSLPort),
-                    type,
+                    keyType,
                 ],
                 stdout=PIPE, stderr=PIPE,
             )
@@ -323,7 +324,7 @@
                 log.error("Could not get passphrase for %s: %s"
                           % (config.SSLPrivateKey, error))
             else:
-                return output
+                return output.strip()
 
     return None
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081113/39826a18/attachment.html>


More information about the calendarserver-changes mailing list