summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBung <crc32@qq.com>2020-08-17 16:54:34 +0800
committerGitHub <noreply@github.com>2020-08-17 10:54:34 +0200
commitcd28fe2ef7a204721efa72082c9f65f8d13bcfb3 (patch)
tree25ccc9b9334d1267475f9a2e3717cc8d93789331
parent39906c52c4fd075b813bc1e0f65a9e25a8e9e95a (diff)
downloadNim-cd28fe2ef7a204721efa72082c9f65f8d13bcfb3.tar.gz
add openssl missing procs (#15180)
-rw-r--r--lib/wrappers/openssl.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim
index bea96127d..a37c5b1be 100644
--- a/lib/wrappers/openssl.nim
+++ b/lib/wrappers/openssl.nim
@@ -691,6 +691,7 @@ proc EVP_sha512*(): EVP_MD    {.cdecl, importc.}
 proc EVP_mdc2*(): EVP_MD      {.cdecl, importc.}
 proc EVP_ripemd160*(): EVP_MD {.cdecl, importc.}
 proc EVP_whirlpool*(): EVP_MD {.cdecl, importc.}
+proc EVP_MD_size*(md: EVP_MD): cint {.cdecl, importc.}
 
 # hmac functions
 proc HMAC*(evp_md: EVP_MD; key: pointer; key_len: cint; d: cstring; n: csize_t; md: cstring; md_len: ptr cuint): cstring {.cdecl, importc.}
@@ -699,7 +700,9 @@ proc HMAC*(evp_md: EVP_MD; key: pointer; key_len: cint; d: cstring; n: csize_t;
 proc PEM_read_bio_PrivateKey*(bp: BIO, x: ptr EVP_PKEY, cb: pointer, u: pointer): EVP_PKEY {.cdecl, importc.}
 proc EVP_PKEY_free*(p: EVP_PKEY)  {.cdecl, importc.}
 proc EVP_DigestSignInit*(ctx: EVP_MD_CTX, pctx: ptr EVP_PKEY_CTX, typ: EVP_MD, e: ENGINE, pkey: EVP_PKEY): cint {.cdecl, importc.}
+proc EVP_DigestInit_ex*(ctx: EVP_MD_CTX, typ: PEVP_MD, engine: SslPtr = nil): cint {.cdecl, importc.}
 proc EVP_DigestUpdate*(ctx: EVP_MD_CTX, data: pointer, len: cuint): cint {.cdecl, importc.}
+proc EVP_DigestFinal_ex*(ctx: EVP_MD_CTX, buffer: pointer, size: ptr cuint): cint {.cdecl, importc.}
 proc EVP_DigestSignFinal*(ctx: EVP_MD_CTX, data: pointer, len: ptr csize_t): cint {.cdecl, importc.}
 proc EVP_PKEY_CTX_new*(pkey: EVP_PKEY, e: ENGINE): EVP_PKEY_CTX {.cdecl, importc.}
 proc EVP_PKEY_CTX_free*(pkeyCtx: EVP_PKEY_CTX) {.cdecl, importc.}
@@ -708,10 +711,12 @@ proc EVP_PKEY_sign_init*(c: EVP_PKEY_CTX): cint {.cdecl, importc.}
 when defined(macosx) or defined(windows):
   proc EVP_MD_CTX_create*(): EVP_MD_CTX {.cdecl, importc.}
   proc EVP_MD_CTX_destroy*(ctx: EVP_MD_CTX) {.cdecl, importc.}
+  proc EVP_MD_CTX_cleanup*(ctx: EVP_MD_CTX): cint {.cdecl, importc.}
 else:
   # some times you will need this instead:
   proc EVP_MD_CTX_create*(): EVP_MD_CTX {.cdecl, importc: "EVP_MD_CTX_new".}
   proc EVP_MD_CTX_destroy*(ctx: EVP_MD_CTX) {.cdecl, importc: "EVP_MD_CTX_free".}
+  proc EVP_MD_CTX_cleanup*(ctx: EVP_MD_CTX): cint {.cdecl, importc: "EVP_MD_CTX_cleanup".}
 
 # <openssl/md5.h>
 type