Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-SecretInfo : Exception calling "GetInstance" with "0" argument(s): "Padding is invalid and cannot be removed." #210

Open
3 tasks done
akselbork opened this issue Mar 20, 2023 · 0 comments

Comments

@akselbork
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues.

Steps to reproduce

When I try to get the vault information to get my secrets it give me multiple errors

Expected behavior

Should give me information an which secrets is in each vault

Actual behavior

I ♥ PS > Get-SecretInfo
Get-SecretInfo : Exception calling "GetInstance" with "0" argument(s): "Padding is invalid and cannot be removed."
At line:1 char:1
+ Get-SecretInfo
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-SecretInfo], MethodInvocationException
    + FullyQualifiedErrorId : CryptographicException,Microsoft.PowerShell.SecretManagement.GetSecretInfoCommand

Get-SecretInfo : Exception calling "GetInstance" with "0" argument(s): "Padding is invalid and cannot be removed."
At line:1 char:1
+ Get-SecretInfo
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-SecretInfo], MethodInvocationException
    + FullyQualifiedErrorId : CryptographicException,Microsoft.PowerShell.SecretManagement.GetSecretInfoCommand

Get-SecretInfo : Exception calling "GetInstance" with "0" argument(s): "Padding is invalid and cannot be removed."
At line:1 char:1
+ Get-SecretInfo
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-SecretInfo], MethodInvocationException
    + FullyQualifiedErrorId : CryptographicException,Microsoft.PowerShell.SecretManagement.GetSecretInfoCommand

Get-SecretInfo : Exception calling "GetInstance" with "0" argument(s): "Padding is invalid and cannot be removed."
At line:1 char:1
+ Get-SecretInfo
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-SecretInfo], MethodInvocationException
    + FullyQualifiedErrorId : CryptographicException,Microsoft.PowerShell.SecretManagement.GetSecretInfoCommand

Get-SecretInfo : Exception calling "GetInstance" with "0" argument(s): "Padding is invalid and cannot be removed."
At line:1 char:1
+ Get-SecretInfo
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-SecretInfo], MethodInvocationException
    + FullyQualifiedErrorId : CryptographicException,Microsoft.PowerShell.SecretManagement.GetSecretInfoCommand

Get-SecretInfo : Exception calling "GetInstance" with "0" argument(s): "Padding is invalid and cannot be removed."
At line:1 char:1
+ Get-SecretInfo
+ ~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-SecretInfo], MethodInvocationException
    + FullyQualifiedErrorId : CryptographicException,Microsoft.PowerShell.SecretManagement.GetSecretInfoCommand

Error details

I ♥ PS > $error[0] | fl * -Force


writeErrorStream      : True
PSMessageDetails      :
Exception             : System.Management.Automation.MethodInvocationException: Exception calling "GetInstance" with "0" argument(s): "Padding is invalid and cannot be removed." ---> System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
                           at System.Security.Cryptography.CapiSymmetricAlgorithm.DepadBlock(Byte[] block, Int32 offset, Int32 count)
                           at System.Security.Cryptography.CapiSymmetricAlgorithm.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
                           at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
                           at System.Security.Cryptography.CryptoStream.Dispose(Boolean disposing)
                           at System.IO.Stream.Close()
                           at Microsoft.PowerShell.SecretStore.CryptoUtils.DecryptWithKey(SecureString passWord, AesKey key, Byte[] data)
                           at Microsoft.PowerShell.SecretStore.SecureStoreFile.ReadConfigFile(SecureStoreConfig& configData, String& errorMsg)
                           at Microsoft.PowerShell.SecretStore.SecureStore.GetStore(SecureString password)
                           at Microsoft.PowerShell.SecretStore.LocalSecretStore.GetInstance(SecureString password, PSCmdlet cmdlet)
                           at CallSite.Target(Closure , CallSite , Type )
                           --- End of inner exception stack trace ---
                           at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
                           at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
                           at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
                           at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
                           at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
TargetObject          :
CategoryInfo          : NotSpecified: (:) [Get-SecretInfo], MethodInvocationException
FullyQualifiedErrorId : CryptographicException,Microsoft.PowerShell.SecretManagement.GetSecretInfoCommand
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at Get-SecretInfo, C:\Program Files\WindowsPowerShell\Modules\Microsoft.PowerShell.SecretStore\1.0.3\Microsoft.PowerShell.SecretStore.Extension\Microsoft.PowerShell.SecretStore.Extension.psm1: line 71
                        at <ScriptBlock>, <No file>: line 19
PipelineIterationInfo : {0, 1}

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.2364
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.2364
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

1.1.2

Visuals

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant