コード例 #1
0
 def testI01SingleSlice(self):
     "slice_msg_str() single packet, first message: 0[1]"
     key_d = read_test_file(['pgpfiles', 'key', 'DSAELG_1_and_3.pub.asc'])
     slice_d = "0[1]"  # first message, second packet is a user ID
     pkts = slice_msg_str(key_d, slice_d)
     armored_pkts = sap_out(pkts, None, True)  # check funky armoring
     l = []
     players = list_players(armored_pkts[0]['data'], None, leftovers=l)
     self.assertEqual(pkts[0].rawstr(), l[0].rawstr())
コード例 #2
0
 def testI01SingleSlice(self):
     "slice_msg_str() single packet, first message: 0[1]" 
     key_d = read_test_file(['pgpfiles','key','DSAELG_1_and_3.pub.asc'])
     slice_d = "0[1]" # first message, second packet is a user ID
     pkts = slice_msg_str(key_d, slice_d)
     armored_pkts = sap_out(pkts, None, True) # check funky armoring
     l = []
     players = list_players(armored_pkts[0]['data'], None, leftovers=l)
     self.assertEqual(pkts[0].rawstr(), l[0].rawstr())
コード例 #3
0
 def testI02MultipleSlice(self):
     "slice_msg_str() multiple packets, second message: 1[2:4]"
     key_d = read_test_file(['pgpfiles', 'key', 'DSAELG_1_and_3.pub.asc'])
     slice_d = "1[2:4]"  # second message, third and fourth packets
     pkts = slice_msg_str(key_d, slice_d)
     armored_pkts = sap_out(pkts, None, True)  # check funky armoring
     l = []
     players = list_players(armored_pkts[0]['data'], None, leftover=l)
     self.assertEqual(pkts[0].rawstr(), l[0].rawstr())
     self.assertEqual(pkts[1].rawstr(), l[1].rawstr())
コード例 #4
0
 def testI02MultipleSlice(self):
     "slice_msg_str() multiple packets, second message: 1[2:4]" 
     key_d = read_test_file(['pgpfiles','key','DSAELG_1_and_3.pub.asc'])
     slice_d = "1[2:4]" # second message, third and fourth packets
     pkts = slice_msg_str(key_d, slice_d)
     armored_pkts = sap_out(pkts, None, True) # check funky armoring
     l = []
     players = list_players(armored_pkts[0]['data'], None, leftover=l)
     self.assertEqual(pkts[0].rawstr(), l[0].rawstr())
     self.assertEqual(pkts[1].rawstr(), l[1].rawstr())
コード例 #5
0
 def testI03LeftoverSlice(self):
     "slice_msg_str() single leftover packet: L[0]" 
     key_d = read_test_file(['pgpfiles','key','DSAELG1.primary_revoc_cert.asc'])
     slice_d = "L[0]" # first leftover packet (detached signature) 
     pkts = slice_msg_str(key_d, slice_d)
     print pkts
     armored_pkts = sap_out(pkts, None, True) # check funky armoring
     l = []
     players = list_players(armored_pkts[0]['data'], None, leftovers=l)
     print players, l
     self.assertEqual(pkts[0].rawstr(), l[0].rawstr())
コード例 #6
0
 def testI03LeftoverSlice(self):
     "slice_msg_str() single leftover packet: L[0]"
     key_d = read_test_file(
         ['pgpfiles', 'key', 'DSAELG1.primary_revoc_cert.asc'])
     slice_d = "L[0]"  # first leftover packet (detached signature)
     pkts = slice_msg_str(key_d, slice_d)
     print pkts
     armored_pkts = sap_out(pkts, None, True)  # check funky armoring
     l = []
     players = list_players(armored_pkts[0]['data'], None, leftovers=l)
     print players, l
     self.assertEqual(pkts[0].rawstr(), l[0].rawstr())