Changeset 3139 for TI12-security
- Timestamp:
- 12/12/07 16:19:42 (13 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 4 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/ndg.security.common/ndg/security/common/CredWallet.py
r3133 r3139 514 514 515 515 aaClnt = AttAuthorityClient(uri=aaURI, 516 517 518 519 520 521 sslCACertFilePathList=caCertFilePathList)516 reqBinSecTokValType=reqBinSecTokValType, 517 signingCertChain=certChain, 518 signingCert=self.__userCert, 519 signingPriKey=self.__userPriKey, 520 caCertFilePathList=self.__caCertFilePathList, 521 sslCACertFilePathList=self.__caCertFilePathList) 522 522 return aaClnt 523 523 -
TI12-security/trunk/python/ndg.security.test/ndg/security/test/sessionMgr/test.py
r3133 r3139 62 62 prompt="\ntest1Connect pass-phrase for user: ") 63 63 64 proxyCert, self.proxyPriKey, self.userCert, self.sessID = \64 userCert, self.userPriKey, self.issuingCert, self.sessID = \ 65 65 self.sm.connect(username=self.cfg.get('test1Connect', 'username'), 66 66 passphrase=SessionMgrTestCase.test1Passphrase) 67 self. proxyCert = X509CertParse(proxyCert)67 self.userCert = X509CertParse(userCert) 68 68 69 69 print "User '%s' connected to Session Manager:\n%s" % \ … … 89 89 print "\n\t" + self.test3ConnectNoCreateServerSess.__doc__ 90 90 91 if SessionMgrTestCase.test3Passphrase is None: 91 if SessionMgrTestCase.test3Passphrase is None and \ 92 self.cfg.has_option('test3ConnectNoCreateServerSess', 93 'passphrase'): 92 94 SessionMgrTestCase.test3Passphrase = \ 93 95 self.cfg.get('test3ConnectNoCreateServerSess', 'passphrase') 94 96 95 97 if not SessionMgrTestCase.test3Passphrase: 96 98 SessionMgrTestCase.test3Passphrase = getpass.getpass(\ … … 98 100 99 101 username = self.cfg.get('test3ConnectNoCreateServerSess', 'username') 100 self. proxyCert, self.proxyPriKey, self.userCert, sessID = \102 self.userCert, self.userPriKey, self.issuingCert, sessID = \ 101 103 self.sm.connect(username=username, 102 104 passphrase=SessionMgrTestCase.test3Passphrase, … … 108 110 print "User '%s' connected to Session Manager:\n%s" % \ 109 111 (self.cfg.get('test3ConnectNoCreateServerSess', 'username'), 110 self. proxyCert)111 112 113 def test4Disconnect UsingSessID(self):114 """test4Disconnect UsingSessID: disconnect as if acting as a browser client112 self.userCert) 113 114 115 def test4DisconnectWithSessID(self): 116 """test4DisconnectWithSessID: disconnect as if acting as a browser client 115 117 """ 116 118 117 print "\n\t" + self.test4Disconnect UsingSessID.__doc__119 print "\n\t" + self.test4DisconnectWithSessID.__doc__ 118 120 self.test1Connect() 119 121 self.sm.deleteUserSession(sessID=self.sessID) … … 122 124 123 125 124 def test5Disconnect UsingProxyCert(self):125 """test5Disconnect UsingProxyCert: Disconnect as a command line client126 def test5DisconnectWithUserCert(self): 127 """test5DisconnectWithUserCert: Disconnect as a command line client 126 128 """ 127 129 128 print "\n\t" + self.test5Disconnect UsingProxyCert.__doc__130 print "\n\t" + self.test5DisconnectWithUserCert.__doc__ 129 131 self.test1Connect() 130 132 131 133 # Proxy cert in signature determines ID of session to 132 134 # delete 133 self.sm.deleteUserSession( proxyCert=self.proxyCert)134 print "User disconnected from Session Manager:\n%s" % self. proxyCert135 136 137 def test6GetAttCert UsingSessID(self):138 """test6GetAttCert UsingSessID: make an attribute request using135 self.sm.deleteUserSession(userCert=self.userCert) 136 print "User disconnected from Session Manager:\n%s" % self.userCert 137 138 139 def test6GetAttCertWithSessID(self): 140 """test6GetAttCertWithSessID: make an attribute request using 139 141 a session ID as authentication credential""" 140 142 141 print "\n\t" + self.test6GetAttCert UsingSessID.__doc__143 print "\n\t" + self.test6GetAttCertWithSessID.__doc__ 142 144 self.test1Connect() 143 145 144 146 attCert, errMsg, extAttCertList = self.sm.getAttCert(\ 145 147 sessID=self.sessID, 146 aaURI=self.cfg.get('test6GetAttCert UsingSessID', 'aauri'))148 aaURI=self.cfg.get('test6GetAttCertWithSessID', 'aauri')) 147 149 if errMsg: 148 150 self.fail(errMsg) … … 150 152 print "Attribute Certificate:\n%s" % attCert 151 153 attCert.filePath = \ 152 self.cfg.get('test6GetAttCert UsingSessID', 'acoutfilepath')154 self.cfg.get('test6GetAttCertWithSessID', 'acoutfilepath') 153 155 attCert.write() 154 156 … … 156 158 157 159 158 def test6aGetAttCertRefused UsingSessID(self):159 """test6aGetAttCertRefused UsingSessID: make an attribute request using160 def test6aGetAttCertRefusedWithSessID(self): 161 """test6aGetAttCertRefusedWithSessID: make an attribute request using 160 162 a sessID as authentication credential requesting an AC from an 161 163 Attribute Authority where the user is NOT registered""" 162 164 163 print "\n\t" + self.test6aGetAttCertRefused UsingSessID.__doc__164 self.test1Connect() 165 166 aaURI = self.cfg.get('test6aGetAttCertRefused UsingSessID', 'aauri')165 print "\n\t" + self.test6aGetAttCertRefusedWithSessID.__doc__ 166 self.test1Connect() 167 168 aaURI = self.cfg.get('test6aGetAttCertRefusedWithSessID', 'aauri') 167 169 168 170 attCert, errMsg, extAttCertList = self.sm.getAttCert(sessID=self.sessID, … … 176 178 177 179 178 def test6bGetMappedAttCert UsingSessID(self):179 """test6bGetMappedAttCert UsingSessID: make an attribute request using180 def test6bGetMappedAttCertWithSessID(self): 181 """test6bGetMappedAttCertWithSessID: make an attribute request using 180 182 a session ID as authentication credential""" 181 183 182 print "\n\t" + self.test6bGetMappedAttCert UsingSessID.__doc__184 print "\n\t" + self.test6bGetMappedAttCertWithSessID.__doc__ 183 185 self.test1Connect() 184 186 185 187 # Attribute Certificate cached in test 6 can be used to get a mapped 186 188 # AC for this test ... 187 self.sm = self.test6GetAttCert UsingSessID()188 189 aaURI = self.cfg.get('test6bGetMappedAttCert UsingSessID', 'aauri')189 self.sm = self.test6GetAttCertWithSessID() 190 191 aaURI = self.cfg.get('test6bGetMappedAttCertWithSessID', 'aauri') 190 192 191 193 attCert, errMsg, extAttCertList=self.sm.getAttCert(sessID=self.sessID, … … 198 200 199 201 200 def test6cGetAttCertWithExtAttCertList UsingSessID(self):201 """test6cGetAttCert UsingSessID: make an attribute request using202 def test6cGetAttCertWithExtAttCertListWithSessID(self): 203 """test6cGetAttCertWithSessID: make an attribute request using 202 204 a session ID as authentication credential""" 203 205 204 206 print "\n\t" + \ 205 self.test6cGetAttCertWithExtAttCertList UsingSessID.__doc__207 self.test6cGetAttCertWithExtAttCertListWithSessID.__doc__ 206 208 self.test1Connect() 207 209 208 210 aaURI = \ 209 self.cfg.get('test6cGetAttCertWithExtAttCertList UsingSessID', 'aauri')210 211 # Use output from test6GetAttCert UsingSessID!211 self.cfg.get('test6cGetAttCertWithExtAttCertListWithSessID', 'aauri') 212 213 # Use output from test6GetAttCertWithSessID! 212 214 extACFilePath = \ 213 self.cfg.get('test6cGetAttCertWithExtAttCertList UsingSessID', 'extacfilepath')215 self.cfg.get('test6cGetAttCertWithExtAttCertListWithSessID', 'extacfilepath') 214 216 extAttCert = open(extACFilePath).read() 215 217 … … 223 225 224 226 225 def test7GetAttCert UsingProxyCert(self):226 """test7GetAttCert UsingProxyCert: make an attribute request using227 a proxycert as authentication credential"""228 print "\n\t" + self.test7GetAttCert UsingProxyCert.__doc__227 def test7GetAttCertWithUserCert(self): 228 """test7GetAttCertWithUserCert: make an attribute request using 229 a user cert as authentication credential""" 230 print "\n\t" + self.test7GetAttCertWithUserCert.__doc__ 229 231 self.test1Connect() 230 232 231 233 # Request an attribute certificate from an Attribute Authority 232 # using the proxyCert returned from connect()233 234 aaURI = self.cfg.get('test7GetAttCert UsingProxyCert', 'aauri')234 # using the userCert returned from connect() 235 236 aaURI = self.cfg.get('test7GetAttCertWithUserCert', 'aauri') 235 237 attCert, errMsg, extAttCertList = self.sm.getAttCert(\ 236 userCert=self. proxyCert, aaURI=aaURI)238 userCert=self.userCert, aaURI=aaURI) 237 239 if errMsg: 238 240 self.fail(errMsg) … … 250 252 "test2GetSessionStatus", 251 253 "test3ConnectNoCreateServerSess", 252 "test4Disconnect UsingSessID",253 "test5Disconnect UsingProxyCert",254 "test6GetAttCert UsingSessID",255 "test6bGetMappedAttCert UsingSessID",256 "test6cGetAttCertWithExtAttCertList UsingSessID",257 "test7GetAttCert UsingProxyCert",254 "test4DisconnectWithSessID", 255 "test5DisconnectWithUserCert", 256 "test6GetAttCertWithSessID", 257 "test6bGetMappedAttCertWithSessID", 258 "test6cGetAttCertWithExtAttCertListWithSessID", 259 "test7GetAttCertWithUserCert", 258 260 )) 259 261 unittest.TestSuite.__init__(self, map)
Note: See TracChangeset
for help on using the changeset viewer.