Skip to content

EncryptDecrypt_Read failed with "There are no EFS keys defined for the user" #56945

Closed

Description

@danmoseley

This previously passed on this machine, but today it's consistently failing. Not sure what's changed or how to investigate.

    <collection total="2" passed="1" failed="1" skipped="0" name="Test collection for System.IO.Tests.EncryptDecrypt" time="1.075">
      <test name="System.IO.Tests.EncryptDecrypt.EncryptDecrypt_Read" type="System.IO.Tests.EncryptDecrypt" method="EncryptDecrypt_Read" time="1.0744169" result="Fail">
        <failure exception-type="System.IO.IOException">
          <message><![CDATA[System.IO.IOException : There are no EFS keys defined for the user. : 'C:\\Users\\danmose\\AppData\\Local\\Temp\\tmpE073.tmp']]></message>
          <stack-trace><![CDATA[   at System.IO.FileSystem.ThrowExceptionEncryptDecryptFail(String fullPath) in C:\git\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Win32.cs:line 59
   at System.IO.FileSystem.Encrypt(String path) in C:\git\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Win32.cs:line 23
   at System.IO.File.Encrypt(String path) in C:\git\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs:line 606
   at System.IO.Tests.EncryptDecrypt.EncryptDecrypt_Read() in C:\git\runtime\src\libraries\System.IO.FileSystem\tests\File\EncryptDecrypt.cs:line 44]]></stack-trace>

Configuration\Administrative Templates\System\Filesystem\NTFS\Do not allow encryption on all NTFS volumes is set to default (false) and the EFS checkboxes are enabled and fsutil behavior query disableEncryption returns DisableEncryption = 0 (Disabled) which I believe means it should work.

I tried cipher /k to create a cert but I get "Element not found."

Also if I try to encrypt through explorer I get "Element not found." tests expect this:

// Ignore ERROR_NOT_FOUND 1168 (0x490). It is reported when EFS is disabled by domain policy.

Instead ::EncryptFile(..) is failing with ERROR_NO_USER_KEYS so the test is failing.

Recording this here in case it happens to others but I'm going to assume for now there's something messed up with my box.

Activity

  1. added this to the Future milestone on Aug 6, 2021
  2. ghost added
    untriaged
    on Aug 6, 2021
  3. removed
    untriaged
    on Aug 6, 2021
  4. danmoseley commented on Aug 9, 2021

    @danmoseley
    ContributorAuthor

    I'm going to close this unless and until someone has more info or ideas that suggest it's not specific to my machine.

  5. ghost locked as resolved and limited conversation to collaborators on Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions