....................................../////.===Shadow-Here===./////................................................ > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < > < ------------------------------------------------------------------------------------------------------------------- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// RIFF¤ WEBPVP8 ˜ ðÑ *ôô>‘HŸK¥¤"§£±¨àð enü¹%½_F‘åè¿2ºQú³íªú`N¿­3ÿƒügµJžaÿ¯ÿ°~¼ÎùnúîÞÖô•òíôÁÉß®Sm¥Ü/ ‡ó˜f£Ùà<˜„xëJ¢Ù€SO3x<ªÔ©4¿+ç¶A`q@Ì“Úñè™ÍÿJÌ´ª-˜ÆtÊÛL]Ïq*‘Ý”ì#ŸÌÏãY]@ê`¿ /ªfkØB4·®£ó z—Üw¥Pxù–ÞLШKÇN¾AkÙTf½è'‰g gÆv›Øuh~ a˜Z— ïj*á¥t d£“uÒ ¨`K˜¹ßþ]b>˜]_ÏÔ6W—è2r4x•íÖ…"ƒÖNîä!¦å Ú}ýxGøÌ —@ ;ÆÚŠ=ɾ1ý8lªË¥ô ^yf®Œ¢u&2©nÙÇ›ñÂñŒ³ aPo['½»øFùà­+4ê“$!lövlüÞ=;N®3ð‚õ›DÉKòÞ>ÄÍ ¥ˆuߤ#ˆ$6ù™¥îЇy’ÍB¼ çxÛ;X"WL£R÷͝*ó-¶Zu}º.s¸sšXqù–DþÿvªhüïwyŸ ¯é³lÀ:KCûÄ£Ëá\…­ ~—ýóî ¼ûûÜTÓüÇy…ŽÆvc»¾×U ñ¸žþоP÷¦ó:Ò¨¨5;Ð#&#ÖúñläÿÁœ GxÉ­/ñ‡áQðìYÉtÒw޼GÔ´zàÒò ð*ëzƒ•4~H]Ø‹f ñÓÈñ`NåWçs'ÆÏW^ø¹!XžµmQ5ÃËoLœÎ: ÞËÍ¥J ù…î èo£ßPÎñ¶ž8.Œ]ʵ~5›ÙË-ù*8ÙÖß±~ ©¹rÓê‚j¶d¸{^Q'˜±Crß ÚH—#¥¥QlÀ×ëã‡DÜ«èî þ&Çæžî;ŽÏºò6ÒLÃXy&ZŒ'j‚¢Ù€IßÚù+–MGi‰*jE€‘JcÜ ÓÌ EÏÚj]o˜ Þr <¾U ûŪæÍ/šÝH¥˜b”¼ ÁñßX GP›ï2›4WŠÏà×£…íÓk†¦H·ÅíMh–*nó÷à]ÁjCº€b7<ب‹¨5車bp2:Á[UªM„QŒçiNMa#<5›áËó¸HýÊ"…×Éw¹¦ì2º–x<›»a±¸3Weü®FÝ⑱ö–î–³|LPÈ~çð~Çå‡|º kD¢µÏàÆAI %1À% ¹Ò – ”ϝS¦‰4&¶£°à Öý”û_Ò Áw°A«Å€?mÇÛgHÉ/8)á¾ÛìáöŽP í¨PŸNÙµº¦‡§Ùš"ÿ«>+ªÕ`Ê÷‡‚ß Õû˜þãÇ-PÍ.¾XV‘€ dÜ"þ4¹ ±Oú‘©t¥¦FªÄÃÄ•b‚znýu½—#cDs˜ÃiÑOˆñ×QO=*IAÊ,¶ŽZƒ;‡wøXè%EÐk:F±Ú” .Ѽ+Áu&Ç`."pÈÉw o&¿dE6‘’EqTuK@Ì¥ã™À(Êk(h‰,H}RÀIXÛš3µ1©_OqÚÒJAñ$ÊÙÜ;D3çŒ[þùœh¬Ã³™ö6ç†NY".Ú‰ï[ªŸŒ '²Ð öø_¨ÂÉ9ué¶³ÒŠõTàîMØ#û¯gN‡bÙ놚X„ö …ÉeüÌ^J ‹€.œ$Æ)βÄeæW#óüßĺŸ€ ÀzwV 9oä»f4V*uB «Ë†¹ì¯žR霓æHXa=&“I4K;¯ç‹h×·"UŠ~<•╪Vêª&ÍSÃÆÅ?ÔqÎ*mTM ˜›µwêd#[C¡©§‘D<©àb†–ÁœøvH/,í:¯( ²£|4-„Æövv„Yͼ™^Á$ˆ„¢Û[6yB.åH*V¨æ?$=˜Ñ€•ñ·­(VlŸ‘ nÀt8W÷´Bûba?q9ú¶Xƒl«ÿ\ù¶’þòUÐj/õ¢Ìµ³g$ƒÎR!¸»|Oߍë’BhîÚÑ¢ñåŒJ„®„£2Ð3•ô02Nt…!£Í]Ïc½Qÿ?ˆ<&ÃA¾Ú,JˆijÌ#5yz„‰Î|ÊŽ5QÏ:‹ÐaóVÔxW—CpeÏzÐïíçôÿÅ_[hãsÐ_/ŽTÝ?BîˆííV$<¿i>²F¬_Eß¿ †bÊŒº­ÿ®Z H“C}”¬,Mp ý/Bá£w>˜YV°aƒúh+cŠ- r/[%|üUMHäQ°X»|û/@|°¥Ð !BÔ Ç¢Ä©š+Õì D«7ìN¶ŽðÔ " ƶ’ÖçtA‰Û×}{tþz­¾GÍ›k¹OEJR$ Â׃ «ëÁ"oÉôž$oUK(Ä)Ãz³Ê-‹êN[Ò3Œñbï8P 4ƒ×q¢bo|?<ÛX¬òÄͰL–±›(™ûG?ýË©ÚÄ–ÂDØÐ_Ç¡ô ¾–ÄÏø ×e8Ë©$ÄF¹Å‹ì[©óìl:F¾f´‹‹Xì²ï®\¬ôùƒ ÿat¥óèÒùHß0äe‚;ü×h:ÆWðHž=Ã8骣"kœ'Y?³}Tûè€>?0l›e1Lòñ„aæKÆw…hÖŠùW…ÈÆÄ0ši·›[pcwËþñiêíY/~-Á5˜!¿†A›™Mÿþ(±“t@â“ö2­´TG5yé]çå僳 .·ÍïçÝ7UÚ±Ð/Nè»,_Ï ùdj7\ï Wì4›„»c¸àešg#ÒÊ⥭áØo5‘?ÌdÝô¯ ¹kzsƒ=´#ëÉK›Ø´±-¥eW?‡çßtòTã…$Ý+qÿ±ƒ÷_3Ô¥í÷:æ–ž<·Ö‡‰Å¢ š‡%Ô—utÌÈìðžgÖÀz²À—ï÷Óîäõ{K'´È÷³yaÏÁjƒô}ž§®æÊydÕÈë5¯èˆõvÕ©ã*çD„ “z„Ó‡^^xÂ3M§A´JG‚öï 3W'ˆ.OvXè¡ÊÕª?5º7†˜(˜Ç¶#çê’¶!ÌdZK§æ 0fãaN]òY³RV ™î$®K2R¨`W!1Ôó\;Ý ýB%qæK•&ÓÈe9È0êI±žeŸß -ú@žQr¦ ö4»M¼Áè¹µmw 9 EÆE_°2ó„ŸXKWÁ×Hóì^´²GѝF©óäR†¦‰ç"V»eØ<3ùd3ÿÚ¤Žú“Gi" —‘_ÙËÎ~Üö¯¥½Î»üŸEÚŽåmÞþí ;ÞólËΦMzA"Âf(´òá;Éï(/7½ûñÌ­cïÕçлþÝz¾-ÍvÑ“pH­–ðÓj$¸Äû¤‚‘ãUBË-n“2åPkS5&‹Â|+g^œ®Ì͆d!OïäîU«c;{Û!ÅŽ«ëZ9Ókóˆ]¯ƒ›né `ÇÒ+tÆš (ØKá¾—=3œ®•vuMñg²\ï Ec€ 05±d™‡×iÇ×›UúvÌ¢£Èþ¡ÕØô¶ßÎA"ß±#Ö²ˆÊŸ¦*Ä~ij|àø.-¼'»Ú¥£h ofº¦‡VsR=N½„Î v˜Z*SÌ{=jÑB‹tê…;’HžH¯8–îDù8ñ¢|Q•bÛçš–‹m³“ê¨ åÏ^m¬Žãþ©ïêO‡½6] µÆ„Ooòü ²x}N¦Ë3ïé¿»€›HA˜m%çÞ/¿í7Fø“‹léUk)É°Œµ8Q8›:ÀŠeT*šõ~ôڝG6 ¢}`ùH­–”¡k ‰P1>š†®9z11!X wKfmÁ¦xÑ,N1Q”–æB¶M…ÒÃv6SMˆhU¬ÊPŽï‘öj=·CŒ¯u¹ƒVIЃsx4’ömÛýcå¡¶7ßŠß 57^\wÒÐÆ k§h,Œý î«q^R½3]J¸ÇðN ‚çU¬ôº^Áì} ³f©Õœ§ˆã:FÄÈ‚é(€™?àýÓüè1Gô£¼éj‚OÅñ  #>×—ßtà 0G¥Åa뀐kßhc™À_ÉñÞ#±)GD" YîäË-ÿÙ̪ ¹™a¯´¢E\ÝÒö‚;™„ë]_ p8‰o¡ñ+^÷ 3‘'dT4œŽ ðVë½° :¬víÑ«£tßÚS-3¶“þ2 †üüʨòrš¹M{É_¤`Û¨0ìjœøJ‡:÷ÃáZ˜†@GP&œÑDGÏs¡þ¦þDGú‘1Yá9Ôþ¼ ûø…§÷8&–ÜÑnÄ_m®^üÆ`;ÉVÁJ£?â€-ßê}suÍ2sõA NÌúA磸‘îÿÚ»ƒìö·á¿±tÑÐ"Tÿü˜[@/äj¬€uüªìù¥Ý˜á8Ý´sõj 8@rˆð äþZÇD®ÿUÏ2ùôõrBzÆÏÞž>Ì™xœ“ wiÎ×7_… ¸ \#€MɁV¶¥üÕÿPÔ9Z‡ø§É8#H:ƒ5ÀÝå9ÍIŒ5åKÙŠ÷qÄ>1AÈøžj"µÂд/ªnÀ qªã}"iŸBå˜ÓÛŽ¦…&ݧ;G@—³b¯“•"´4í¨ôM¨åñC‹ïùÉó¯ÓsSH2Ý@ßáM‡ˆKÀªÛUeø/4\gnm¥‹ŸŒ qÄ b9ÞwÒNÏ_4Ég³ú=܆‚´ •â¥õeíþkjz>éÚyU«Íӝ݃6"8/ø{=Ô¢»G¥ äUw°W«,ô—¿ãㆅү¢³xŠUû™yŒ (øSópÐ 9\åTâ»—*oG$/×ÍT†Y¿1¤Þ¢_‡ ¼ „±ÍçèSaÓ 3ÛMÁBkxs‰’R/¡¤ˆÙçª(*õ„üXÌ´ƒ E§´¬EF"Ù”R/ÐNyÆÂ^°?™6¡œïJ·±$§?º>ÖüœcNÌù¯G ‹ñ2ЁBB„^·úìaz¨k:#¨Æ¨8LÎõލ£^§S&cŒÐU€ü(‡F±Š¼&P>8ÙÁ ‰ p5?0ÊÆƒZl¸aô š¼¡}gÿ¶zÆC²¹¬ÎÖG*HB¡O<º2#ñŒAƒ–¡B˜´É$¥›É:FÀÔx¾u?XÜÏÓvN©RS{2ʈãk9rmP¼Qq̳ è¼ÐFׄ^¡Öì fE“F4A…!ì/…¦Lƒ… … $%´¾yã@CI¬ á—3PþBÏNÿ<ý°4Ü ËÃ#ØÍ~âW«rEñw‹eùMMHß²`¬Öó½íf³:‹k˜¯÷}Z!ã¿<¥,\#öµÀ¯aÒNÆIé,Ћ–lŽ#Àæ9ÀÒS·I’½-Ïp Äz¤Š Â* ­íÄ9­< h>׍3ZkËU¹§˜ŒŠ±f­’¤º³Q ÏB?‹#µíÃ¥®@(Gs«†vI¥Mµ‹Á©e~2ú³ÁP4ìÕi‚²Ê^ö@-DþÓàlÜOÍ]n"µã:žpsŽ¢:! Aõ.ç~ÓBûH÷JCÌ]õVƒd «ú´QÙEA–¯¯Œ!.ˆˆëQ±ù œ·Ì!Õâ )ùL„ÅÀlÚè5@B…o´Æ¸XÓ&Û…O«˜”_#‡ƒ„ûÈt!¤ÁÏ›ÎÝŠ?c9 â\>lÓÁVÄÑ™£eØY]:fÝ–—ù+p{™ðè û³”g±OƒÚSù£áÁÊ„ä,ï7š²G ÕÌBk)~ÑiCµ|h#u¤¶îK¨² #²vݯGãeÖ϶ú…¾múÀ¶þÔñ‚Š9'^($¤§ò “š½{éúp÷J›ušS¹áªCÂubÃH9™D™/ZöØÁ‡¦ÝÙŸ·kð*_”.C‹{áXó€‡c¡c€§/šò/&éš÷,àéJþ‰X›fµ“C¨œ®r¬"kL‰Â_q…Z–.ÉL~O µ›zn‚¹À¦Öª7\àHµšÖ %»ÇníV[¥*Õ;ƒ#½¾HK-ÖIÊdÏEÚ#=o÷Óò³´Š: Ç?{¾+9›–‘OEáU·S€˜j"ÄaÜ ŒÛWt› á–c#a»pÔZÞdŽtWê=9éöÊ¢µ~ ë ;Öe‡Œ®:bî3±ýê¢wà¼îpêñ¹¾4 zc¾ðÖÿzdêŒÑÒŝÀ‰s6¤í³ÎÙB¿OZ”+F¤á‡3@Ñëäg©·Ž ˆèª<ù@É{&S„œÕúÀA)‰h:YÀ5^ÂÓŒ°õäU\ ùËÍû#²?Xe¬tu‰^zÒÔãë¼ÛWtEtû …‚g¶Úüâî*moGè¨7%u!]PhÏd™Ý%Îx: VÒ¦ôÊD3ÀŽKÛËãvÆî…N¯ä>Eró–ð`5 Œ%u5XkñÌ*NU%¶áœÊ:Qÿú»“úzyÏ6å-၇¾ ´ ÒÊ]y žO‘w2Äøæ…H’²f±ÎÇ.ª|¥'gîV•Ü .̘¯€šòü¤U~Ù†*¢!?ò wý,}´°ÔÞnïoKq5µb!áÓ3"vAßH¡³¡·G(ÐÎ0Îò¼MG!/ài®@—¬04*`…«é8ªøøló“ˆÊ”èù¤…ßÊoÿé'ËuÌÖ5×È¡§ˆˆfŽë9}hìâ_!!¯  B&Ëö¶‰ÀAÙNVŸ Wh›¸®XÑJì¨ú“¿÷3uj²˜¨ÍÎìë±aúŠÝå¯ð*Ó¨ôJ“yºØ)m°WýOè68†ŸÏ2—‰Ïüꪫٚ¥‹l1 ø ÏÄFjêµvÌbü¦èÝx:X±¢H=MÐß—,ˆÉÇ´(9ú¾^ÅÚ4¿m‡$âX‘å%(AlZo@½¨UOÌÕ”1ø¸jÎÀÃÃ_ µ‘Ü.œº¦Ut: Æï’!=¯uwû#,“pþÇúŒø(é@?³ü¥‘Mo §—s@Œ#)§ŒùkL}NOÆêA›¸~r½¼ÙA—HJ«eˆÖ´*¡ÓpÌŸö.m<-"³ûÈ$¬_6­åf£ïÚâj1y§ÕJ½@dÞÁr&Í\Z%D£Íñ·AZ Û³øüd/ªAi†/Й~  ‡âĮҮÏh§°b—›Û«mJžòG'[ÈYýŒ¦9psl ýÁ ®±f¦x,‰½tN ‚Xª9 ÙÖH.«Lo0×?͹m¡å†Ѽ+›2ƒF ±Ê8 7Hցϓ²Æ–m9…òŸï]Â1äN†VLâCˆU .ÿ‰Ts +ÅÎx(%¦u]6AF Š ØF鈄‘ |¢¶c±soŒ/t[a¾–û:s·`i햍ê›ËchÈ…8ßÀUÜewŒðNOƒõD%q#éû\9¤x¹&UE×G¥ Í—™$ð E6-‡¼!ýpãÔM˜ Âsìe¯ñµK¢Ç¡ùôléœ4Ö£”À Š®Ðc ^¨À}ÙËŸ§›ºê{ÊuÉC ×Sr€¤’fÉ*j!úÓ’Gsùìoîßîn%ò· àc Wp÷$¨˜)û»H ×8ŽÒ€Zj¤3ÀÙºY'Ql¦py{-6íÔCeiØp‘‡XÊîÆUߢ܂ž£Xé¼Y8þ©ëgñß}é.ÎógÒ„ÃØËø¯»™§Xýy M%@NŠ À(~áÐvu7&•,Ù˜ó€uP‡^^®=_E„jt’ 403WebShell
403Webshell
Server IP : 107.180.102.13  /  Your IP : 216.73.216.161
Web Server : Apache
System : Linux ip-107-180-102-13.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : nobody ( 99)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/self/root/usr/include/proftpd/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/usr/include/proftpd/mod_sftp.h
/* mod_sftp.h.  Generated from mod_sftp.h.in by configure.  */
/*
 * ProFTPD - mod_sftp
 * Copyright (c) 2008-2023 TJ Saunders
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
 *
 * As a special exemption, TJ Saunders and other respective copyright holders
 * give permission to link this program with OpenSSL, and distribute the
 * resulting executable, without including the source code for OpenSSL in the
 * source distribution.
 */

#ifndef MOD_SFTP_H
#define MOD_SFTP_H

#include "conf.h"
#include "privs.h"

#include <signal.h>

#if HAVE_MLOCK
# include <sys/mman.h>
#endif

#if HAVE_SYS_UIO_H
# include <sys/uio.h>
#endif

#ifndef MAX
# define MAX(x, y) (((x) > (y)) ? (x) : (y))
# define MIN(x, y) (((x) < (y)) ? (x) : (y))
#endif

/* Define if you have the <zlib.h> header.  */
#define HAVE_ZLIB_H 1

/* Define if you have OpenSSL with crippled AES support. */
/* #undef HAVE_AES_CRIPPLED_OPENSSL */

/* Define if you have OpenSSL with EVP_aes_128_ctr support. */
#define HAVE_EVP_AES_128_CTR_OPENSSL 1

/* Define if you have OpenSSL with EVP_aes_192_ctr support. */
#define HAVE_EVP_AES_192_CTR_OPENSSL 1

/* Define if you have OpenSSL with EVP_aes_256_ctr support. */
#define HAVE_EVP_AES_256_CTR_OPENSSL 1

/* Define if you have OpenSSL with EVP_aes_256_gcm support. */
#define HAVE_EVP_AES_256_GCM_OPENSSL 1

/* Define if you have OpenSSL with EVP_chacha20 support.
 *
 * Note, however, that older LibreSSL versions have broken ChaCha20 support.
 */
/* #undef HAVE_EVP_CHACHA20_OPENSSL */

#if defined(HAVE_LIBRESSL) && \
  LIBRESSL_VERSION_NUMBER < 0x3010000fL
/* # undef HAVE_BROKEN_CHACHA20 */
#endif

/* Define if you have OpenSSL with OSSL_PROVIDER_load support. */
/* #undef HAVE_OSSL_PROVIDER_LOAD_OPENSSL */

/* Define if you have OpenSSL with SHA256 support. */
#define HAVE_SHA256_OPENSSL 1

/* Define if you have OpenSSL with SHA512 support. */
#define HAVE_SHA512_OPENSSL 1

/* Define if you have OpenSSL with X448 support. */
/* #undef HAVE_X448_OPENSSL */

#define MOD_SFTP_VERSION	"mod_sftp/1.2.0"

/* Make sure the version of proftpd is as necessary. */
#if PROFTPD_VERSION_NUMBER < 0x0001030402
# error "ProFTPD 1.3.4rc2 or later required"
#endif

#include <openssl/bio.h>
#if !defined(OPENSSL_NO_BF)
# include <openssl/blowfish.h>
#endif /* !OPENSSL_NO_BF */
#include <openssl/bn.h>
#include <openssl/conf.h>
#if !defined(OPENSSL_NO_DES)
# include <openssl/des.h>
#endif /* !OPENSSL_NO_DES */
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/x509v3.h>
#include <openssl/err.h>
#include <openssl/rand.h>
#include <openssl/pem.h>
#if !defined(OPENSSL_NO_DSA)
# include <openssl/dsa.h>
#endif /* !OPENSSL_NO_DSA */
#include <openssl/rsa.h>
#if OPENSSL_VERSION_NUMBER > 0x000907000L
# include <openssl/aes.h>
# ifdef PR_USE_OPENSSL_ENGINE
#  include <openssl/engine.h>
# endif /* PR_USE_OPENSSL_ENGINE */
# include <openssl/ocsp.h>
#endif
#if defined(PR_USE_OPENSSL_ECC)
# include <openssl/ec.h>
# include <openssl/ecdh.h>
#endif /* PR_USE_OPENSSL_ECC */
#if defined(HAVE_OSSL_PROVIDER_LOAD_OPENSSL)
# include <openssl/provider.h>
#endif /* HAVE_OSSL_PROVIDER_LOAD_OPENSSL */

/* Define if you have the LibreSSL library.
 *
 * Note that in LibreSSL-3.5.0, the structs became opaque, as they are in
 * OpenSSL-1.1.0, and thus these version-dependent macros became more
 * complex.
 */
#if defined(LIBRESSL_VERSION_NUMBER)
# define HAVE_LIBRESSL	1
#endif

#define SFTP_ID_PREFIX		"SSH-2.0-"

/* Omit the version information in the default banner.  Sites wishing to use
 * or see that version information can configure it explicitly via ServerIdent.
 */
#define SFTP_ID_DEFAULT_STRING	SFTP_ID_PREFIX "mod_sftp"

/* mod_sftp session state flags */
#define SFTP_SESS_STATE_HAVE_KEX	0x00001
#define SFTP_SESS_STATE_HAVE_SERVICE	0x00002
#define SFTP_SESS_STATE_HAVE_AUTH	0x00004
#define SFTP_SESS_STATE_REKEYING	0x00008
#define SFTP_SESS_STATE_HAVE_EXT_INFO	0x00010

/* mod_sftp option flags */
#define SFTP_OPT_IGNORE_SFTP_UPLOAD_PERMS	0x000001
#define SFTP_OPT_IGNORE_SCP_UPLOAD_PERMS	0x000002
#define SFTP_OPT_PESSIMISTIC_KEXINIT		0x000004
#define SFTP_OPT_OLD_PROTO_COMPAT		0x000008
#define SFTP_OPT_MATCH_KEY_SUBJECT		0x000010
#define SFTP_OPT_IGNORE_SFTP_SET_PERMS		0x000020
#define SFTP_OPT_IGNORE_SFTP_SET_TIMES		0x000040
#define SFTP_OPT_IGNORE_SFTP_SET_OWNERS		0x000080
#define SFTP_OPT_IGNORE_SCP_UPLOAD_TIMES	0x000100
#define SFTP_OPT_ALLOW_INSECURE_LOGIN		0x000200
#define SFTP_OPT_INSECURE_HOSTKEY_PERMS		0x000400
#define SFTP_OPT_ALLOW_WEAK_DH			0x000800
#define SFTP_OPT_IGNORE_FIFOS			0x001000
#define SFTP_OPT_IGNORE_SFTP_UPLOAD_XATTRS	0x002000
#define SFTP_OPT_IGNORE_SFTP_SET_XATTRS		0x004000
#define SFTP_OPT_INCLUDE_SFTP_TIMES		0x008000
#define SFTP_OPT_NO_EXT_INFO			0x010000
#define SFTP_OPT_NO_HOSTKEY_ROTATION		0x020000
#define SFTP_OPT_FIDO_TOUCH_REQUIRED		0x040000
#define SFTP_OPT_FIDO_VERIFY_REQUIRED		0x080000
#define SFTP_OPT_NO_STRICT_KEX			0x100000

