aboutsummaryrefslogtreecommitdiffstats
path: root/target
Commit message (Expand)AuthorAgeFilesLines
* [amazon] Update to kernel 2.6.30Hauke Mehrtens2009-11-291-1/+1
* [amazon] Read the size of the available memory from parameters passed to the ...Hauke Mehrtens2009-11-292-7/+23
* kernel: move CONFIG_MIPS_FPU_EMU to generic kernel configFelix Fietkau2009-11-2922-16/+6
* ar71xx: mask out reserved bits from the dma tx status in the ethernet driverFelix Fietkau2009-11-291-6/+13
* ar71xx: add usb support for ubnt rocket mFelix Fietkau2009-11-294-3/+53
* [brcm47xx] Remove patches already applied in generic and refresh patches.Hauke Mehrtens2009-11-296-844/+13
* [ubicom32] add missing configuration symbolsFlorian Fainelli2009-11-291-0/+2
* [kernel] revert the 027-mips_module_reloc.patch patch for mips64 targets unti...Florian Fainelli2009-11-293-0/+1005
* [kernel] Some build fixes.Hauke Mehrtens2009-11-283-1/+185
* [amazon] Add kernel 2.6.30 supportHauke Mehrtens2009-11-2816-0/+585
* [amazon] Some general changes for amazon drivers.Hauke Mehrtens2009-11-284-42/+43
* ar71xx: fix mac address for 5GHz interface on WNDR3700Gabor Juhos2009-11-281-5/+9
* ar71xx: update ath9k_platform.hGabor Juhos2009-11-281-0/+1
* ar71xx: fix extension of the WNDR3700 firmware imageGabor Juhos2009-11-281-1/+1
* ar71xx: override mtd partitions for the TEW-632BRP familyGabor Juhos2009-11-281-5/+6
* [rdc] add sitecom subtarget after the profiles->subtargets conversion (#6245)Florian Fainelli2009-11-284-4/+9
* ar71xx: create images for the WNDR3700, which can be flashed via the factory ...Gabor Juhos2009-11-281-0/+4
* ar71xx: create sysupgrade image for the WNDR3700Gabor Juhos2009-11-282-0/+52
* ar71xx: fix a typo in ar71xx.shGabor Juhos2009-11-281-1/+1
* ar71xx: add default network configuration file for the WNDR3700Gabor Juhos2009-11-271-0/+16
* ar71xx: add PCI fixup for the WNDR3700 boardGabor Juhos2009-11-271-0/+77
* ar71xx: fix pll_1000 values for the WNDR3700Gabor Juhos2009-11-271-0/+2
* ar71xx: add AR724x GPIO_FUNC register bit definesGabor Juhos2009-11-271-0/+18
* ar71xx: fix AR724X_GPIO_COUNTGabor Juhos2009-11-271-1/+1
* ar71xx: add AR724x register definesGabor Juhos2009-11-271-0/+2
* [ep93xx] target supports usbFlorian Fainelli2009-11-261-1/+1
* [ep93xx] resync kernel configurationFlorian Fainelli2009-11-261-32/+1
* [ep93xx] add support for the Simplemachines Sim.One boardFlorian Fainelli2009-11-2516-0/+20547
* [kernel] refresh 2.6.25 patchesFlorian Fainelli2009-11-251-1/+1
* [octeon] resync kernel configurationFlorian Fainelli2009-11-251-24/+24
* ar71xx: rename TL-WRx41 images, because newer factory web interface doesGabor Juhos2009-11-251-1/+1
* ar71xx: use MkImageLzma template for Ubiquiti XM devicesGabor Juhos2009-11-251-5/+1
* ar71xx: add sysupgrade support for Ubiquiti XM boardsGabor Juhos2009-11-252-3/+7
* ar71xx: enable failsafe on the Nanostation M/Rocket MGabor Juhos2009-11-252-1/+7
* ar71xx: create combined images for the RS, RS-PRO and LS-SR71 boards, and add...Gabor Juhos2009-11-252-2/+93
* ar71xx: dont't build images for Ubiquiti XM devices with the Madwifi profileGabor Juhos2009-11-251-1/+3
* ar71xx: the squashfs-4k images are unreliable in some builds. add 4k, 8k padd...Felix Fietkau2009-11-241-4/+2
* kernel: add missing config symbols for kernel debuggingFelix Fietkau2009-11-243-0/+6
* ar71xx: use 4k erase size images for ubnt xmFelix Fietkau2009-11-231-1/+1
* [brcm47xx] add missing CONFIG_MIPS_FPU_EMU to kernel configJo-Philipp Wich2009-11-222-0/+2
* [brcm63xx] add support for the RTA1025W_16 board (#5979)Florian Fainelli2009-11-221-0/+17
* [x86] remove obsolete 2.6.28 config & empty patches dirNicolas Thill2009-11-221-392/+0
* use CONFIG_EMBEDDED for x86, tooImre Kaloz2009-11-211-1/+2
* add more symbols to the generic configImre Kaloz2009-11-212-1/+15
* do not use the wrapper scripts for exportable toolchains internally. on some ...Felix Fietkau2009-11-192-0/+101
* ar71xx: build images for ubnt bullet-m, rocket-m and nano-mFelix Fietkau2009-11-181-0/+43
* ar71xx: use a separate board id for rocket mFelix Fietkau2009-11-183-5/+10
* ar71xx: enable command-line mtd map parsingFelix Fietkau2009-11-183-0/+3
* ar71xx: add Ubiquiti Rocket M and Nanostation M supportMatteo Croce2009-11-183-33/+55
* fix grub image target dependencyImre Kaloz2009-11-181-1/+1
class="n">raises_unsupported_algorithm @utils.register_interface(CipherBackend) class DummyCipherBackend(object): def __init__(self, supported_ciphers): self._ciphers = supported_ciphers def cipher_supported(self, algorithm, mode): return (type(algorithm), type(mode)) in self._ciphers def create_symmetric_encryption_ctx(self, algorithm, mode): if not self.cipher_supported(algorithm, mode): raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_CIPHER) def create_symmetric_decryption_ctx(self, algorithm, mode): if not self.cipher_supported(algorithm, mode): raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_CIPHER) @utils.register_interface(HashBackend) class DummyHashBackend(object): def __init__(self, supported_algorithms): self._algorithms = supported_algorithms def hash_supported(self, algorithm): return type(algorithm) in self._algorithms def create_hash_ctx(self, algorithm): if not self.hash_supported(algorithm): raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_HASH) @utils.register_interface(HMACBackend) class DummyHMACBackend(object): def __init__(self, supported_algorithms): self._algorithms = supported_algorithms def hmac_supported(self, algorithm): return type(algorithm) in self._algorithms def create_hmac_ctx(self, key, algorithm): if not self.hmac_supported(algorithm): raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_HASH) @utils.register_interface(PBKDF2HMACBackend) class DummyPBKDF2HMACBackend(object): def __init__(self, supported_algorithms): self._algorithms = supported_algorithms def pbkdf2_hmac_supported(self, algorithm): return type(algorithm) in self._algorithms def derive_pbkdf2_hmac(self, algorithm, length, salt, iterations, key_material): if not self.pbkdf2_hmac_supported(algorithm): raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_HASH) @utils.register_interface(RSABackend) class DummyRSABackend(object): def generate_rsa_private_key(self, public_exponent, private_key): pass def create_rsa_signature_ctx(self, private_key, padding, algorithm): pass def create_rsa_verification_ctx(self, public_key, signature, padding, algorithm): pass def mgf1_hash_supported(self, algorithm): pass def rsa_padding_supported(self, padding): pass def generate_rsa_parameters_supported(self, public_exponent, key_size): pass def decrypt_rsa(self, private_key, ciphertext, padding): pass def encrypt_rsa(self, public_key, plaintext, padding): pass @utils.register_interface(DSABackend) class DummyDSABackend(object): def generate_dsa_parameters(self, key_size): pass def generate_dsa_private_key(self, parameters): pass def create_dsa_signature_ctx(self, private_key, algorithm): pass def create_dsa_verification_ctx(self, public_key, signature, algorithm): pass def dsa_hash_supported(self, algorithm): pass def dsa_parameters_supported(self, p, q, g): pass @utils.register_interface(CMACBackend) class DummyCMACBackend(object): def __init__(self, supported_algorithms): self._algorithms = supported_algorithms def cmac_algorithm_supported(self, algorithm): return type(algorithm) in self._algorithms def create_cmac_ctx(self, algorithm): if not self.cmac_algorithm_supported(algorithm): raise UnsupportedAlgorithm("", _Reasons.UNSUPPORTED_CIPHER) class TestMultiBackend(object): def test_ciphers(self): backend = MultiBackend([ DummyHashBackend([]), DummyCipherBackend([ (algorithms.AES, modes.CBC), ]) ]) assert backend.cipher_supported( algorithms.AES(b"\x00" * 16), modes.CBC(b"\x00" * 16) ) cipher = Cipher( algorithms.AES(b"\x00" * 16), modes.CBC(b"\x00" * 16), backend=backend ) cipher.encryptor() cipher.decryptor() cipher = Cipher( algorithms.Camellia(b"\x00" * 16), modes.CBC(b"\x00" * 16), backend=backend ) with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.encryptor() with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cipher.decryptor() def test_hashes(self): backend = MultiBackend([ DummyHashBackend([hashes.MD5]) ]) assert backend.hash_supported(hashes.MD5()) hashes.Hash(hashes.MD5(), backend=backend) with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_HASH): hashes.Hash(hashes.SHA1(), backend=backend) def test_hmac(self): backend = MultiBackend([ DummyHMACBackend([hashes.MD5]) ]) assert backend.hmac_supported(hashes.MD5()) hmac.HMAC(b"", hashes.MD5(), backend=backend) with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_HASH): hmac.HMAC(b"", hashes.SHA1(), backend=backend) def test_pbkdf2(self): backend = MultiBackend([ DummyPBKDF2HMACBackend([hashes.MD5]) ]) assert backend.pbkdf2_hmac_supported(hashes.MD5()) backend.derive_pbkdf2_hmac(hashes.MD5(), 10, b"", 10, b"") with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_HASH): backend.derive_pbkdf2_hmac(hashes.SHA1(), 10, b"", 10, b"") def test_rsa(self): backend = MultiBackend([ DummyRSABackend() ]) backend.generate_rsa_private_key( key_size=1024, public_exponent=65537 ) backend.create_rsa_signature_ctx("private_key", padding.PKCS1v15(), hashes.MD5()) backend.create_rsa_verification_ctx("public_key", "sig", padding.PKCS1v15(), hashes.MD5()) backend.mgf1_hash_supported(hashes.MD5()) backend.rsa_padding_supported(padding.PKCS1v15()) backend.generate_rsa_parameters_supported(65537, 1024) backend.encrypt_rsa("public_key", "encryptme", padding.PKCS1v15()) backend.decrypt_rsa("private_key", "encrypted", padding.PKCS1v15()) backend = MultiBackend([]) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.generate_rsa_private_key(key_size=1024, public_exponent=3) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.create_rsa_signature_ctx("private_key", padding.PKCS1v15(), hashes.MD5()) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.create_rsa_verification_ctx( "public_key", "sig", padding.PKCS1v15(), hashes.MD5()) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.mgf1_hash_supported(hashes.MD5()) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.rsa_padding_supported(padding.PKCS1v15()) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.generate_rsa_parameters_supported(65537, 1024) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.encrypt_rsa("public_key", "encryptme", padding.PKCS1v15()) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.decrypt_rsa("private_key", "encrypted", padding.PKCS1v15()) def test_dsa(self): backend = MultiBackend([ DummyDSABackend() ]) backend.generate_dsa_parameters(key_size=1024) parameters = object() backend.generate_dsa_private_key(parameters) backend.create_dsa_verification_ctx("public_key", "sig", hashes.SHA1()) backend.create_dsa_signature_ctx("private_key", hashes.SHA1()) backend.dsa_hash_supported(hashes.SHA1()) backend.dsa_parameters_supported(1, 2, 3) backend = MultiBackend([]) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.generate_dsa_parameters(key_size=1024) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.generate_dsa_private_key(parameters) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.create_dsa_signature_ctx("private_key", hashes.SHA1()) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.create_dsa_verification_ctx( "public_key", b"sig", hashes.SHA1() ) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.dsa_hash_supported(hashes.SHA1()) with raises_unsupported_algorithm( _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM ): backend.dsa_parameters_supported('p', 'q', 'g') def test_cmac(self): backend = MultiBackend([ DummyCMACBackend([algorithms.AES]) ]) fake_key = b"\x00" * 16 assert backend.cmac_algorithm_supported( algorithms.AES(fake_key)) is True cmac.CMAC(algorithms.AES(fake_key), backend) with raises_unsupported_algorithm(_Reasons.UNSUPPORTED_CIPHER): cmac.CMAC(algorithms.TripleDES(fake_key), backend)