return int(time.time())
-def string_to_byte_array(string):
- return [c if isinstance(c, int) else ord(c) for c in string]
-
-
def arcfour_encrypt(key, data):
from samba.crypto import arcfour_crypt_blob
return arcfour_crypt_blob(data, key)
import ldb
import os
import samba
-from samba import arcfour_encrypt, string_to_byte_array
+from samba import arcfour_encrypt
from samba.tests import TestCase, TestCaseInTempDir
self.assertEqual(crypt_expected, crypt_calculated)
-class StringToByteArrayTestCase(TestCase):
-
- def test_byte_array(self):
- expected = [218, 145, 90, 176, 108, 215, 185, 207, 153]
- calculated = string_to_byte_array('\xda\x91Z\xb0l\xd7\xb9\xcf\x99')
- self.assertEqual(expected, calculated)
-
-
class LdbExtensionTests(TestCaseInTempDir):
def test_searchone(self):