/* mod_sftp service flags */
#define SFTP_SERVICE_FL_SFTP		0x0001
#define SFTP_SERVICE_FL_SCP		0x0002
#define SFTP_SERVICE_FL_DATE		0x0004

#define SFTP_SERVICE_DEFAULT \
	(SFTP_SERVICE_FL_SFTP|SFTP_SERVICE_FL_SCP)

/* mod_sftp roles */
#define SFTP_ROLE_SERVER		1
#define SFTP_ROLE_CLIENT		2

/* mod_sftp generic/fake "command ID" for logging */
#define SFTP_CMD_ID		128

/* Miscellaneous */
extern int sftp_logfd;
extern const char *sftp_logname;
extern pool *sftp_pool;
extern conn_t *sftp_conn;
extern unsigned int sftp_sess_state;
extern unsigned long sftp_opts;
extern unsigned int sftp_services;

/* Used by other SFTP modules (e.g. mod_sftp_pam) for sending USERAUTH_BANNER
 * messages to the client.
 */
int sftp_auth_send_banner(const char *);

/* API for modules that which to register "keyboard-interactive" auth
 * drivers (see RFC4256).
 */

typedef struct {
  const char *challenge;

  /* TRUE or FALSE, depending on whether the user's response should be
   * displayed back to them (TRUE), or hidden (FALSE).
   */
  char display_response;

} sftp_kbdint_challenge_t;

