Skip to content

Commit

Permalink
Fix deadlock when using AzureKeyVaultXmlEncryptor.Encrypt (sync) from…
Browse files Browse the repository at this point in the history
… .NET Framework (Azure#12605)
  • Loading branch information
zbecknell authored Aug 6, 2020
1 parent f301528 commit 402960f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AzureKeyVaultXmlDecryptor(IServiceProvider serviceProvider)

public XElement Decrypt(XElement encryptedElement)
{
return DecryptAsync(encryptedElement).GetAwaiter().GetResult();
return Task.Run(() => DecryptAsync(encryptedElement)).GetAwaiter().GetResult();
}

private async Task<XElement> DecryptAsync(XElement encryptedElement)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal AzureKeyVaultXmlEncryptor(IKeyEncryptionKeyResolver client, string keyI

public EncryptedXmlInfo Encrypt(XElement plaintextElement)
{
return EncryptAsync(plaintextElement).GetAwaiter().GetResult();
return Task.Run(() => EncryptAsync(plaintextElement)).GetAwaiter().GetResult();
}

private async Task<EncryptedXmlInfo> EncryptAsync(XElement plaintextElement)
Expand Down

0 comments on commit 402960f

Please sign in to comment.