Esempio n. 1
0
    def test_parse_with_empty_data(self):
        parser = Parser(bytearray(0))

        ext = SignatureAlgorithmsExtension()

        ext.parse(parser)

        self.assertIsNone(ext.sigalgs)
    def test_parse_with_empty_data(self):
        parser = Parser(bytearray(0))

        ext = SignatureAlgorithmsExtension()

        ext.parse(parser)

        self.assertIsNone(ext.sigalgs)
Esempio n. 3
0
    def test_parse_with_extra_data_at_end(self):
        parser = Parser(
            bytearray(b'\x00\x02' +  # array length
                      b'\x04\x01' +  # SHA256+RSA
                      b'\xff\xff'))  # padding

        ext = SignatureAlgorithmsExtension()

        with self.assertRaises(SyntaxError):
            ext.parse(parser)
    def test_parse_with_extra_data_at_end(self):
        parser = Parser(bytearray(
            b'\x00\x02' +           # array length
            b'\x04\x01' +           # SHA256+RSA
            b'\xff\xff'))           # padding

        ext = SignatureAlgorithmsExtension()

        with self.assertRaises(SyntaxError):
            ext.parse(parser)