typedef struct kbdint_st {
  const char *driver_name;

  /* Memory pool for this driver */
  pool *driver_pool;

  /* Arbitrary driver-specific data */
  void *driver_data;

  /* Open the driver for authentication. The user argument is the name of the
   * user being authenticated.  Returns zero on success, -1 otherwise
   * (with errno set appropriately).
   */
  int (*open)(struct kbdint_st *driver, const char *user);

  /* Authenticate the given user.  The driver can use the following
   * functions for writing and reading the driver challenge/response data
   * to and from the client:
   *
   *   sftp_kbdint_send_challenge()
   *   sftp_kbdint_read_response() 
   *
   * The array_header argument to the read_response() function will be
   * populated with strings from the client.
   *
   * Returns zero on success, -1 otherwise (with errno set appropriately).
   */
  int (*authenticate)(struct kbdint_st *driver, const char *user);

  /* Close the driver, clean up any allocated resources.  Returns
   * zero on success, -1 otherwise (with errno set appropriately).
   */
  int (*close)(struct kbdint_st *driver);

} sftp_kbdint_driver_t;

int sftp_kbdint_register_driver(const char *name, sftp_kbdint_driver_t *driver);
int sftp_kbdint_unregister_driver(const char *name);
int sftp_kbdint_send_challenge(const char *, const char *, uint32_t,
  sftp_kbdint_challenge_t *);
