-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add encalve enabled always encrypted feature (#293)
- Loading branch information
1 parent
b1d4b96
commit d65dc86
Showing
69 changed files
with
6,222 additions
and
835 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
doc/snippets/Microsoft.Data.SqlClient/SqlConnectionAttestationProtocol.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<docs> | ||
<members name="SqlConnectionAttestationProtocol"> | ||
<SqlConnectionAttestationProtocol> | ||
<summary> | ||
Specifies a value for Attestation Protocol. | ||
</summary> | ||
</SqlConnectionAttestationProtocol> | ||
<NotSpecified> | ||
<summary>If the attestation protocol is not specified. Use this as default value.</summary> | ||
<value>0</value> | ||
</NotSpecified> | ||
<AAS> | ||
<summary>Attestation portocol for Azure Attestation Service</summary> | ||
<value>1</value> | ||
</AAS> | ||
<HGS> | ||
<summary>Attestation protocol for Host Guardian Service</summary> | ||
<value>3</value> | ||
</HGS> | ||
</members> | ||
</docs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...nt/netcore/src/Microsoft/Data/SqlClient/AlwaysEncryptedAttestationException.NetCoreApp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.Data.SqlClient | ||
{ | ||
internal class AlwaysEncryptedAttestationException : Exception | ||
{ | ||
public AlwaysEncryptedAttestationException(string message, Exception innerException) : base(message, innerException) { } | ||
|
||
public AlwaysEncryptedAttestationException(string message) : base(message) { } | ||
|
||
public AlwaysEncryptedAttestationException() : base() { } | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...nt/netcore/src/Microsoft/Data/SqlClient/AlwaysEncryptedEnclaveProviderUtils.NetCoreApp.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Linq; | ||
|
||
namespace Microsoft.Data.SqlClient | ||
{ | ||
internal class EnclavePublicKey | ||
{ | ||
public byte[] PublicKey { get; set; } | ||
|
||
public EnclavePublicKey(byte[] payload) | ||
{ | ||
PublicKey = payload; | ||
} | ||
} | ||
|
||
internal class EnclaveDiffieHellmanInfo | ||
{ | ||
public int Size { get; private set; } | ||
|
||
public byte[] PublicKey { get; private set; } | ||
|
||
public byte[] PublicKeySignature { get; private set; } | ||
|
||
public EnclaveDiffieHellmanInfo(byte[] payload) | ||
{ | ||
Size = payload.Length; | ||
|
||
int offset = 0; | ||
int publicKeySize = BitConverter.ToInt32(payload, offset); | ||
offset += sizeof(int); | ||
|
||
int publicKeySignatureSize = BitConverter.ToInt32(payload, offset); | ||
offset += sizeof(int); | ||
|
||
PublicKey = payload.Skip(offset).Take(publicKeySize).ToArray(); | ||
offset += publicKeySize; | ||
|
||
PublicKeySignature = payload.Skip(offset).Take(publicKeySignatureSize).ToArray(); | ||
offset += publicKeySignatureSize; | ||
} | ||
} | ||
|
||
internal enum EnclaveType | ||
{ | ||
None = 0, | ||
|
||
Vbs = 1, | ||
|
||
Sgx = 2 | ||
} | ||
} |
Oops, something went wrong.