Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Mar 31st, 2020 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func TestCorruptingMagicString(t *testing.T) {
  2.     clear()
  3.     u1, _ := InitUser("u1", "pass")
  4.     u2, _ := InitUser("u2", "pass1")
  5.     f1 := []byte("content")
  6.     u1.StoreFile("f1", f1)
  7.     access_token, err1 := u1.ShareFile("f1", "u2")
  8.     if err1 != nil {
  9.         t.Error("Couldn't share file")
  10.         return
  11.     }
  12.     corrupt_token := access_token + "random_string"
  13.     err2 := u2.ReceiveFile("newFile", "u1", corrupt_token)
  14.     if err2 == nil {
  15.         t.Error("Didn't detect corrupt access_token")
  16.         return
  17.     }
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top