int sftp_kbdint_recv_response(pool *, uint32_t, uint32_t *,
  const char ***);

/* API for modules that which to register keystores, for the
 * SFTPAuthorizedHostKeys and SFTPAuthorizedUserKeys directives.
 */

typedef struct keystore_st {
  /* Memory pool for this keystore. */
  pool *keystore_pool;

  /* Arbitrary keystore-specific data. */
  void *keystore_data;

  /* The type of keys (host, user) that this store can handle. */
  unsigned int store_ktypes;

  /* Verify the given host key.  Returns zero on success, -1 otherwise. */
  int (*verify_host_key)(struct keystore_st *store, pool *p, const char *user,
    const char *host_fqdn, const char *host_user, unsigned char *host_key,
    uint32_t host_keylen, pr_table_t *key_notes);

  /* Verify the given user key.  Returns zero on success, -1 otherwise. */
  int (*verify_user_key)(struct keystore_st *store, pool *p, const char *user,
    unsigned char *user_key, uint32_t user_keylen, pr_table_t *key_notes);

  /* Close this keystore, clean up any allocated resources.  Returns
   * zero on success, -1 otherwise (with errno set appropriately).
   */
  int (*store_close)(struct keystore_st *store);

} sftp_keystore_t;

#define SFTP_SSH2_HOST_KEY_STORE	0x01
#define SFTP_SSH2_USER_KEY_STORE	0x02

