Skip to content

Commit d476b39

Browse files
committed
[unitytls] Updated interface
1 parent 3ea4ed4 commit d476b39

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

mcs/class/System/Mono.UnityTls/UnityTls.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ public enum unitytls_error_code : UInt32
4444
UNITYTLS_INTERNAL_ERROR, // Internal implementation error.
4545
UNITYTLS_NOT_SUPPORTED, // The requested action is not supported on the current platform/implementation.
4646
UNITYTLS_ENTROPY_SOURCE_FAILED, // Failed to generate requested amount of entropy data.
47+
UNITYTLS_STREAM_CLOSED, // The operation is not possible because the stream between the peers was closed.
4748

49+
UNITYTLS_USER_CUSTOM_ERROR_START = 0x100000,
4850
UNITYTLS_USER_WOULD_BLOCK, // Can be set by the user to signal that a call (e.g. read/write callback) would block and needs to be called again.
4951
// Some implementations may set this if not all bytes have been read/written.
50-
UNITYTLS_USER_STREAM_CLOSED, // Can be set by the user to cancel a read/write operation.
5152
UNITYTLS_USER_READ_FAILED, // Can be set by the user to indicate a failed read operation.
5253
UNITYTLS_USER_WRITE_FAILED, // Can be set by the user to indicate a failed write operation.
5354
UNITYTLS_USER_UNKNOWN_ERROR, // Can be set by the user to indicate a generic error.
55+
UNITYTLS_USER_CUSTOM_ERROR_END = 0x200000,
5456
}
5557

5658
[StructLayout (LayoutKind.Sequential)]
@@ -177,10 +179,10 @@ public class unitytls_interface_struct
177179

178180
public delegate unitytls_key_ref unitytls_key_get_ref_t(unitytls_key* key, unitytls_errorstate* errorState);
179181
public unitytls_key_get_ref_t unitytls_key_get_ref;
180-
public delegate unitytls_key* unitytls_key_parse_pem_t(Int8* buffer, size_t bufferLen, Int8* password, size_t passwordLen, unitytls_errorstate* errorState);
181-
public unitytls_key_parse_der_t unitytls_key_parse_pem;
182182
public delegate unitytls_key* unitytls_key_parse_der_t(UInt8* buffer, size_t bufferLen, Int8* password, size_t passwordLen, unitytls_errorstate* errorState);
183183
public unitytls_key_parse_der_t unitytls_key_parse_der;
184+
public delegate unitytls_key* unitytls_key_parse_pem_t(Int8* buffer, size_t bufferLen, Int8* password, size_t passwordLen, unitytls_errorstate* errorState);
185+
public unitytls_key_parse_pem_t unitytls_key_parse_pem;
184186
public delegate void unitytls_key_free_t(unitytls_key* key);
185187
public unitytls_key_free_t unitytls_key_free;
186188

@@ -231,8 +233,13 @@ public class unitytls_interface_struct
231233
public unitytls_tlsctx_read_t unitytls_tlsctx_read;
232234
public delegate size_t unitytls_tlsctx_write_t(unitytls_tlsctx* ctx, UInt8* data, size_t bufferLen, unitytls_errorstate* errorState);
233235
public unitytls_tlsctx_write_t unitytls_tlsctx_write;
236+
public delegate void unitytls_tlsctx_notify_close_t(unitytls_tlsctx* ctx, unitytls_errorstate* errorState);
237+
public unitytls_tlsctx_notify_close_t unitytls_tlsctx_notify_close;
234238
public delegate void unitytls_tlsctx_free_t(unitytls_tlsctx* ctx);
235239
public unitytls_tlsctx_free_t unitytls_tlsctx_free;
240+
241+
public delegate void unitytls_random_generate_bytes_t(UInt8 * buffer, size_t bufferLen, unitytls_errorstate * errorState);
242+
public unitytls_random_generate_bytes_t unitytls_random_generate_bytes;
236243
}
237244

238245
[MethodImplAttribute (MethodImplOptions.InternalCall)]

0 commit comments

Comments
 (0)