@@ -44,13 +44,15 @@ public enum unitytls_error_code : UInt32
44
44
UNITYTLS_INTERNAL_ERROR , // Internal implementation error.
45
45
UNITYTLS_NOT_SUPPORTED , // The requested action is not supported on the current platform/implementation.
46
46
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.
47
48
49
+ UNITYTLS_USER_CUSTOM_ERROR_START = 0x100000 ,
48
50
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.
49
51
// 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.
51
52
UNITYTLS_USER_READ_FAILED , // Can be set by the user to indicate a failed read operation.
52
53
UNITYTLS_USER_WRITE_FAILED , // Can be set by the user to indicate a failed write operation.
53
54
UNITYTLS_USER_UNKNOWN_ERROR , // Can be set by the user to indicate a generic error.
55
+ UNITYTLS_USER_CUSTOM_ERROR_END = 0x200000 ,
54
56
}
55
57
56
58
[ StructLayout ( LayoutKind . Sequential ) ]
@@ -177,10 +179,10 @@ public class unitytls_interface_struct
177
179
178
180
public delegate unitytls_key_ref unitytls_key_get_ref_t ( unitytls_key * key , unitytls_errorstate * errorState ) ;
179
181
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 ;
182
182
public delegate unitytls_key * unitytls_key_parse_der_t ( UInt8 * buffer , size_t bufferLen , Int8 * password , size_t passwordLen , unitytls_errorstate * errorState ) ;
183
183
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 ;
184
186
public delegate void unitytls_key_free_t ( unitytls_key * key ) ;
185
187
public unitytls_key_free_t unitytls_key_free ;
186
188
@@ -231,8 +233,13 @@ public class unitytls_interface_struct
231
233
public unitytls_tlsctx_read_t unitytls_tlsctx_read ;
232
234
public delegate size_t unitytls_tlsctx_write_t ( unitytls_tlsctx * ctx , UInt8 * data , size_t bufferLen , unitytls_errorstate * errorState ) ;
233
235
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 ;
234
238
public delegate void unitytls_tlsctx_free_t ( unitytls_tlsctx * ctx ) ;
235
239
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 ;
236
243
}
237
244
238
245
[ MethodImplAttribute ( MethodImplOptions . InternalCall ) ]
0 commit comments