mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-04-21 09:28:43 +02:00
add error function and print out
This commit is contained in:
@@ -339,6 +339,8 @@ namespace wolfSSL.CSharp {
|
||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||
private extern static IntPtr wolfSSL_X509_STORE_CTX_get_current_cert(IntPtr x509Ctx);
|
||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||
private extern static int wolfSSL_X509_STORE_CTX_get_error(IntPtr sk);
|
||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||
private extern static IntPtr wolfSSL_X509_STORE_GetCerts(IntPtr x509Ctx);
|
||||
[DllImport(wolfssl_dll, CallingConvention = CallingConvention.Cdecl)]
|
||||
private extern static int wolfSSL_sk_X509_num(IntPtr sk);
|
||||
@@ -1949,6 +1951,29 @@ namespace wolfSSL.CSharp {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Get the current WOLFSSL_X509_STORE_CTX error value
|
||||
/// </summary>
|
||||
/// <param name="x509Ctx">pointer to store to get error from</param>
|
||||
public static int X509_STORE_CTX_get_error(IntPtr x509Ctx)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (x509Ctx == IntPtr.Zero)
|
||||
{
|
||||
log(ERROR_LOG, "pointer passed in was not set");
|
||||
return -1;
|
||||
}
|
||||
return wolfSSL_X509_STORE_CTX_get_error(x509Ctx);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log(ERROR_LOG, "wolfssl WOLFSSL_X509_STORE_CTX error " + e.ToString());
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print low level C library debug messages to stdout when compiled with macro DEBUG_WOLFSSL
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user