[pywin32-checkins] pywin32/win32/Lib sspi.py,1.2,1.3
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2006-02-13 14:47:31
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19357/win32/Lib Modified Files: sspi.py Log Message: Use more consistent naming conventions for SSPI type objects Index: sspi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/sspi.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sspi.py 7 Mar 2005 11:16:19 -0000 1.2 --- sspi.py 13 Feb 2006 14:47:20 -0000 1.3 *************** *** 50,56 **** trailersize=pkg_size_info['SecurityTrailer'] ! encbuf=win32security.SecBufferDescType() ! encbuf.append(win32security.SecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.SecBufferType(trailersize, sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=data self.ctxt.EncryptMessage(0,encbuf,self._get_next_seq_num()) --- 50,56 ---- trailersize=pkg_size_info['SecurityTrailer'] ! encbuf=win32security.PySecBufferDescType() ! encbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.PySecBufferType(trailersize, sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=data self.ctxt.EncryptMessage(0,encbuf,self._get_next_seq_num()) *************** *** 59,65 **** def decrypt(self, data, trailer): """Decrypt a previously encrypted string, returning the orignal data""" ! encbuf=win32security.SecBufferDescType() ! encbuf.append(win32security.SecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.SecBufferType(len(trailer), sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=data encbuf[1].Buffer=trailer --- 59,65 ---- def decrypt(self, data, trailer): """Decrypt a previously encrypted string, returning the orignal data""" ! encbuf=win32security.PySecBufferDescType() ! encbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! encbuf.append(win32security.PySecBufferType(len(trailer), sspicon.SECBUFFER_TOKEN)) encbuf[0].Buffer=data encbuf[1].Buffer=trailer *************** *** 74,80 **** pkg_size_info=self.ctxt.QueryContextAttributes(sspicon.SECPKG_ATTR_SIZES) sigsize=pkg_size_info['MaxSignature'] ! sigbuf=win32security.SecBufferDescType() ! sigbuf.append(win32security.SecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.SecBufferType(sigsize, sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=data --- 74,80 ---- pkg_size_info=self.ctxt.QueryContextAttributes(sspicon.SECPKG_ATTR_SIZES) sigsize=pkg_size_info['MaxSignature'] ! sigbuf=win32security.PySecBufferDescType() ! sigbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.PySecBufferType(sigsize, sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=data *************** *** 86,92 **** will be raised. """ ! sigbuf=win32security.SecBufferDescType() ! sigbuf.append(win32security.SecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.SecBufferType(len(sig), sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=data --- 86,92 ---- will be raised. """ ! sigbuf=win32security.PySecBufferDescType() ! sigbuf.append(win32security.PySecBufferType(len(data), sspicon.SECBUFFER_DATA)) ! sigbuf.append(win32security.PySecBufferType(len(sig), sspicon.SECBUFFER_TOKEN)) sigbuf[0].Buffer=data *************** *** 120,138 **** # Perform *one* step of the client authentication process. def authorize(self, sec_buffer_in): ! if sec_buffer_in is not None and type(sec_buffer_in) != win32security.SecBufferDescType: # User passed us the raw data - wrap it into a SecBufferDesc ! sec_buffer_new=win32security.SecBufferDescType() ! tokenbuf=win32security.SecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) tokenbuf.Buffer=sec_buffer_in sec_buffer_new.append(tokenbuf) sec_buffer_in = sec_buffer_new ! sec_buffer_out=win32security.SecBufferDescType() ! tokenbuf=win32security.SecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) sec_buffer_out.append(tokenbuf) ## input context handle should be NULL on first call ctxtin=self.ctxt if self.ctxt is None: ! self.ctxt=win32security.CtxtHandleType() err, attr, exp=win32security.InitializeSecurityContext( self.credentials, --- 120,138 ---- # Perform *one* step of the client authentication process. def authorize(self, sec_buffer_in): ! if sec_buffer_in is not None and type(sec_buffer_in) != win32security.PySecBufferDescType: # User passed us the raw data - wrap it into a SecBufferDesc ! sec_buffer_new=win32security.PySecBufferDescType() ! tokenbuf=win32security.PySecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) tokenbuf.Buffer=sec_buffer_in sec_buffer_new.append(tokenbuf) sec_buffer_in = sec_buffer_new ! sec_buffer_out=win32security.PySecBufferDescType() ! tokenbuf=win32security.PySecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) sec_buffer_out.append(tokenbuf) ## input context handle should be NULL on first call ctxtin=self.ctxt if self.ctxt is None: ! self.ctxt=win32security.PyCtxtHandleType() err, attr, exp=win32security.InitializeSecurityContext( self.credentials, *************** *** 181,188 **** # Perform *one* step of the server authentication process. def authorize(self, sec_buffer_in): ! if sec_buffer_in is not None and type(sec_buffer_in) != win32security.SecBufferDescType: # User passed us the raw data - wrap it into a SecBufferDesc ! sec_buffer_new=win32security.SecBufferDescType() ! tokenbuf=win32security.SecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) tokenbuf.Buffer=sec_buffer_in --- 181,188 ---- # Perform *one* step of the server authentication process. def authorize(self, sec_buffer_in): ! if sec_buffer_in is not None and type(sec_buffer_in) != win32security.PySecBufferDescType: # User passed us the raw data - wrap it into a SecBufferDesc ! sec_buffer_new=win32security.PySecBufferDescType() ! tokenbuf=win32security.PySecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) tokenbuf.Buffer=sec_buffer_in *************** *** 190,200 **** sec_buffer_in = sec_buffer_new ! sec_buffer_out=win32security.SecBufferDescType() ! tokenbuf=win32security.SecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) sec_buffer_out.append(tokenbuf) ## input context handle is None initially, then handle returned from last call thereafter ctxtin=self.ctxt if self.ctxt is None: ! self.ctxt=win32security.CtxtHandleType() err, attr, exp = win32security.AcceptSecurityContext(self.credentials, ctxtin, sec_buffer_in, self.scflags, --- 190,200 ---- sec_buffer_in = sec_buffer_new ! sec_buffer_out=win32security.PySecBufferDescType() ! tokenbuf=win32security.PySecBufferType(self.pkg_info['MaxToken'], sspicon.SECBUFFER_TOKEN) sec_buffer_out.append(tokenbuf) ## input context handle is None initially, then handle returned from last call thereafter ctxtin=self.ctxt if self.ctxt is None: ! self.ctxt=win32security.PyCtxtHandleType() err, attr, exp = win32security.AcceptSecurityContext(self.credentials, ctxtin, sec_buffer_in, self.scflags, |