Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: third_party/twisted_8_1/twisted/conch/openssh_compat/factory.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/conch/openssh_compat/factory.py
diff --git a/third_party/twisted_8_1/twisted/conch/openssh_compat/factory.py b/third_party/twisted_8_1/twisted/conch/openssh_compat/factory.py
deleted file mode 100644
index e14d7e280249f16b3ac622f08fa9d5fe0d77db99..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/conch/openssh_compat/factory.py
+++ /dev/null
@@ -1,43 +0,0 @@
-from twisted.conch.ssh import keys, factory, common
-from twisted.python import log
-import primes
-import os
-
-class OpenSSHFactory(factory.SSHFactory):
- dataRoot = '/usr/local/etc'
- moduliRoot = '/usr/local/etc' # for openbsd which puts moduli in a different
- # directory from keys
- def getPublicKeys(self):
- ks = {}
- for file in os.listdir(self.dataRoot):
- if file[:9] == 'ssh_host_' and file[-8:]=='_key.pub':
- try:
- k = keys.getPublicKeyString(self.dataRoot+'/'+file)
- t = common.getNS(k)[0]
- ks[t] = k
- except Exception, e:
- log.msg('bad public key file %s: %s' % (file,e))
- return ks
- def getPrivateKeys(self):
- ks = {}
- euid,egid = os.geteuid(), os.getegid()
- os.setegid(0) # gain priviledges
- os.seteuid(0)
- for file in os.listdir(self.dataRoot):
- if file[:9] == 'ssh_host_' and file[-4:]=='_key':
- try:
- k = keys.getPrivateKeyObject(self.dataRoot+'/'+file)
- t = keys.objectType(k)
- ks[t] = k
- except Exception, e:
- log.msg('bad private key file %s: %s' % (file, e))
- os.setegid(egid) # drop them just as quickily
- os.seteuid(euid)
- return ks
-
- def getPrimes(self):
- try:
- return primes.parseModuliFile(self.moduliRoot+'/moduli')
- except IOError:
- return None
-

Powered by Google App Engine
This is Rietveld 408576698