コード例 #1
0
ファイル: symcrypto_test.py プロジェクト: ztm1992/charm
 def testTamperAlg(self):
     key = sha1(PairingGroup('SS512').random(GT))
     m = MessageAuthenticator(key)
     a = m.mac('hello world')
     m1 = MessageAuthenticator(key)
     m1._algorithm = "alg"  # bypassing the algorithm check to verify the mac is over the alg + data
     a["alg"] = "alg"
     assert not m1.verify(a), "expected message to verify"
コード例 #2
0
ファイル: symcrypto_test.py プロジェクト: FinalF/charm
 def testTamperAlg(self):
     key = sha1(PairingGroup('SS512').random(GT))
     m = MessageAuthenticator(key)
     a = m.mac('hello world')
     m1 = MessageAuthenticator(key)
     m1._algorithm = "alg" # bypassing the algorithm check to verify the mac is over the alg + data 
     a["alg"]= "alg" 
     assert not m1.verify(a), "expected message to verify";