From 01a89cc473c7b98a92c6c6f9c17d294829d3858d Mon Sep 17 00:00:00 2001 From: treeform Date: Sat, 11 Jan 2020 01:58:38 -0800 Subject: [PATCH] Remove some unused/disabled OpenSSL functions (#13106) --- lib/wrappers/openssl.nim | 135 --------------------------------------- 1 file changed, 135 deletions(-) diff --git a/lib/wrappers/openssl.nim b/lib/wrappers/openssl.nim index 7d605fbea0227..94030a5ab68d8 100644 --- a/lib/wrappers/openssl.nim +++ b/lib/wrappers/openssl.nim @@ -535,141 +535,6 @@ proc PEM_read_bio_RSA_PUBKEY*(bp: BIO, x: ptr PRSA, pw: pem_password_cb, u: poin proc RSA_verify*(kind: cint, origMsg: pointer, origMsgLen: cuint, signature: pointer, signatureLen: cuint, rsa: PRSA): cint {.cdecl, dynlib: DLLSSLName, importc.} -when true: - discard -else: - proc SslCtxSetCipherList*(arg0: PSSL_CTX, str: cstring): cint{.cdecl, - dynlib: DLLSSLName, importc.} - proc SslCtxNew*(meth: PSSL_METHOD): PSSL_CTX{.cdecl, - dynlib: DLLSSLName, importc.} - - proc SslSetFd*(s: PSSL, fd: cint): cint{.cdecl, dynlib: DLLSSLName, importc.} - proc SslCTXCtrl*(ctx: PSSL_CTX, cmd: cint, larg: int, parg: Pointer): int{. - cdecl, dynlib: DLLSSLName, importc.} - - proc SSLSetMode*(s: PSSL, mode: int): int - proc SSLCTXGetMode*(ctx: PSSL_CTX): int - proc SSLGetMode*(s: PSSL): int - proc SslMethodV2*(): PSSL_METHOD{.cdecl, dynlib: DLLSSLName, importc.} - proc SslMethodV3*(): PSSL_METHOD{.cdecl, dynlib: DLLSSLName, importc.} - proc SslMethodTLSV1*(): PSSL_METHOD{.cdecl, dynlib: DLLSSLName, importc.} - proc SslMethodV23*(): PSSL_METHOD{.cdecl, dynlib: DLLSSLName, importc.} - proc SslCtxUsePrivateKey*(ctx: PSSL_CTX, pkey: SslPtr): cint{.cdecl, - dynlib: DLLSSLName, importc.} - proc SslCtxUsePrivateKeyASN1*(pk: cint, ctx: PSSL_CTX, - d: cstring, length: int): cint{.cdecl, dynlib: DLLSSLName, importc.} - - proc SslCtxUseCertificate*(ctx: PSSL_CTX, x: SslPtr): cint{.cdecl, - dynlib: DLLSSLName, importc.} - proc SslCtxUseCertificateASN1*(ctx: PSSL_CTX, length: int, d: cstring): cint{. - cdecl, dynlib: DLLSSLName, importc.} - - # function SslCtxUseCertificateChainFile(ctx: PSSL_CTX; const filename: PChar):cint; - proc SslCtxUseCertificateChainFile*(ctx: PSSL_CTX, filename: cstring): cint{. - cdecl, dynlib: DLLSSLName, importc.} - proc SslCtxSetDefaultPasswdCb*(ctx: PSSL_CTX, cb: PPasswdCb){.cdecl, - dynlib: DLLSSLName, importc.} - proc SslCtxSetDefaultPasswdCbUserdata*(ctx: PSSL_CTX, u: SslPtr){.cdecl, - dynlib: DLLSSLName, importc.} - # function SslCtxLoadVerifyLocations(ctx: PSSL_CTX; const CAfile: PChar; const CApath: PChar):cint; - proc SslCtxLoadVerifyLocations*(ctx: PSSL_CTX, CAfile: cstring, CApath: cstring): cint{. - cdecl, dynlib: DLLSSLName, importc.} - proc SslNew*(ctx: PSSL_CTX): PSSL{.cdecl, dynlib: DLLSSLName, importc.} - - - proc SslConnect*(ssl: PSSL): cint{.cdecl, dynlib: DLLSSLName, importc.} - - - proc SslGetVersion*(ssl: PSSL): cstring{.cdecl, dynlib: DLLSSLName, importc.} - proc SslGetPeerCertificate*(ssl: PSSL): PX509{.cdecl, dynlib: DLLSSLName, - importc.} - proc SslCtxSetVerify*(ctx: PSSL_CTX, mode: cint, arg2: PFunction){.cdecl, - dynlib: DLLSSLName, importc.} - proc SSLGetCurrentCipher*(s: PSSL): SslPtr{.cdecl, dynlib: DLLSSLName, importc.} - proc SSLCipherGetName*(c: SslPtr): cstring{.cdecl, dynlib: DLLSSLName, importc.} - proc SSLCipherGetBits*(c: SslPtr, alg_bits: var cint): cint{.cdecl, - dynlib: DLLSSLName, importc.} - proc SSLGetVerifyResult*(ssl: PSSL): int{.cdecl, dynlib: DLLSSLName, importc.} - # libeay.dll - proc X509New*(): PX509{.cdecl, dynlib: DLLUtilName, importc.} - proc X509Free*(x: PX509){.cdecl, dynlib: DLLUtilName, importc.} - proc X509NameOneline*(a: PX509_NAME, buf: cstring, size: cint): cstring{. - cdecl, dynlib: DLLUtilName, importc.} - proc X509GetSubjectName*(a: PX509): PX509_NAME{.cdecl, dynlib: DLLUtilName, - importc.} - proc X509GetIssuerName*(a: PX509): PX509_NAME{.cdecl, dynlib: DLLUtilName, - importc.} - proc X509NameHash*(x: PX509_NAME): int{.cdecl, dynlib: DLLUtilName, importc.} - # function SslX509Digest(data: PX509; typ: PEVP_MD; md: PChar; len: PcInt):cint; - proc X509Digest*(data: PX509, typ: PEVP_MD, md: cstring, length: var cint): cint{. - cdecl, dynlib: DLLUtilName, importc.} - proc X509print*(b: PBIO, a: PX509): cint{.cdecl, dynlib: DLLUtilName, importc.} - proc X509SetVersion*(x: PX509, version: cint): cint{.cdecl, dynlib: DLLUtilName, - importc.} - proc X509SetPubkey*(x: PX509, pkey: EVP_PKEY): cint{.cdecl, dynlib: DLLUtilName, - importc.} - proc X509SetIssuerName*(x: PX509, name: PX509_NAME): cint{.cdecl, - dynlib: DLLUtilName, importc.} - proc X509NameAddEntryByTxt*(name: PX509_NAME, field: cstring, typ: cint, - bytes: cstring, length, loc, theSet: cint): cint{. - cdecl, dynlib: DLLUtilName, importc.} - proc X509Sign*(x: PX509, pkey: EVP_PKEY, md: PEVP_MD): cint{.cdecl, - dynlib: DLLUtilName, importc.} - proc X509GmtimeAdj*(s: PASN1_UTCTIME, adj: cint): PASN1_UTCTIME{.cdecl, - dynlib: DLLUtilName, importc.} - proc X509SetNotBefore*(x: PX509, tm: PASN1_UTCTIME): cint{.cdecl, - dynlib: DLLUtilName, importc.} - proc X509SetNotAfter*(x: PX509, tm: PASN1_UTCTIME): cint{.cdecl, - dynlib: DLLUtilName, importc.} - proc X509GetSerialNumber*(x: PX509): PASN1_cInt{.cdecl, dynlib: DLLUtilName, - importc.} - proc EvpPkeyNew*(): EVP_PKEY{.cdecl, dynlib: DLLUtilName, importc.} - proc EvpPkeyFree*(pk: EVP_PKEY){.cdecl, dynlib: DLLUtilName, importc.} - proc EvpPkeyAssign*(pkey: EVP_PKEY, typ: cint, key: Prsa): cint{.cdecl, - dynlib: DLLUtilName, importc.} - proc EvpGetDigestByName*(Name: cstring): PEVP_MD{.cdecl, dynlib: DLLUtilName, - importc.} - proc EVPcleanup*(){.cdecl, dynlib: DLLUtilName, importc.} - # function ErrErrorString(e: cint; buf: PChar): PChar; - proc SSLeayversion*(t: cint): cstring{.cdecl, dynlib: DLLUtilName, importc.} - - - proc OPENSSLaddallalgorithms*(){.cdecl, dynlib: DLLUtilName, importc.} - proc CRYPTOcleanupAllExData*(){.cdecl, dynlib: DLLUtilName, importc.} - proc RandScreen*(){.cdecl, dynlib: DLLUtilName, importc.} - - proc d2iPKCS12bio*(b: PBIO, Pkcs12: SslPtr): SslPtr{.cdecl, dynlib: DLLUtilName, - importc.} - proc PKCS12parse*(p12: SslPtr, pass: cstring, pkey, cert, ca: var SslPtr): cint{. - dynlib: DLLUtilName, importc, cdecl.} - - proc PKCS12free*(p12: SslPtr){.cdecl, dynlib: DLLUtilName, importc.} - proc RsaGenerateKey*(bits, e: cint, callback: PFunction, cb_arg: SslPtr): PRSA{. - cdecl, dynlib: DLLUtilName, importc.} - proc Asn1UtctimeNew*(): PASN1_UTCTIME{.cdecl, dynlib: DLLUtilName, importc.} - proc Asn1UtctimeFree*(a: PASN1_UTCTIME){.cdecl, dynlib: DLLUtilName, importc.} - proc Asn1cIntSet*(a: PASN1_cInt, v: cint): cint{.cdecl, dynlib: DLLUtilName, - importc.} - proc i2dX509bio*(b: PBIO, x: PX509): cint{.cdecl, dynlib: DLLUtilName, importc.} - proc i2dPrivateKeyBio*(b: PBIO, pkey: EVP_PKEY): cint{.cdecl, - dynlib: DLLUtilName, importc.} - # 3DES functions - proc DESsetoddparity*(Key: des_cblock){.cdecl, dynlib: DLLUtilName, importc.} - proc DESsetkeychecked*(key: des_cblock, schedule: des_key_schedule): cint{. - cdecl, dynlib: DLLUtilName, importc.} - proc DESecbencrypt*(Input: des_cblock, output: des_cblock, ks: des_key_schedule, - enc: cint){.cdecl, dynlib: DLLUtilName, importc.} - # implementation - - proc SSLSetMode(s: PSSL, mode: int): int = - result = SSLctrl(s, SSL_CTRL_MODE, mode, nil) - - proc SSLCTXGetMode(ctx: PSSL_CTX): int = - result = SSLCTXctrl(ctx, SSL_CTRL_MODE, 0, nil) - - proc SSLGetMode(s: PSSL): int = - result = SSLctrl(s, SSL_CTRL_MODE, 0, nil) - # type MD5_LONG* = cuint