/* Known/supported RFC4716 headers. */
#define SFTP_KEYSTORE_HEADER_COMMENT			"Comment"
#define SFTP_KEYSTORE_HEADER_SUBJECT			"Subject"
#define SFTP_KEYSTORE_HEADER_FIDO_TOUCH_REQUIRED	"X-FIDO-Touch-Required"
#define SFTP_KEYSTORE_HEADER_FIDO_VERIFY_REQUIRED	"X-FIDO-Verify-Required"

int sftp_keystore_register_store(const char *,
  sftp_keystore_t *(*store_open)(pool *, int, const char *, const char *),
  unsigned int);
int sftp_keystore_unregister_store(const char *, unsigned int);

/* For use by keystore backend modules. */
int sftp_keys_compare_keys(pool *, unsigned char *, uint32_t, unsigned char *,
  uint32_t);

/* These strings are part of any RFC4716 key; thus they will be needed by
 * any keystore backend modules.
 */
#define SFTP_SSH2_PUBKEY_BEGIN_MARKER   "---- BEGIN SSH2 PUBLIC KEY ----"
#define SFTP_SSH2_PUBKEY_END_MARKER     "---- END SSH2 PUBLIC KEY ----"

/* For use by other SFTP modules. */
const char *sftp_crypto_get_errors(void);

/* For use by other modules to register 'exec' channel request handlers.
 *
 * Note that the implementation currently assumes that the registering module
 * is registering its callbacks from a session process, i.e. post-fork(2).
 * That is why there is no corresponding unregister function at present.
 */
int sftp_channel_register_exec_handler(module *, const char *,
  int (*set_params)(pool *, uint32_t, array_header *),
  int (*prep_chan)(uint32_t),
  int (*postopen_chan)(uint32_t),
  int (*handle_pkt)(pool *, void *, uint32_t, unsigned char *, uint32_t),
  int (*finish_chan)(uint32_t),
  int (**write_data)(pool *, uint32_t, unsigned char *, uint32_t));

#endif

Youez - 2016 - github.com/yon3zu
LinuXploit