Beispiel #1
0
 def bad_secure_data(data, cred):
     # Mess up gss_seq_num
     gss_cred = c.security._gss_cred_from_opaque_auth(cred)
     gss_cred.seq_num += 1
     p = c.security.getpacker()
     p.reset()
     p.pack_rpc_gss_cred_t(rpc_gss_cred_t(1, gss_cred))
     return orig_funct(data, rpc.opaque_auth(6, p.get_buffer()))
Beispiel #2
0
 def bad_secure_data(data, cred):
     # Mess up gss_seq_num
     gss_cred = c.security._gss_cred_from_opaque_auth(cred)
     gss_cred.seq_num += 1
     p = c.security.getpacker()
     p.reset()
     p.pack_rpc_gss_cred_t(rpc_gss_cred_t(1, gss_cred))
     return orig_funct(data, rpc.opaque_auth(6, p.get_buffer()))
Beispiel #3
0
 def make_cred(self):
     # We copy code so "self" refers here, not to self.__sec
     # There's got to be a better way to do this
     if self.init == 1: # first call in context creation
         cred = self._make_cred_gss('', rpc_gss_svc_none, RPCSEC_GSS_INIT)
     elif self.init > 1: # subsequent calls in context creation
         cred = self._make_cred_gss('', rpc_gss_svc_none,
                               RPCSEC_GSS_CONTINUE_INIT)
     else: # data transfer calls
         self.lock.acquire()
         self.gss_seq_num += 1 # FRED - check for overflow
         self.lock.release()
         cred = self._make_cred_gss(self.gss_handle, self.service,
                                    seq=self.gss_seq_num)
     return rpc.opaque_auth(RPCSEC_GSS, cred)
Beispiel #4
0
 def make_cred(self):
     # We copy code so "self" refers here, not to self.__sec
     # There's got to be a better way to do this
     if self.init == 1:  # first call in context creation
         cred = self._make_cred_gss('', rpc_gss_svc_none, RPCSEC_GSS_INIT)
     elif self.init > 1:  # subsequent calls in context creation
         cred = self._make_cred_gss('', rpc_gss_svc_none,
                                    RPCSEC_GSS_CONTINUE_INIT)
     else:  # data transfer calls
         self.lock.acquire()
         self.gss_seq_num += 1  # FRED - check for overflow
         self.lock.release()
         cred = self._make_cred_gss(self.gss_handle,
                                    self.service,
                                    seq=self.gss_seq_num)
     return rpc.opaque_auth(RPCSEC_GSS, cred)