Ejemplo n.º 1
0
        internal bool Verify(SecureFSInode inode)
        {
            Contract.Requires(CurrentState == State.Encrypted);
            Contract.Ensures(!Contract.Result<bool>() || CurrentState == State.Verified);
            Contract.Ensures(Contract.Result<bool>() || CurrentState == Contract.OldValue(CurrentState));
            Contract.Ensures(Next == Contract.OldValue(Next));

            var r = inode.VerifyPage(this);
            if (r)
            {
                CurrentState = State.Verified;
            }
            return r;
        }
Ejemplo n.º 2
0
        internal bool Load(SecureFSInode inode)
        {
            Contract.Requires(CurrentState == State.Empty);
            Contract.Ensures(Next == Contract.OldValue(Next));
            Contract.Ensures(!Contract.Result<bool>() || CurrentState == State.Decrypted);

            inode.LoadPageRaw(this);

            if (!Verify(inode))
                return false;

            Decrypt();
            return true;
        }