Changeset 2251
- Timestamp:
- 08/03/07 17:12:22 (14 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/ndg.security.common/ndg/security/common/wsSecurity.py
r2148 r2251 475 475 # Signed Info - Signature method 476 476 sigMethodElem = signedInfoElem.createAppendElement(DSIG.BASE, 477 'SignatureMethod')477 'SignatureMethod') 478 478 sigMethodElem.node.setAttribute('Algorithm', DSIG.SIG_RSA_SHA1) 479 479 … … 565 565 566 566 # Calculate digest of SignedInfo 567 signedInfoDigestValue = sha(c14nSignedInfo).digest().strip() 567 # 568 # TODO: check status for strip call - almost certainly wrong and not 569 # needed 570 signedInfoDigestValue = sha(c14nSignedInfo).digest()#.strip() 568 571 569 572 # Sign using the private key and base 64 encode the result … … 700 703 701 704 # Canonicalize the SignedInfo node and take digest 702 c14nSignedInfo = Canonicalize(signedInfoNode, **signedInfoC14nKw) 703 signedInfoDigestValue = sha(c14nSignedInfo).digest() 705 c14nSignedInfo = Canonicalize(signedInfoNode, **signedInfoC14nKw) 706 707 # TODO: strip() call? - almost certainly wrong - leave out! 708 signedInfoDigestValue = sha(c14nSignedInfo).digest()#.strip() 704 709 705 710 # Get the signature value in order to check against the digest just … … 712 717 b64EncSignatureValue = \ 713 718 str(signatureValueNode.childNodes[0].nodeValue).strip() 714 719 715 720 signatureValue = base64.decodestring(b64EncSignatureValue) 716 721 -
TI12-security/trunk/python/ndg.security.common/setup.cfg
r2234 r2251 10 10 # This software may be distributed under the terms of the Q Public License, 11 11 # version 1.0 or later. 12 [EasyInstall]13 14 12 [build_ext] 15 13 include_dirs: /usr/local/include … … 19 17 20 18 [egg_info] 21 tag_build = -DevPostAlpha22 #tag_svn_revision = true19 tag_build = _dews 20 tag_svn_revision = true 23 21 -
TI12-security/trunk/python/ndg.security.common/setup.py
r2238 r2251 27 27 # TODO: subdivide these into server and client specific and comon dependencies 28 28 _pkgDependencies = [ 29 'ZSI', 29 'ZSI >= 2.0rc3', 30 '4Suite-XML >= 1.0rc3', 30 31 'pycrypto', 31 32 'SQLObject', 33 'M2Crypto', 32 34 # 'MySQL-python', - gcc: unrecognized option `-restrict' 33 35 ] … … 41 43 _pkgDependencyLinks = [ 42 44 # Custom M2Crypto for use with Python MyProxy client 43 "http:// proj.badc.rl.ac.uk/ndg/browser/TI12-security/branches/Dependencies/m2crypto/dist/M2Crypto-0.16-py2.4-linux-i686.egg?format=raw",44 "ftp://ftp.4suite.org/pub/4Suite/4Suite-XML-1.0.tar.gz",45 "http:// prdownloads.sourceforge.net/pyxml/PyXML-0.8.4.tar.gz?use_mirror=kent"45 "http://ndg.nerc.ac.uk/dist", 46 # ZSI - use this link to ensure correct dependency download for PyXML 47 "http://sourceforge.net/project/showfiles.php?group_id=26590&package_id=30660", 46 48 # Twisted won't install as an egg 47 49 # "http://tmrc.mit.edu/mirror/twisted/Web/0.5/TwistedWeb-0.5.0.tar.bz2", -
TI12-security/trunk/python/ndg.security.server/ndg.security.server.egg-info/PKG-INFO
r2239 r2251 1 1 Metadata-Version: 1.0 2 2 Name: ndg.security.server 3 Version: 0.7.2- DevPostAlpha3 Version: 0.7.2-dews-r2240 4 4 Summary: NERC DataGrid Security Services 5 5 Home-page: http://proj.badc.rl.ac.uk/ndg -
TI12-security/trunk/python/ndg.security.server/ndg.security.server.egg-info/SOURCES.txt
r2239 r2251 2 2 setup.cfg 3 3 setup.py 4 dist/ndg.security.server-0.7.2_DevPostAlpha-py2.4.egg 4 5 ndg/__init__.py 5 6 ndg.security.server.egg-info/PKG-INFO -
TI12-security/trunk/python/ndg.security.server/ndg.security.server.egg-info/dependency_links.txt
r2239 r2251 1 http://proj.badc.rl.ac.uk/ndg/browser/TI12-security/trunk/python/ndg.security.common/dist/ndg.security.common-0.7.2_DevPostAlpha-py2.4.egg?format=raw 2 http://www.zope.org/Products/ZopeInterface/3.0.1final/ZopeInterface-3.0.1.tgz 1 http://ndg.nerc.ac.uk/dist -
TI12-security/trunk/python/ndg.security.server/ndg.security.server.egg-info/requires.txt
r2239 r2251 1 ndg.security.common 1 2 pycrypto 2 ndg.security.common -
TI12-security/trunk/python/ndg.security.server/ndg/security/server/AttAuthority/__init__.py
r2181 r2251 36 36 class AttAuthorityError(Exception): 37 37 """Exception handling for NDG Attribute Authority class.""" 38 39 38 40 39 #_____________________________________________________________________________ … … 88 87 'sslCertFile', 89 88 'sslKeyFile', 89 'sslKeyPwd', 90 'certFile', 90 91 'keyFile', 91 92 'keyPwd', 92 'certFile',93 93 'caCertFile', 94 94 'clntCertFile', … … 589 589 if elem.tag in self.__class__.__validKeys: 590 590 591 if elem.tag != 'keyPwd' and elem.text: 591 # Make sure to leave password element contents unchanged 592 if 'eyPwd' not in elem.tag and elem.text: 592 593 self.__prop[elem.tag] = \ 593 594 os.path.expandvars(elem.text.strip()) … … 622 623 except OSError, osError: 623 624 raise AttAuthorityError, \ 624 "Invalid directory path Attribute Certificates store: %s"% \625 osError.strerror625 'Invalid directory path Attribute Certificates store "%s": %s' % \ 626 (self.__prop['attCertDir'], osError.strerror) 626 627 627 628 -
TI12-security/trunk/python/ndg.security.server/ndg/security/server/AttAuthority/server-config.tac
r2240 r2251 14 14 License, version 1.0 or later. 15 15 """ 16 import socket16 import os 17 17 18 18 from ZSI.twisted.WSresource import WSResource … … 144 144 siteFactory.sslChecker = SSL.Checker.Checker() 145 145 146 ctx = SSL.Context('sslv3') 146 # TODO: Python ssl client seems to require SSL vers 2 is this a security 147 # risk? 148 ctx = SSL.Context(protocol='sslv23') 147 149 ctx.set_cipher_list("NULL-MD5:ALL:!ADH:!EXP:@STRENGTH") 148 ctx.load_cert(CERTFILE, KEYFILE) 150 ctx.load_cert(srv.aa['sslCertFile'], 151 srv.aa['sslKeyFile'], 152 callback=lambda *args, **kw: srv.aa['sslKeyPwd']) 153 149 154 ctx.set_allow_unknown_ca(False) 150 155 ctx.set_verify(SSL.verify_peer, 10) … … 168 173 169 174 siteFactory = factory 170 171 port = internet.TCPServer(PORT, siteFactory)172 173 174 175 176 port = internet.TCPServer(srv.aa['portNum'], siteFactory) 177 port.CERTFILE = srv.aa['sslCertFile'] 178 port.KEYFILE = srv.aa['sslKeyFile'] 179 root.__class__.server = port 175 180 else: 176 181 # Non-SSL -
TI12-security/trunk/python/ndg.security.server/ndg/security/server/MyProxy.py
r2170 r2251 79 79 # Globus host certificate has a "host/" prefix - see explanation in 80 80 # __init__.__doc__ 81 host = None or self.cnHostPfx + self.host 81 cnHostPfx = isinstance(self.cnHostPfx, basestring) \ 82 and self.cnHostPfx or '' 83 host = None or cnHostPfx + self.host 82 84 83 85 try: -
TI12-security/trunk/python/ndg.security.server/ndg/security/server/conf/attAuthorityProperties.xml
r2181 r2251 7 7 <name>BADC</name> 8 8 <portNum>5000</portNum> 9 <useSSL>Yes</useSSL> <!-- leave blank to use http --> 9 <!-- 10 PKI settings for transport level encryption 11 --> 12 <useSSL></useSSL> <!-- leave blank to use http --> 10 13 <sslCertFile></sslCertFile> 11 14 <sslKeyFile></sslKeyFile> 15 <sslKeyPwd></sslKeyPwd> 12 16 <!-- 13 17 PKI settings for signature of outbound SOAP messages 14 18 --> 19 <certFile></certFile> 15 20 <keyFile></keyFile> 16 21 <keyPwd></keyPwd> 17 <certFile></certFile>18 22 <caCertFile></caCertFile> 19 23 <!-- -
TI12-security/trunk/python/ndg.security.server/setup.cfg
r2239 r2251 10 10 # This software may be distributed under the terms of the Q Public License, 11 11 # version 1.0 or later. 12 [EasyInstall]13 14 12 [build_ext] 15 13 include_dirs: /usr/local/include 16 14 library_dirs: /usr/local/lib 17 15 18 [install] 16 [egg_info] 17 tag_build = -dews 18 tag_svn_revision = true 19 19 20 [egg_info]21 tag_build = -DevPostAlpha22 #tag_svn_revision = true23 -
TI12-security/trunk/python/ndg.security.server/setup.py
r2239 r2251 26 26 # TODO: subdivide these into server and client specific and comon dependencies 27 27 _pkgDependencies = [ 28 'ndg.security.common', 28 29 'pycrypto', 29 'ndg.security.common',30 30 # MySQL-python', - gcc: unrecognized option `-restrict' 31 31 ] … … 50 50 # the explicit URL. This may cause problems later! 51 51 dependency_links = [ 52 "http:// proj.badc.rl.ac.uk/ndg/browser/TI12-security/trunk/python/ndg.security.common/dist/ndg.security.common-0.7.2_DevPostAlpha-py2.4.egg?format=raw",53 "http://www.zope.org/Products/ZopeInterface/3.0.1final/ZopeInterface-3.0.1.tgz"52 "http://ndg.nerc.ac.uk/dist", 53 # "http://www.zope.org/Products/ZopeInterface/3.0.1final/ZopeInterface-3.0.1.tgz" 54 54 ], 55 55 -
TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/AttAuthorityClientTest.py
r2178 r2251 40 40 signingPriKeyFilePath=self.cfg['setUp']['userprikeyfilepath'], 41 41 tracefile=sys.stderr) 42 43 42 44 43 45 44 def test1GetX509Cert(self): 46 45 '''test1GetX509Cert: retrieve Attribute Authority's X.509 cert.''' 47 #import pdb;pdb.set_trace()48 46 resp = self.clnt.getX509Cert() 49 47 print "Attribute Authority X.509 cert.:\n" + resp -
TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/attAuthorityClientTest.cfg
r2214 r2251 10 10 # ! SiteBMapConfig.xml trusted site A aaURI setting must agree with this 11 11 # setting for test6GetMappedAttCert 12 uri = http://localhost:5000/AttributeAuthority13 uri = http ://glue.badc.rl.ac.uk:41000/AttributeAuthority12 #uri = http://localhost:5000/AttributeAuthority 13 uri = https://localhost:5000/AttributeAuthority 14 14 15 15 # X.509 certificate for Attribute Authority - to verify the signature of -
TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/siteAAttAuthorityProperties.xml
r2181 r2251 3 3 <name>Site A</name> 4 4 <portNum>5000</portNum> 5 <useSSL></useSSL> <!-- leave blank to use http --> 6 <sslCertFile></sslCertFile> 7 <sslKeyFile></sslKeyFile> 5 <useSSL>True</useSSL> <!-- leave blank to use http --> 6 <sslCertFile>$NDGSEC_AA_UNITTEST_DIR/aa-cert.pem</sslCertFile> 7 <sslKeyFile>$NDGSEC_AA_UNITTEST_DIR/aa-key.pem</sslKeyFile> 8 <sslKeyPwd>Junk</sslKeyPwd> 9 <certFile>$NDGSEC_AA_UNITTEST_DIR/aa-cert.pem</certFile> 8 10 <keyFile>$NDGSEC_AA_UNITTEST_DIR/aa-key.pem</keyFile> 9 11 <keyPwd>Junk</keyPwd> 10 <certFile>$NDGSEC_AA_UNITTEST_DIR/aa-cert.pem</certFile>11 12 <caCertFile>$NDGSEC_AA_UNITTEST_DIR/cacert.pem</caCertFile> 12 13 <!-- -
TI12-security/trunk/python/ndg.security.test/ndg/security/test/AttAuthority/siteBAttAuthorityProperties.xml
r2181 r2251 6 6 <sslCertFile></sslCertFile> 7 7 <sslKeyFile></sslKeyFile> 8 <sslKeyPwd>Junk</sslKeyPwd> 9 <certFile>$NDGSEC_AA_UNITTEST_DIR/aa-cert.pem</certFile> 10 <caCertFile>$NDGSEC_AA_UNITTEST_DIR/cacert.pem</caCertFile> 8 11 <keyFile>$NDGSEC_AA_UNITTEST_DIR/aa-key.pem</keyFile> 9 12 <keyPwd>Junk</keyPwd> 10 <certFile>$NDGSEC_AA_UNITTEST_DIR/aa-cert.pem</certFile>11 <caCertFile>$NDGSEC_AA_UNITTEST_DIR/cacert.pem</caCertFile>12 13 <!-- 13 14 Set the certificate used to verify the signature of messages from the -
TI12-security/trunk/python/ndg.security.test/ndg/security/test/MyProxy/myProxyProperties.xml
r2017 r2251 20 20 Set "host/" prefix to host cert CN as is default with globus 21 21 --> 22 <serverCNprefix> host/</serverCNprefix>22 <serverCNprefix></serverCNprefix> 23 23 <!-- 24 24 Nb. GRID_SECURITY_DIR environment variable if set, overrides this setting
Note: See TracChangeset
for help on using the changeset viewer.