NEWS 214 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831
  1. Changelog for the libssh2 project. Generated with git2news.pl
  2. Daniel Stenberg (29 Aug 2021)
  3. - [Will Cosgrove brought this change]
  4. updated docs for 1.10.0 release
  5. Marc Hörsken (30 May 2021)
  6. - [Laurent Stacul brought this change]
  7. [tests] Try several times to connect the ssh server
  8. Sometimes, as the OCI container is run in detached mode, it is possible
  9. the actual server is not ready yet to handle SSH traffic. The goal of
  10. this PR is to try several times (max 3). The mechanism is the same as
  11. for the connection to the docker machine.
  12. - [Laurent Stacul brought this change]
  13. Remove openssh_server container on test exit
  14. - [Laurent Stacul brought this change]
  15. Allow the tests to run inside a container
  16. The current tests suite starts SSH server as OCI container. This commit
  17. add the possibility to run the tests in a container provided that:
  18. * the docker client is installed builder container
  19. * the host docker daemon unix socket has been mounted in the builder
  20. container (with, if needed, the DOCKER_HOST environment variable
  21. accordingly set, and the permission to write on this socket)
  22. * the builder container is run on the default bridge network, or the
  23. host network. This PR does not handle the case where the builder
  24. container is on another network.
  25. Marc Hoersken (28 May 2021)
  26. - CI/appveyor: run SSH server for tests on GitHub Actions (#607)
  27. No longer rely on DigitalOcean to host the Docker container.
  28. Unfortunately we require a small dispatcher script that has
  29. access to a GitHub access token with scope repo in order to
  30. trigger the daemon workflow on GitHub Actions also for PRs.
  31. This script is hosted by myself for the time being until GitHub
  32. provides a tighter scope to trigger the workflow_dispatch event.
  33. GitHub (26 May 2021)
  34. - [Will Cosgrove brought this change]
  35. openssl.c: guards around calling FIPS_mode() #596 (#603)
  36. Notes:
  37. FIPS_mode() is not implemented in LibreSSL and this API is removed in OpenSSL 3.0 and was introduced in 0.9.7. Added guards around making this call.
  38. Credit:
  39. Will Cosgrove
  40. - [Will Cosgrove brought this change]
  41. configure.ac: don't undefine scoped variable (#594)
  42. * configure.ac: don't undefine scoped variable
  43. To get this script to run with Autoconf 2.71 on macOS I had to remove the undefine of the backend for loop variable. It seems scoped to the for loop and also isn't referenced later in the script so it seems OK to remove it.
  44. * configure.ac: remove cygwin specific CFLAGS #598
  45. Notes:
  46. Remove cygwin specific Win32 CFLAGS and treat the build like a posix build
  47. Credit:
  48. Will Cosgrove, Brian Inglis
  49. - [Laurent Stacul brought this change]
  50. tests: Makefile.am: Add missing tests client keys in distribution tarball (#604)
  51. Notes:
  52. Added missing test keys.
  53. Credit:
  54. Laurent Stacul
  55. - [Laurent Stacul brought this change]
  56. Makefile.am: Add missing test keys in the distribution tarball (#601)
  57. Notes:
  58. Fix tests missing key to build the OCI image
  59. Credit:
  60. Laurent Stacul
  61. Daniel Stenberg (16 May 2021)
  62. - dist: add src/agent.h
  63. Fixes #597
  64. Closes #599
  65. GitHub (12 May 2021)
  66. - [Will Cosgrove brought this change]
  67. packet.c: Reset read timeout after received a packet (#576) (#586)
  68. File:
  69. packet.c
  70. Notes:
  71. Attempt keyboard interactive login (Azure AD 2FA login) and use more than 60 seconds to complete the login, the connection fails.
  72. The _libssh2_packet_require function does almost the same as _libssh2_packet_requirev but this function sets state->start = 0 before returning.
  73. Credit:
  74. teottin, Co-authored-by: Tor Erik Ottinsen <[email protected]>
  75. - [kkoenig brought this change]
  76. Support ECDSA certificate authentication (#570)
  77. Files: hostkey.c, userauth.c, test_public_key_auth_succeeds_with_correct_ecdsa_key.c
  78. Notes:
  79. Support ECDSA certificate authentication
  80. Add a test for:
  81. - Existing ecdsa basic public key authentication
  82. - ecdsa public key authentication with a signed public key
  83. Credit:
  84. kkoenig
  85. - [Gabriel Smith brought this change]
  86. agent.c: Add support for Windows OpenSSH agent (#517)
  87. Files: agent.c, agent.h, agent_win.c
  88. Notes:
  89. * agent: Add support for Windows OpenSSH agent
  90. The implementation was partially taken and modified from that found in
  91. the Portable OpenSSH port to Win32 by the PowerShell team, but mostly
  92. based on the existing Unix OpenSSH agent support.
  93. https://github.com/PowerShell/openssh-portable
  94. Regarding the partial transfer support implementation: partial transfers
  95. are easy to deal with, but you need to track additional state when
  96. non-blocking IO enters the picture. A tracker of how many bytes have
  97. been transfered has been placed in the transfer context struct as that's
  98. where it makes most sense. This tracker isn't placed behind a WIN32
  99. #ifdef as it will probably be useful for other agent implementations.
  100. * agent: win32 openssh: Disable overlapped IO
  101. Non-blocking IO is not currently supported by the surrounding agent
  102. code, despite a lot of the code having everything set up to handle it.
  103. Credit:
  104. Co-authored-by: Gabriel Smith <[email protected]>
  105. - [Zenju brought this change]
  106. Fix detailed _libssh2_error being overwritten (#473)
  107. Files: openssl.c, pem.c, userauth.c
  108. Notes:
  109. * Fix detailed _libssh2_error being overwritten by generic errors
  110. * Unified error handling
  111. Credit:
  112. Zenju
  113. - [Paul Capron brought this change]
  114. Fix _libssh2_random() silently discarding errors (#520)
  115. Notes:
  116. * Make _libssh2_random return code consistent
  117. Previously, _libssh2_random was advertized in HACKING.CRYPTO as
  118. returning `void` (and was implemented that way in os400qc3.c), but that
  119. was in other crypto backends a lie; _libssh2_random is (a macro
  120. expanding) to an int-value expression or function.
  121. Moreover, that returned code was:
  122. — 0 or success, -1 on error for the MbedTLS & WinCNG crypto backends
  123. But also:
  124. — 1 on success, -1 or 0 on error for the OpenSSL backend!
  125. – 1 on success, error cannot happen for libgcrypt!
  126. This commit makes explicit that _libssh2_random can fail (because most of
  127. the underlying crypto functions can indeed fail!), and it makes its result
  128. code consistent: 0 on success, -1 on error.
  129. This is related to issue #519 https://github.com/libssh2/libssh2/issues/519
  130. It fixes the first half of it.
  131. * Don't silent errors of _libssh2_random
  132. Make sure to check the returned code of _libssh2_random(), and
  133. propagates any failure.
  134. A new LIBSSH_ERROR_RANDGEN constant is added to libssh2.h
  135. None of the existing error constants seemed fit.
  136. This commit is related to d74285b68450c0e9ea6d5f8070450837fb1e74a7
  137. and to https://github.com/libssh2/libssh2/issues/519 (see the issue
  138. for more info.) It closes #519.
  139. Credit:
  140. Paul Capron
  141. - [Gabriel Smith brought this change]
  142. ci: Remove caching of docker image layers (#589)
  143. Notes:
  144. continued ci reliability work.
  145. Credit:
  146. Gabriel Smith
  147. - [Gabriel Smith brought this change]
  148. ci: Speed up docker builds for tests (#587)
  149. Notes:
  150. The OpenSSH server docker image used for tests is pre-built to prevent
  151. wasting time building it during a test, and unneeded rebuilds are
  152. prevented by caching the image layers.
  153. Credit:
  154. Gabriel Smith
  155. - [Will Cosgrove brought this change]
  156. userauth.c: don't error if using keys without RSA (#555)
  157. file: userauth.c
  158. notes: libssh2 now supports many other key types besides RSA, if the library is built without RSA support and a user attempts RSA auth it shouldn't be an automatic error
  159. credit:
  160. Will Cosgrove
  161. - [Marc brought this change]
  162. openssl.c: Avoid OpenSSL latent error in FIPS mode (#528)
  163. File:
  164. openssl.c
  165. Notes:
  166. Avoid initing MD5 digest, which is not permitted in OpenSSL FIPS certified cryptography mode.
  167. Credit:
  168. Marc
  169. - [Laurent Stacul brought this change]
  170. openssl.c: Fix EVP_Cipher interface change in openssl 3 #463
  171. File:
  172. openssl.c
  173. Notes:
  174. Fixes building with OpenSSL 3, #463.
  175. The change is described there:
  176. https://github.com/openssl/openssl/commit/f7397f0d58ce7ddf4c5366cd1846f16b341fbe43
  177. Credit:
  178. Laurent Stacul, reported by Sergei
  179. - [Gabriel Smith brought this change]
  180. openssh_fixture.c: Fix potential overwrite of buffer when reading stdout of command (#580)
  181. File:
  182. openssh_fixture.c
  183. Notes:
  184. If reading the full output from the executed command took multiple
  185. passes (such as when reading multiple lines) the old code would read
  186. into the buffer starting at the some position (the start) every time.
  187. The old code only works if fgets updated p or had an offset parameter,
  188. both of which are not true.
  189. Credit:
  190. Gabriel Smith
  191. - [Gabriel Smith brought this change]
  192. ci: explicitly state the default branch (#585)
  193. Notes:
  194. It looks like the $default-branch macro only works in templates, not
  195. workflows. This is not explicitly stated anywhere except the linked PR
  196. comment.
  197. https://github.com/actions/starter-workflows/pull/590#issuecomment-672360634
  198. credit:
  199. Gabriel Smith
  200. - [Gabriel Smith brought this change]
  201. ci: Swap from Travis to Github Actions (#581)
  202. Files: ci files
  203. Notes:
  204. Move Linux CI using Github Actions
  205. Credit:
  206. Gabriel Smith, Marc Hörsken
  207. - [Mary brought this change]
  208. libssh2_priv.h: add iovec on 3ds (#575)
  209. file: libssh2_priv.h
  210. note: include iovec for 3DS
  211. credit: Mary Mstrodl
  212. - [Laurent Stacul brought this change]
  213. Tests: Fix unused variables warning (#561)
  214. file: test_public_key_auth_succeeds_with_correct_ed25519_key_from_mem.c
  215. notes: fixed unused vars
  216. credit:
  217. Laurent Stacul
  218. - [Viktor Szakats brought this change]
  219. bcrypt_pbkdf.c: fix clang10 false positive warning (#563)
  220. File: bcrypt_pbkdf.c
  221. Notes:
  222. blf_enc() takes a number of 64-bit blocks to encrypt, but using
  223. sizeof(uint64_t) in the calculation triggers a warning with
  224. clang 10 because the actual data type is uint32_t. Pass
  225. BCRYPT_BLOCKS / 2 for the number of blocks like libc bcrypt(3)
  226. does.
  227. Ref: https://github.com/openbsd/src/commit/04a2240bd8f465bcae6b595d912af3e2965856de
  228. Fixes #562
  229. Credit:
  230. Viktor Szakats
  231. - [Will Cosgrove brought this change]
  232. transport.c: release payload on error (#554)
  233. file: transport.c
  234. notes: If the payload is invalid and there is an early return, we could leak the payload
  235. credit:
  236. Will Cosgrove
  237. - [Will Cosgrove brought this change]
  238. ssh2_client_fuzzer.cc: fixed building
  239. The GitHub web editor did some funky things
  240. - [Will Cosgrove brought this change]
  241. ssh_client_fuzzer.cc: set blocking mode on (#553)
  242. file: ssh_client_fuzzer.cc
  243. notes: the session needs blocking mode turned on to avoid EAGAIN being returned from libssh2_session_handshake()
  244. credit:
  245. Will Cosgrove, reviewed by Michael Buckley
  246. - [Etienne Samson brought this change]
  247. Add a LINT option to CMake (#372)
  248. * ci: make style-checking available locally
  249. * cmake: add a linting target
  250. * tests: check test suite syntax with checksrc.pl
  251. - [Will Cosgrove brought this change]
  252. kex.c: kex_agree_instr() improve string reading (#552)
  253. * kex.c: kex_agree_instr() improve string reading
  254. file: kex.c
  255. notes: if haystack isn't null terminated we should use memchr() not strchar(). We should also make sure we don't walk off the end of the buffer.
  256. credit:
  257. Will Cosgrove, reviewed by Michael Buckley
  258. - [Will Cosgrove brought this change]
  259. kex.c: use string_buf in ecdh_sha2_nistp (#551)
  260. * kex.c: use string_buf in ecdh_sha2_nistp
  261. file: kex.c
  262. notes:
  263. use string_buf in ecdh_sha2_nistp() to avoid attempting to parse malformed data
  264. - [Will Cosgrove brought this change]
  265. kex.c: move EC macro outside of if check #549 (#550)
  266. File: kex.c
  267. Notes:
  268. Moved the macro LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY outside of the LIBSSH2_ECDSA since it's also now used by the ED25519 code.
  269. Sha 256, 384 and 512 need to be defined for all backends now even if they aren't used directly. I believe this is already the case, but just a heads up.
  270. Credit:
  271. Stefan-Ghinea
  272. - [Tim Gates brought this change]
  273. kex.c: fix simple typo, niumber -> number (#545)
  274. File: kex.c
  275. Notes:
  276. There is a small typo in src/kex.c.
  277. Should read `number` rather than `niumber`.
  278. Credit:
  279. Tim Gates
  280. - [Tseng Jun brought this change]
  281. session.c: Correct a typo which may lead to stack overflow (#533)
  282. File: session.c
  283. Notes:
  284. Seems the author intend to terminate banner_dup buffer, later, print it to the debug console.
  285. Author:
  286. Tseng Jun
  287. Marc Hoersken (10 Oct 2020)
  288. - wincng: fix random big number generation to match openssl
  289. The old function would set the least significant bits in
  290. the most significant byte instead of the most significant bits.
  291. The old function would also zero pad too much bits in the
  292. most significant byte. This lead to a reduction of key space
  293. in the most significant byte according to the following listing:
  294. - 8 bits reduced to 0 bits => eg. 2048 bits to 2040 bits DH key
  295. - 7 bits reduced to 1 bits => eg. 2047 bits to 2041 bits DH key
  296. - 6 bits reduced to 2 bits => eg. 2046 bits to 2042 bits DH key
  297. - 5 bits reduced to 3 bits => eg. 2045 bits to 2043 bits DH key
  298. No change would occur for the case of 4 significant bits.
  299. For 1 to 3 significant bits in the most significant byte
  300. the DH key would actually be expanded instead of reduced:
  301. - 3 bits expanded to 5 bits => eg. 2043 bits to 2045 bits DH key
  302. - 2 bits expanded to 6 bits => eg. 2042 bits to 2046 bits DH key
  303. - 1 bits expanded to 7 bits => eg. 2041 bits to 2047 bits DH key
  304. There is no case of 0 significant bits in the most significant byte
  305. since this would be a case of 8 significant bits in the next byte.
  306. At the moment only the following case applies due to a fixed
  307. DH key size value currently being used in libssh2:
  308. The DH group_order is fixed to 256 (bytes) which leads to a
  309. 2047 bits DH key size by calculating (256 * 8) - 1.
  310. This means the DH keyspace was previously reduced from 2047 bits
  311. to 2041 bits (while the top and bottom bits are always set), so the
  312. keyspace is actually always reduced from 2045 bits to 2039 bits.
  313. All of this is only relevant for Windows versions supporting the
  314. WinCNG backend (Vista or newer) before Windows 10 version 1903.
  315. Closes #521
  316. Daniel Stenberg (28 Sep 2020)
  317. - libssh2_session_callback_set.3: explain the recv/send callbacks
  318. Describe how to actually use these callbacks.
  319. Closes #518
  320. GitHub (23 Sep 2020)
  321. - [Will Cosgrove brought this change]
  322. agent.c: formatting
  323. Improved formatting of RECV_SEND_ALL macro.
  324. - [Will Cosgrove brought this change]
  325. CMakeLists.txt: respect install lib dir #405 (#515)
  326. Files:
  327. CMakeLists.txt
  328. Notes:
  329. Use CMAKE_INSTALL_LIBDIR directory
  330. Credit: Arfrever
  331. - [Will Cosgrove brought this change]
  332. kex.c: group16-sha512 and group18-sha512 support #457 (#468)
  333. Files: kex.c
  334. Notes:
  335. Added key exchange group16-sha512 and group18-sha512. As a result did the following:
  336. Abstracted diffie_hellman_sha256() to diffie_hellman_sha_algo() which is now algorithm agnostic and takes the algorithm as a parameter since we needed sha512 support. Unfortunately it required some helper functions but they are simple.
  337. Deleted diffie_hellman_sha1()
  338. Deleted diffie_hellman_sha1 specific macro
  339. Cleaned up some formatting
  340. Defined sha384 in os400 and wincng backends
  341. Defined LIBSSH2_DH_MAX_MODULUS_BITS to abort the connection if we receive too large of p from the server doing sha1 key exchange.
  342. Reorder the default key exchange list to match OpenSSH and improve security
  343. Credit:
  344. Will Cosgrove
  345. - [Igor Klevanets brought this change]
  346. agent.c: Recv and send all bytes via network in agent_transact_unix() (#510)
  347. Files: agent.c
  348. Notes:
  349. Handle sending/receiving partial packet replies in agent.c API.
  350. Credit: Klevanets Igor <[email protected]>
  351. - [Daniel Stenberg brought this change]
  352. Makefile.am: include all test files in the dist #379
  353. File:
  354. Makefile.am
  355. Notes:
  356. No longer conditionally include OpenSSL specific test files, they aren't run if we're not building against OpenSSL 1.1.x anyway.
  357. Credit:
  358. Daniel Stenberg
  359. - [Max Dymond brought this change]
  360. Add support for an OSS Fuzzer fuzzing target (#392)
  361. Files:
  362. .travis.yml, configure.ac, ossfuzz
  363. Notes:
  364. This adds support for an OSS-Fuzz fuzzing target in ssh2_client_fuzzer,
  365. which is a cut down example of ssh2.c. Future enhancements can improve
  366. coverage.
  367. Credit:
  368. Max Dymond
  369. - [Sebastián Katzer brought this change]
  370. mbedtls.c: ECDSA support for mbed TLS (#385)
  371. Files:
  372. mbedtls.c, mbedtls.h, .travis.yml
  373. Notes:
  374. This PR adds support for ECDSA for both key exchange and host key algorithms.
  375. The following elliptic curves are supported:
  376. 256-bit curve defined by FIPS 186-4 and SEC1
  377. 384-bit curve defined by FIPS 186-4 and SEC1
  378. 521-bit curve defined by FIPS 186-4 and SEC1
  379. Credit:
  380. Sebastián Katzer
  381. Marc Hoersken (1 Sep 2020)
  382. - buildconf: exec autoreconf to avoid additional process (#512)
  383. Also make buildconf exit with the return code of autoreconf.
  384. Follow up to #224
  385. - scp.c: fix indentation in shell_quotearg documentation
  386. - wincng: make more use of new helper functions (#496)
  387. - wincng: make sure algorithm providers are closed once (#496)
  388. GitHub (10 Jul 2020)
  389. - [David Benjamin brought this change]
  390. openssl.c: clean up curve25519 code (#499)
  391. File: openssl.c, openssl.h, crypto.h, kex.c
  392. Notes:
  393. This cleans up a few things in the curve25519 implementation:
  394. - There is no need to create X509_PUBKEYs or PKCS8_PRIV_KEY_INFOs to
  395. extract key material. EVP_PKEY_get_raw_private_key and
  396. EVP_PKEY_get_raw_public_key work fine.
  397. - libssh2_x25519_ctx was never used (and occasionally mis-typedefed to
  398. libssh2_ed25519_ctx). Remove it. The _libssh2_curve25519_new and
  399. _libssh2_curve25519_gen_k interfaces use the bytes. Note, if it needs
  400. to be added back, there is no need to roundtrip through
  401. EVP_PKEY_new_raw_private_key. EVP_PKEY_keygen already generated an
  402. EVP_PKEY.
  403. - Add some missing error checks.
  404. Credit:
  405. David Benjamin
  406. - [Will Cosgrove brought this change]
  407. transport.c: socket is disconnected, return error (#500)
  408. File: transport.c
  409. Notes:
  410. This is to fix #102, instead of continuing to attempt to read a disconnected socket, it will now error out.
  411. Credit:
  412. TDi-jonesds
  413. - [Will Cosgrove brought this change]
  414. stale.yml
  415. Increasing stale values.
  416. Marc Hoersken (6 Jul 2020)
  417. - wincng: try newer DH API first, fallback to legacy RSA API
  418. Avoid the use of RtlGetVersion or similar Win32 functions,
  419. since these depend on version information from manifests.
  420. This commit makes the WinCNG backend first try to use the
  421. new DH algorithm API with the raw secret derivation feature.
  422. In case this feature is not available the WinCNG backend
  423. will fallback to the classic approach of using RSA-encrypt
  424. to perform the required modular exponentiation of BigNums.
  425. The feature availability test is done during the first handshake
  426. and the result is stored in the crypto backends global state.
  427. Follow up to #397
  428. Closes #484
  429. - wincng: fix indentation of function arguments and comments
  430. Follow up to #397
  431. - [Wez Furlong brought this change]
  432. wincng: use newer DH API for Windows 8.1+
  433. Since Windows 1903 the approach used to perform DH kex with the CNG
  434. API has been failing.
  435. This commit switches to using the `DH` algorithm provider to perform
  436. generation of the key pair and derivation of the shared secret.
  437. It uses a feature of CNG that is not yet documented. The sources of
  438. information that I've found on this are:
  439. * https://stackoverflow.com/a/56378698/149111
  440. * https://github.com/wbenny/mini-tor/blob/5d39011e632be8e2b6b1819ee7295e8bd9b7a769/mini/crypto/cng/dh.inl#L355
  441. With this change I am able to successfully connect from Windows 10 to my
  442. ubuntu system.
  443. Refs: https://github.com/alexcrichton/ssh2-rs/issues/122
  444. Fixes: https://github.com/libssh2/libssh2/issues/388
  445. Closes: https://github.com/libssh2/libssh2/pull/397
  446. GitHub (1 Jul 2020)
  447. - [Zenju brought this change]
  448. comp.c: Fix name clash with ZLIB macro "compress" (#418)
  449. File: comp.c
  450. Notes:
  451. * Fix name clash with ZLIB macro "compress".
  452. Credit:
  453. Zenju
  454. - [yann-morin-1998 brought this change]
  455. buildsystem: drop custom buildconf script, rely on autoreconf (#224)
  456. Notes:
  457. The buildconf script is currently required, because we need to copy a
  458. header around, because it is used both from the library and the examples
  459. sources.
  460. However, having a custom 'buildconf'-like script is not needed if we can
  461. ensure that the header exists by the time it is needed. For that, we can
  462. just append the src/ directory to the headers search path for the
  463. examples.
  464. And then it means we no longer need to generate the same header twice,
  465. so we remove the second one from configure.ac.
  466. Now, we can just call "autoreconf -fi" to generate the autotools files,
  467. instead of relying on the canned sequence in "buildconf", since
  468. autoreconf has now long known what to do at the correct moment (future
  469. versions of autotools, automake, autopoint, autoheader etc... may
  470. require an other ordering, or other intermediate steps, etc...).
  471. Eventually, get rid of buildconf now it is no longer needed. In fact, we
  472. really keep it for legacy, but have it just call autoreconf (and print a
  473. nice user-friendly warning). Don't include it in the release tarballs,
  474. though.
  475. Update doc, gitignore, and travis-CI jobs accordingly.
  476. Credit:
  477. Signed-off-by: "Yann E. MORIN" <[email protected]>
  478. Cc: Sam Voss <[email protected]>
  479. - [Will Cosgrove brought this change]
  480. libssh2.h: Update Diffie Hellman group values (#493)
  481. File: libssh2.h
  482. Notes:
  483. Update the min, preferred and max DH group values based on RFC 8270.
  484. Credit:
  485. Will Cosgrove, noted from email list by Mitchell Holland
  486. Marc Hoersken (22 Jun 2020)
  487. - travis: use existing Makefile target to run checksrc
  488. - Makefile: also run checksrc on test source files
  489. - tests: avoid use of deprecated function _sleep (#490)
  490. - tests: avoid use of banned function strncat (#489)
  491. - tests: satisfy checksrc regarding max line length of 79 chars
  492. Follow up to 2764bc8e06d51876b6796d6080c6ac51e20f3332
  493. - tests: satisfy checksrc with whitespace only fixes
  494. checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF
  495. -ACOPYRIGHT -AFOPENMODE tests/*.[ch]
  496. - tests: add support for ports published via Docker for Windows
  497. - tests: restore retry behaviour for docker-machine ip command
  498. - tests: fix mix of declarations and code failing C89 compliance
  499. - wincng: add and improve checks in bit counting function
  500. - wincng: align bits to bytes calculation in all functions
  501. - wincng: do not disable key validation that can be enabled
  502. The modular exponentiation also works with key validation enabled.
  503. - wincng: fix return value in _libssh2_dh_secret
  504. Do not ignore return value of modular exponentiation.
  505. - appveyor: build and run tests for WinCNG crypto backend
  506. GitHub (1 Jun 2020)
  507. - [suryakalpo brought this change]
  508. INSTALL_CMAKE.md: Update formatting (#481)
  509. File: INSTALL_CMAKE.md
  510. Notes:
  511. Although the original text would be immediately clear to seasoned users of CMAKE and/or Unix shell, the lack of newlines may cause some confusion for newcomers. Hence, wrapping the texts in a md code-block such that the newlines appear as intended.
  512. credit:
  513. suryakalpo
  514. Marc Hoersken (31 May 2020)
  515. - src: add new and align include guards in header files (#480)
  516. Make sure all include guards exist and follow the same format.
  517. - wincng: fix multiple definition of `_libssh2_wincng' (#479)
  518. Add missing include guard and move global state
  519. from header to source file by using extern.
  520. GitHub (28 May 2020)
  521. - [Will Cosgrove brought this change]
  522. transport.c: moving total_num check from #476 (#478)
  523. file: transport.c
  524. notes:
  525. moving total_num zero length check from #476 up to the prior bounds check which already includes a total_num check. Makes it slightly more readable.
  526. credit:
  527. Will Cosgrove
  528. - [lutianxiong brought this change]
  529. transport.c: fix use-of-uninitialized-value (#476)
  530. file:transport.c
  531. notes:
  532. return error if malloc(0)
  533. credit:
  534. lutianxiong
  535. - [Dr. Koutheir Attouchi brought this change]
  536. libssh2_sftp.h: Changed type of LIBSSH2_FX_* constants to unsigned long, fixes #474
  537. File:
  538. libssh2_sftp.h
  539. Notes:
  540. Error constants `LIBSSH2_FX_*` are only returned by `libssh2_sftp_last_error()` which returns `unsigned long`.
  541. Therefore these constants should be defined as unsigned long literals, instead of int literals.
  542. Credit:
  543. Dr. Koutheir Attouchi
  544. - [monnerat brought this change]
  545. os400qc3.c: constify libssh2_os400qc3_hash_update() data parameter. (#469)
  546. Files: os400qc3.c, os400qc3.h
  547. Notes:
  548. Fixes building on OS400. #426
  549. Credit:
  550. Reported-by: hjindra on github, dev by Monnerat
  551. - [monnerat brought this change]
  552. HACKING.CRYPTO: keep up to date with new crypto definitions from code. (#466)
  553. File: HACKING.CRYPTO
  554. Notes:
  555. This commit updates the HACKING.CRYPTO documentation file in an attempt to make it in sync with current code.
  556. New documented features are:
  557. SHA384
  558. SHA512
  559. ECDSA
  560. ED25519
  561. Credit:
  562. monnerat
  563. - [Harry Sintonen brought this change]
  564. kex.c: Add diffie-hellman-group14-sha256 Key Exchange Method (#464)
  565. File: kex.c
  566. Notes: Added diffie-hellman-group14-sha256 kex
  567. Credit: Harry Sintonen <[email protected]>
  568. - [Will Cosgrove brought this change]
  569. os400qc3.h: define sha512 macros (#465)
  570. file: os400qc3.h
  571. notes: fixes for building libssh2 1.9.x
  572. - [Will Cosgrove brought this change]
  573. os400qc3.h: define EC types to fix building #426 (#462)
  574. File: os400qc3.h
  575. Notes: define missing EC types which prevents building
  576. Credit: hjindra
  577. - [Brendan Shanks brought this change]
  578. hostkey.c: Fix 'unsigned int'/'uint32_t' mismatch (#461)
  579. File: hostkey.c
  580. Notes:
  581. These types are the same size so most compilers are fine with it, but CodeWarrior (on classic MacOS) throws an ‘illegal implicit conversion’ error
  582. Credit: Brendan Shanks
  583. - [Thomas Klausner brought this change]
  584. Makefile.am: Fix unportable test(1) operator. (#459)
  585. file: Makefile.am
  586. Notes:
  587. The POSIX comparison operator for test(1) is =; bash supports == but not even test from GNU coreutils does.
  588. Credit:
  589. Thomas Klausner
  590. - [Tseng Jun brought this change]
  591. openssl.c: minor changes of coding style (#454)
  592. File: openssl.c
  593. Notes:
  594. minor changes of coding style and align preprocessor conditional for #439
  595. Credit:
  596. Tseng Jun
  597. - [Hans Meier brought this change]
  598. openssl.c: Fix for use of uninitialized aes_ctr_cipher.key_len (#453)
  599. File:
  600. Openssl.c
  601. Notes:
  602. * Fix for use of uninitialized aes_ctr_cipher.key_len when using HAVE_OPAQUE_STRUCTS, regression from #439
  603. Credit:
  604. Hans Meirer, Tseng Jun
  605. - [Zenju brought this change]
  606. agent.c: Fix Unicode builds on Windows (#417)
  607. File: agent.c
  608. Notes:
  609. Fixes unicode builds for Windows in Visual Studio 16.3.2.
  610. Credit:
  611. Zenju
  612. - [Hans Meier brought this change]
  613. openssl.c: Fix use-after-free crash in openssl backend without memory leak (#439)
  614. Files: openssl.c
  615. Notes:
  616. Fixes memory leaks and use after free AES EVP_CIPHER contexts when using OpenSSL 1.0.x.
  617. Credit:
  618. Hans Meier
  619. - [Romain Geissler @ Amadeus brought this change]
  620. Session.c: Fix undefined warning when mixing with LTO-enabled libcurl. (#449)
  621. File: Session.c
  622. Notes:
  623. With gcc 9, libssh2, libcurl and LTO enabled for all binaries I see this
  624. warning (error with -Werror):
  625. vssh/libssh2.c: In function ‘ssh_statemach_act’:
  626. /data/mwrep/rgeissler/ospack/ssh2/BUILD/libssh2-libssh2-03c7c4a/src/session.c:579:9: error: ‘seconds_to_next’ is used uninitialized in this function [-Werror=uninitialized]
  627. 579 | int seconds_to_next;
  628. | ^
  629. lto1: all warnings being treated as errors
  630. Gcc normally issues -Wuninitialized when it is sure there is a problem,
  631. and -Wmaybe-uninitialized when it's not sure, but it's possible. Here
  632. the compiler seems to have find a real case where this could happen. I
  633. looked in your code and overall it seems you always check if the return
  634. code is non null, not often that it's below zero. I think we should do
  635. the same here. With this patch, gcc is fine.
  636. Credit:
  637. Romain-Geissler-1A
  638. - [Zenju brought this change]
  639. transport.c: Fix crash with delayed compression (#443)
  640. Files: transport.c
  641. Notes:
  642. Fixes crash with delayed compression option using Bitvise server.
  643. Contributor:
  644. Zenju
  645. - [Will Cosgrove brought this change]
  646. Update INSTALL_MAKE path to INSTALL_MAKE.md (#446)
  647. Included for #429
  648. - [Will Cosgrove brought this change]
  649. Update INSTALL_CMAKE filename to INSTALL_CMAKE.md (#445)
  650. Fixing for #429
  651. - [Wallace Souza brought this change]
  652. Rename INSTALL_CMAKE to INTALL_CMAKE.md (#429)
  653. Adding Markdown file extension in order to Github render the instructions properly
  654. Will Cosgrove (17 Dec 2019)
  655. - [Daniel Stenberg brought this change]
  656. include/libssh2.h: fix comment: the known host key uses 4 bits (#438)
  657. - [Zenju brought this change]
  658. ssh-ed25519: Support PKIX + calc pubkey from private (#416)
  659. Files: openssl.c/h
  660. Author: Zenju
  661. Notes:
  662. Adds support for PKIX key reading by fixing:
  663. _libssh2_pub_priv_keyfile() is missing the code to extract the ed25519 public key from a given private key
  664. _libssh2_ed25519_new_private_frommemory is only parsing the openssh key format but does not understand PKIX (as retrieved via PEM_read_bio_PrivateKey)
  665. GitHub (15 Oct 2019)
  666. - [Will Cosgrove brought this change]
  667. .travis.yml: Fix Chrome and 32 bit builds (#423)
  668. File: .travis.yml
  669. Notes:
  670. * Fix Chrome installing by using Travis build in directive
  671. * Update to use libgcrypt20-dev package to fix 32 bit builds based on comments found here:
  672. https://launchpad.net/ubuntu/xenial/i386/libgcrypt11-dev
  673. - [Will Cosgrove brought this change]
  674. packet.c: improved parsing in packet_x11_open (#410)
  675. Use new API to parse data in packet_x11_open() for better bounds checking.
  676. Will Cosgrove (12 Sep 2019)
  677. - [Michael Buckley brought this change]
  678. knownhost.c: Double the static buffer size when reading and writing known hosts (#409)
  679. Notes:
  680. We had a user who was being repeatedly prompted to accept a server key repeatedly. It turns out the base64-encoded key was larger than the static buffers allocated to read and write known hosts. I doubled the size of these buffers.
  681. Credit:
  682. Michael Buckley
  683. GitHub (4 Sep 2019)
  684. - [Will Cosgrove brought this change]
  685. packet.c: improved packet parsing in packet_queue_listener (#404)
  686. * improved bounds checking in packet_queue_listener
  687. file: packet.c
  688. notes:
  689. improved parsing packet in packet_queue_listener
  690. - [Will Cosgrove brought this change]
  691. packet.c: improve message parsing (#402)
  692. * packet.c: improve parsing of packets
  693. file: packet.c
  694. notes:
  695. Use _libssh2_get_string API in SSH_MSG_DEBUG/SSH_MSG_DISCONNECT. Additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST.
  696. - [Will Cosgrove brought this change]
  697. misc.c: _libssh2_ntohu32 cast bit shifting (#401)
  698. To quite overly aggressive analyzers.
  699. Note, the builds pass, Travis is having some issues with Docker images.
  700. - [Will Cosgrove brought this change]
  701. kex.c: improve bounds checking in kex_agree_methods() (#399)
  702. file: kex.c
  703. notes:
  704. use _libssh2_get_string instead of kex_string_pair which does additional checks
  705. Will Cosgrove (23 Aug 2019)
  706. - [Fabrice Fontaine brought this change]
  707. acinclude.m4: add mbedtls to LIBS (#371)
  708. Notes:
  709. This is useful for static builds so that the Libs.private field in
  710. libssh2.pc contains correct info for the benefit of pkg-config users.
  711. Static link with libssh2 requires this information.
  712. Signed-off-by: Baruch Siach <[email protected]>
  713. [Retrieved from:
  714. https://git.buildroot.net/buildroot/tree/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch]
  715. Signed-off-by: Fabrice Fontaine <[email protected]>
  716. Credit:
  717. Fabrice Fontaine
  718. - [jethrogb brought this change]
  719. Generate debug info when building with MSVC (#178)
  720. files: CMakeLists.txt
  721. notes: Generate debug info when building with MSVC
  722. credit:
  723. jethrogb
  724. - [Panos brought this change]
  725. Add agent forwarding implementation (#219)
  726. files: channel.c, test_agent_forward_succeeds.c, libssh2_priv.h, libssh2.h, ssh2_agent_forwarding.c
  727. notes:
  728. * Adding SSH agent forwarding.
  729. * Fix agent forwarding message, updated example.
  730. Added integration test code and cmake target. Added example to cmake list.
  731. credit:
  732. pkittenis
  733. GitHub (2 Aug 2019)
  734. - [Will Cosgrove brought this change]
  735. Update EditorConfig
  736. Added max_line_length = 80
  737. - [Will Cosgrove brought this change]
  738. global.c : fixed call to libssh2_crypto_exit #394 (#396)
  739. * global.c : fixed call to libssh2_crypto_exit #394
  740. File: global.c
  741. Notes: Don't call `libssh2_crypto_exit()` until `_libssh2_initialized` count is down to zero.
  742. Credit: seba30
  743. Will Cosgrove (30 Jul 2019)
  744. - [hlefebvre brought this change]
  745. misc.c : Add an EWOULDBLOCK check for better portability (#172)
  746. File: misc.c
  747. Notes: Added support for all OS' that implement EWOULDBLOCK, not only VMS
  748. Credit: hlefebvre
  749. - [Etienne Samson brought this change]
  750. userauth.c: fix off by one error when loading public keys with no id (#386)
  751. File: userauth.c
  752. Credit:
  753. Etienne Samson
  754. Notes:
  755. Caught by ASAN:
  756. =================================================================
  757. ==73797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700001bcf0 at pc 0x00010026198d bp 0x7ffeefbfed30 sp 0x7ffeefbfe4d8
  758. READ of size 69 at 0x60700001bcf0 thread T0
  759. 2019-07-04 08:35:30.292502+0200 atos[73890:2639175] examining /Users/USER/*/libssh2_clar [73797]
  760. #0 0x10026198c in wrap_memchr (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c)
  761. #1 0x1000f8e66 in file_read_publickey userauth.c:633
  762. #2 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
  763. #3 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
  764. #4 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
  765. #5 0x1000090c3 in clar_run_test clar.c:260
  766. #6 0x1000038f3 in clar_run_suite clar.c:343
  767. #7 0x100003272 in clar_test_run clar.c:522
  768. #8 0x10000c3cc in main runner.c:60
  769. #9 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)
  770. 0x60700001bcf0 is located 0 bytes to the right of 80-byte region [0x60700001bca0,0x60700001bcf0)
  771. allocated by thread T0 here:
  772. #0 0x10029e053 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5c053)
  773. #1 0x1000b4978 in libssh2_default_alloc session.c:67
  774. #2 0x1000f8aba in file_read_publickey userauth.c:597
  775. #3 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
  776. #4 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
  777. #5 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
  778. #6 0x1000090c3 in clar_run_test clar.c:260
  779. #7 0x1000038f3 in clar_run_suite clar.c:343
  780. #8 0x100003272 in clar_test_run clar.c:522
  781. #9 0x10000c3cc in main runner.c:60
  782. #10 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)
  783. SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) in wrap_memchr
  784. Shadow bytes around the buggy address:
  785. 0x1c0e00003740: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd
  786. 0x1c0e00003750: fd fd fd fd fd fd fd fa fa fa fa fa 00 00 00 00
  787. 0x1c0e00003760: 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 00 00
  788. 0x1c0e00003770: 00 00 00 fa fa fa fa fa fd fd fd fd fd fd fd fd
  789. 0x1c0e00003780: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fa
  790. =>0x1c0e00003790: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[fa]fa
  791. 0x1c0e000037a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  792. 0x1c0e000037b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  793. 0x1c0e000037c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  794. 0x1c0e000037d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  795. 0x1c0e000037e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  796. Shadow byte legend (one shadow byte represents 8 application bytes):
  797. Addressable: 00
  798. Partially addressable: 01 02 03 04 05 06 07
  799. Heap left redzone: fa
  800. Freed heap region: fd
  801. Stack left redzone: f1
  802. Stack mid redzone: f2
  803. Stack right redzone: f3
  804. Stack after return: f5
  805. Stack use after scope: f8
  806. Global redzone: f9
  807. Global init order: f6
  808. Poisoned by user: f7
  809. Container overflow: fc
  810. Array cookie: ac
  811. Intra object redzone: bb
  812. ASan internal: fe
  813. Left alloca redzone: ca
  814. Right alloca redzone: cb
  815. Shadow gap: cc
  816. - [Thilo Schulz brought this change]
  817. openssl.c : Fix use-after-free crash on reinitialization of openssl backend
  818. file : openssl.c
  819. notes :
  820. libssh2's openssl backend has a use-after-free condition if HAVE_OPAQUE_STRUCTS is defined and you call libssh2_init() again after prior initialisation/deinitialisation of libssh2
  821. credit : Thilo Schulz
  822. - [axjowa brought this change]
  823. openssl.h : Use of ifdef where if should be used (#389)
  824. File : openssl.h
  825. Notes :
  826. LIBSSH2_ECDSA and LIBSSH2_ED25519 are always defined so the #ifdef
  827. checks would never be false.
  828. This change makes it possible to build libssh2 against OpenSSL built
  829. without EC support.
  830. Change-Id: I0a2f07c2d80178314dcb7d505d1295d19cf15afd
  831. Credit : axjowa
  832. - [Zenju brought this change]
  833. Agent.c : Preserve error info from agent_list_identities() (#374)
  834. Files : agent.c
  835. Notes :
  836. Currently the error details as returned by agent_transact_pageant() are overwritten by a generic "agent list id failed" message by int agent_list_identities(LIBSSH2_AGENT* agent).
  837. Credit :
  838. Zenju
  839. - [Who? Me?! brought this change]
  840. Channel.c: Make sure the error code is set in _libssh2_channel_open() (#381)
  841. File : Channel.c
  842. Notes :
  843. if _libssh2_channel_open() fails, set the error code.
  844. Credit :
  845. mark-i-m
  846. - [Orgad Shaneh brought this change]
  847. Kex.c, Remove unneeded call to strlen (#373)
  848. File : Kex.c
  849. Notes :
  850. Removed call to strlen
  851. Credit :
  852. Orgad Shaneh
  853. - [Pedro Monreal brought this change]
  854. Spelling corrections (#380)
  855. Files :
  856. libssh2.h, libssh2_sftp.h, bcrypt_pbkdf.c, mbedtls.c, sftp.c, ssh2.c
  857. Notes :
  858. * Fixed misspellings
  859. Credit :
  860. Pedro Monreal
  861. - [Sebastián Katzer brought this change]
  862. Fix Potential typecast error for `_libssh2_ecdsa_key_get_curve_type` (#383)
  863. Issue : #383
  864. Files : hostkey.c, crypto.h, openssl.c
  865. Notes :
  866. * Fix potential typecast error for `_libssh2_ecdsa_key_get_curve_type`
  867. * Rename _libssh2_ecdsa_key_get_curve_type to _libssh2_ecdsa_get_curve_type
  868. Credit :
  869. Sebastián Katzer
  870. GitHub (20 Jun 2019)
  871. - [Will Cosgrove brought this change]
  872. bump copyright date
  873. Version 1.9.0 (19 Jun 2019)
  874. GitHub (19 Jun 2019)
  875. - [Will Cosgrove brought this change]
  876. 1.9 Formatting
  877. - [Will Cosgrove brought this change]
  878. 1.9 Release notes
  879. Will Cosgrove (17 May 2019)
  880. - [Alexander Curtiss brought this change]
  881. libgcrypt.c : Fixed _libssh2_rsa_sha1_sign memory leak. (#370)
  882. File: libgcrypt.c
  883. Notes : Added calls to gcry_sexp_release to free memory allocated by gcry_sexp_find_token
  884. Credit :
  885. Reporter : beckmi
  886. PR by: Alexander Curtiss
  887. - [Orivej Desh brought this change]
  888. libssh2_priv.h : Fix musl build warning on sys/poll.h (#346)
  889. File : libssh2_priv.h
  890. Notes :
  891. musl prints `redirecting incorrect #include <sys/poll.h> to <poll.h>`
  892. http://git.musl-libc.org/cgit/musl/commit/include/sys/poll.h?id=54446d730cfb17c5f7bcf57f139458678f5066cc
  893. poll is defined by POSIX to be in poll.h:
  894. http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.html
  895. Credit : Orivej Desh
  896. GitHub (1 May 2019)
  897. - [Will Cosgrove brought this change]
  898. kex.c : additional bounds checks in diffie_hellman_sha1/256 (#361)
  899. Files : kex.c, misc.c, misc.h
  900. Notes :
  901. Fixed possible out of bounds memory access when reading malformed data in diffie_hellman_sha1() and diffie_hellman_sha256().
  902. Added _libssh2_copy_string() to misc.c to return an allocated and filled char buffer from a string_buf offset. Removed no longer needed s var in kmdhgGPshakex_state_t.
  903. Will Cosgrove (26 Apr 2019)
  904. - [Tseng Jun brought this change]
  905. sftp.c : sftp_bin2attr() Correct attrs->gid assignment (#366)
  906. Regression with fix for #339
  907. Credit : Tseng Jun
  908. - [Tseng Jun brought this change]
  909. kex.c : Correct type cast in curve25519_sha256() (#365)
  910. GitHub (24 Apr 2019)
  911. - [Will Cosgrove brought this change]
  912. transport.c : scope local total_num var (#364)
  913. file : transport.c
  914. notes : move local `total_num` variable inside of if block to prevent scope access issues which caused #360.
  915. Will Cosgrove (24 Apr 2019)
  916. - [doublex brought this change]
  917. transport.c : fixes bounds check if partial packet is read
  918. Files : transport.c
  919. Issue : #360
  920. Notes :
  921. 'p->total_num' instead of local value total_num when doing bounds check.
  922. Credit : Doublex
  923. GitHub (23 Apr 2019)
  924. - [Will Cosgrove brought this change]
  925. Editor config file for source files (#322)
  926. Simple start to an editor config file when editing source files to make sure they are configured correctly.
  927. - [Will Cosgrove brought this change]
  928. misc.c : String buffer API improvements (#332)
  929. Files : misc.c, hostkey.c, kex.c, misc.h, openssl.c, sftp.c
  930. Notes :
  931. * updated _libssh2_get_bignum_bytes and _libssh2_get_string. Now pass in length as an argument instead of returning it to keep signedness correct. Now returns -1 for failure, 0 for success.
  932. _libssh2_check_length now returns 0 on success and -1 on failure to match the other string_buf functions. Added comment to _libssh2_check_length.
  933. Credit : Will Cosgrove
  934. Will Cosgrove (19 Apr 2019)
  935. - [doublex brought this change]
  936. mbedtls.c : _libssh2_mbedtls_rsa_new_private_frommemory() allow private-key from memory (#359)
  937. File : mbedtls.c
  938. Notes: _libssh2_mbedtls_rsa_new_private_frommemory() fixes private-key from memory reading to by adding NULL terminator before parsing; adds passphrase support.
  939. Credit: doublex
  940. - [Ryan Kelley brought this change]
  941. Session.c : banner_receive() from leaking when accessing non ssh ports (#356)
  942. File : session.c
  943. Release previous banner in banner_receive() if the session is reused after a failed connection.
  944. Credit : Ryan Kelley
  945. GitHub (11 Apr 2019)
  946. - [Will Cosgrove brought this change]
  947. Formatting in agent.c
  948. Removed whitespace.
  949. - [Will Cosgrove brought this change]
  950. Fixed formatting in agent.c
  951. Quiet linter around a couple if blocks and pointer.
  952. Will Cosgrove (11 Apr 2019)
  953. - [Zhen-Huan HWANG brought this change]
  954. sftp.c : discard and reset oversized packet in sftp_packet_read() (#269)
  955. file : sftp.c
  956. notes : when sftp_packet_read() encounters an sftp packet which exceeds SFTP max packet size it now resets the reading state so it can continue reading.
  957. credit : Zhen-Huan HWANG
  958. GitHub (11 Apr 2019)
  959. - [Will Cosgrove brought this change]
  960. Add agent functions libssh2_agent_get_identity_path() and libssh2_agent_set_identity_path() (#308)
  961. File : agent.c
  962. Notes :
  963. Libssh2 uses the SSH_AUTH_SOCK env variable to read the system agent location. However, when using a custom agent path you have to set this value using setenv which is not thread-safe. The new functions allow for a way to set a custom agent socket path in a thread safe manor.
  964. - [Will Cosgrove brought this change]
  965. Simplified _libssh2_check_length (#350)
  966. * Simplified _libssh2_check_length
  967. misc.c : _libssh2_check_length()
  968. Removed cast and improved bounds checking and format.
  969. Credit : Yuriy M. Kaminskiy
  970. - [Will Cosgrove brought this change]
  971. _libssh2_check_length() : additional bounds check (#348)
  972. Misc.c : _libssh2_check_length()
  973. Ensure the requested length is less than the total length before doing the additional bounds check
  974. Daniel Stenberg (25 Mar 2019)
  975. - misc: remove 'offset' from string_buf
  976. It isn't necessary.
  977. Closes #343
  978. - sftp: repair mtime from e1ead35e475
  979. A regression from e1ead35e4759 broke the SFTP mtime logic in
  980. sftp_bin2attr
  981. Also simplified the _libssh2_get_u32/u64 functions slightly.
  982. Closes #342
  983. - session_disconnect: don't zero state, just clear the right bit
  984. If we clear the entire field, the freeing of data in session_free() is
  985. skipped. Instead just clear the bit that risk making the code get stuck
  986. in the transport functions.
  987. Regression from 4d66f6762ca3fc45d9.
  988. Reported-by: dimmaq on github
  989. Fixes #338
  990. Closes #340
  991. - libssh2_sftp.h: restore broken ABI
  992. Commit 41fbd44 changed variable sizes/types in a public struct which
  993. broke the ABI, which breaks applications!
  994. This reverts that change.
  995. Closes #339
  996. - style: make includes and examples code style strict
  997. make travis and the makefile rule verify them too
  998. Closes #334
  999. GitHub (21 Mar 2019)
  1000. - [Daniel Stenberg brought this change]
  1001. create a github issue template
  1002. Daniel Stenberg (21 Mar 2019)
  1003. - stale-bot: activated
  1004. The stale bot will automatically mark stale issues (inactive for 90
  1005. days) and if still untouched after 21 more days, close them.
  1006. See https://probot.github.io/apps/stale/
  1007. - libssh2_session_supported_algs.3: fix formatting mistakes
  1008. Reported-by: Max Horn
  1009. Fixes #57
  1010. - [Zenju brought this change]
  1011. libssh2.h: Fix Error C2371 'ssize_t': redefinition
  1012. Closes #331
  1013. - travis: add code style check
  1014. Closes #324
  1015. - code style: unify code style
  1016. Indent-level: 4
  1017. Max columns: 79
  1018. No spaces after if/for/while
  1019. Unified brace positions
  1020. Unified white spaces
  1021. - src/checksrc.pl: code style checker
  1022. imported as-is from curl
  1023. Will Cosgrove (19 Mar 2019)
  1024. - Merge branch 'MichaelBuckley-michaelbuckley-security-fixes'
  1025. - Silence unused var warnings (#329)
  1026. Silence warnings about unused variables in this test
  1027. - Removed unneeded > 0 check
  1028. When checking `userauth_kybd_num_prompts > 100` we don't care if it's also above zero.
  1029. - [Matthew D. Fuller brought this change]
  1030. Spell OpenSS_H_ right when talking about their specific private key (#321)
  1031. Good catch, thanks.
  1032. GitHub (19 Mar 2019)
  1033. - [Will Cosgrove brought this change]
  1034. Silence unused var warnings (#329)
  1035. Silence warnings about unused variables in this test
  1036. Michael Buckley (19 Mar 2019)
  1037. - Fix more scope and printf warning errors
  1038. - Silence unused variable warning
  1039. GitHub (19 Mar 2019)
  1040. - [Will Cosgrove brought this change]
  1041. Removed unneeded > 0 check
  1042. When checking `userauth_kybd_num_prompts > 100` we don't care if it's also above zero.
  1043. Will Cosgrove (19 Mar 2019)
  1044. - [Matthew D. Fuller brought this change]
  1045. Spell OpenSS_H_ right when talking about their specific private key (#321)
  1046. Good catch, thanks.
  1047. Michael Buckley (18 Mar 2019)
  1048. - Fix errors identified by the build process
  1049. - Fix casting errors after merge
  1050. GitHub (18 Mar 2019)
  1051. - [Michael Buckley brought this change]
  1052. Merge branch 'master' into michaelbuckley-security-fixes
  1053. Michael Buckley (18 Mar 2019)
  1054. - Move fallback SIZE_MAX and UINT_MAX to libssh2_priv.h
  1055. - Fix type and logic issues with _libssh2_get_u64
  1056. Daniel Stenberg (17 Mar 2019)
  1057. - examples: fix various compiler warnings
  1058. - lib: fix various compiler warnings
  1059. - session: ignore pedantic warnings for funcpointer <=> void *
  1060. - travis: add a build using configure
  1061. Closes #320
  1062. - configure: provide --enable-werror
  1063. - appveyor: remove old builds that mostly cause failures
  1064. ... and only run on master branch.
  1065. Closes #323
  1066. - cmake: add two missing man pages to get installed too
  1067. Both libssh2_session_handshake.3 and
  1068. libssh2_userauth_publickey_frommemory.3 were installed by the configure
  1069. build already.
  1070. Reported-by: Arfrever on github
  1071. Fixes #278
  1072. - include/libssh2.h: warning: "_WIN64" is not defined, evaluates to 0
  1073. We don't use #if for defines that might not be defined.
  1074. - pem: //-comments are not allowed
  1075. Will Cosgrove (14 Mar 2019)
  1076. - [Daniel Stenberg brought this change]
  1077. userauth: fix "Function call argument is an uninitialized value" (#318)
  1078. Detected by scan-build.
  1079. - fixed unsigned/signed issue
  1080. Daniel Stenberg (15 Mar 2019)
  1081. - session_disconnect: clear state
  1082. If authentication is started but not completed before the application
  1083. gives up and instead wants to shut down the session, the '->state' field
  1084. might still be set and thus effectively dead-lock session_disconnect.
  1085. This happens because both _libssh2_transport_send() and
  1086. _libssh2_transport_read() refuse to do anything as long as state is set
  1087. without the LIBSSH2_STATE_KEX_ACTIVE bit.
  1088. Reported in curl bug https://github.com/curl/curl/issues/3650
  1089. Closes #310
  1090. Will Cosgrove (14 Mar 2019)
  1091. - Release notes from 1.8.1
  1092. Michael Buckley (14 Mar 2019)
  1093. - Use string_buf in sftp_init().
  1094. - Guard against out-of-bounds reads in publickey.c
  1095. - Guard against out-of-bounds reads in session.c
  1096. - Guard against out-of-bounds reads in userauth.c
  1097. - Use LIBSSH2_ERROR_BUFFER_TOO_SMALL instead of LIBSSH2_ERROR_OUT_OF_BOUNDARY in sftp.c
  1098. - Additional bounds checking in sftp.c
  1099. - Additional length checks to prevent out-of-bounds reads and writes in _libssh2_packet_add(). https://libssh2.org/CVE-2019-3862.html
  1100. - Add a required_size parameter to sftp_packet_require et. al. to require callers of these functions to handle packets that are too short. https://libssh2.org/CVE-2019-3860.html
  1101. - Check the length of data passed to sftp_packet_add() to prevent out-of-bounds reads.
  1102. - Prevent zero-byte allocation in sftp_packet_read() which could lead to an out-of-bounds read. https://libssh2.org/CVE-2019-3858.html
  1103. - Sanitize padding_length - _libssh2_transport_read(). https://libssh2.org/CVE-2019-3861.html
  1104. This prevents an underflow resulting in a potential out-of-bounds read if a server sends a too-large padding_length, possibly with malicious intent.
  1105. - Defend against writing beyond the end of the payload in _libssh2_transport_read().
  1106. - Defend against possible integer overflows in comp_method_zlib_decomp.
  1107. GitHub (14 Mar 2019)
  1108. - [Will Cosgrove brought this change]
  1109. Security fixes (#315)
  1110. * Bounds checks
  1111. Fixes for CVEs
  1112. https://www.libssh2.org/CVE-2019-3863.html
  1113. https://www.libssh2.org/CVE-2019-3856.html
  1114. * Packet length bounds check
  1115. CVE
  1116. https://www.libssh2.org/CVE-2019-3855.html
  1117. * Response length check
  1118. CVE
  1119. https://www.libssh2.org/CVE-2019-3859.html
  1120. * Bounds check
  1121. CVE
  1122. https://www.libssh2.org/CVE-2019-3857.html
  1123. * Bounds checking
  1124. CVE
  1125. https://www.libssh2.org/CVE-2019-3859.html
  1126. and additional data validation
  1127. * Check bounds before reading into buffers
  1128. * Bounds checking
  1129. CVE
  1130. https://www.libssh2.org/CVE-2019-3859.html
  1131. * declare SIZE_MAX and UINT_MAX if needed
  1132. - [Will Cosgrove brought this change]
  1133. fixed type warnings (#309)
  1134. - [Will Cosgrove brought this change]
  1135. Bumping version number for pending 1.8.1 release
  1136. Will Cosgrove (4 Mar 2019)
  1137. - [Daniel Stenberg brought this change]
  1138. _libssh2_string_buf_free: use correct free (#304)
  1139. Use LIBSSH2_FREE() here, not free(). We allow memory function
  1140. replacements so free() is rarely the right choice...
  1141. GitHub (26 Feb 2019)
  1142. - [Will Cosgrove brought this change]
  1143. Fix for building against libreSSL #302
  1144. Changed to use the check we use elsewhere.
  1145. - [Will Cosgrove brought this change]
  1146. Fix for when building against LibreSSL #302
  1147. Will Cosgrove (25 Feb 2019)
  1148. - [gartens brought this change]
  1149. docs: update libssh2_hostkey_hash.3 [ci skip] (#301)
  1150. GitHub (21 Feb 2019)
  1151. - [Will Cosgrove brought this change]
  1152. fix malloc/free mismatches #296 (#297)
  1153. - [Will Cosgrove brought this change]
  1154. Replaced malloc with calloc #295
  1155. - [Will Cosgrove brought this change]
  1156. Abstracted OpenSSL calls out of hostkey.c (#294)
  1157. - [Will Cosgrove brought this change]
  1158. Fix memory dealloc impedance mis-match #292 (#293)
  1159. When using ed25519 host keys and a custom memory allocator.
  1160. - [Will Cosgrove brought this change]
  1161. Added call to OpenSSL_add_all_digests() #288
  1162. For OpenSSL 1.0.x we need to call OpenSSL_add_all_digests().
  1163. Will Cosgrove (12 Feb 2019)
  1164. - [Zhen-Huan HWANG brought this change]
  1165. SFTP: increase maximum packet size to 256K (#268)
  1166. to match implementations like OpenSSH.
  1167. - [Zenju brought this change]
  1168. Fix https://github.com/libssh2/libssh2/pull/271 (#284)
  1169. GitHub (16 Jan 2019)
  1170. - [Will Cosgrove brought this change]
  1171. Agent NULL check in shutdown #281
  1172. Will Cosgrove (15 Jan 2019)
  1173. - [Adrian Moran brought this change]
  1174. mbedtls: Fix leak of 12 bytes by each key exchange. (#280)
  1175. Correctly free ducts by calling _libssh2_mbedtls_bignum_free() in dtor.
  1176. - [alex-weaver brought this change]
  1177. Fix error compiling on Win32 with STDCALL=ON (#275)
  1178. GitHub (8 Nov 2018)
  1179. - [Will Cosgrove brought this change]
  1180. Allow default permissions to be used in sftp_mkdir (#271)
  1181. Added constant LIBSSH2_SFTP_DEFAULT_MODE to use the server default permissions when making a new directory
  1182. Will Cosgrove (13 Sep 2018)
  1183. - [Giulio Benetti brought this change]
  1184. openssl: fix dereferencing ambiguity potentially causing build failure (#267)
  1185. When dereferencing from *aes_ctr_cipher, being a pointer itself,
  1186. ambiguity can occur; fixed possible build errors.
  1187. Viktor Szakats (12 Sep 2018)
  1188. - win32/GNUmakefile: define HAVE_WINDOWS_H
  1189. This macro was only used in test/example code before, now it is
  1190. also used in library code, but only defined automatically by
  1191. automake/cmake, so let's do the same for the standalone win32
  1192. make file.
  1193. It'd be probably better to just rely on the built-in _WIN32 macro
  1194. to detect the presence of windows.h though. It's already used
  1195. in most of libssh2 library code. There is a 3rd, similar macro
  1196. named LIBSSH2_WIN32, which might also be replaced with _WIN32.
  1197. Ref: https://github.com/libssh2/libssh2/commit/8b870ad771cbd9cd29edbb3dbb0878e950f868ab
  1198. Closes https://github.com/libssh2/libssh2/pull/266
  1199. Marc Hoersken (2 Sep 2018)
  1200. - Fix conditional check for HAVE_DECL_SECUREZEROMEMORY
  1201. "Unlike the other `AC_CHECK_*S' macros, when a symbol is not declared,
  1202. HAVE_DECL_symbol is defined to `0' instead of leaving HAVE_DECL_symbol
  1203. undeclared. When you are sure that the check was performed,
  1204. use HAVE_DECL_symbol in #if."
  1205. Source: autoconf documentation for AC_CHECK_DECLS.
  1206. - Fix implicit declaration of function 'SecureZeroMemory'
  1207. Include window.h in order to use SecureZeroMemory on Windows.
  1208. - Fix implicit declaration of function 'free' by including stdlib.h
  1209. GitHub (27 Aug 2018)
  1210. - [Will Cosgrove brought this change]
  1211. Use malloc abstraction function in pem parse
  1212. Fix warning on WinCNG build.
  1213. - [Will Cosgrove brought this change]
  1214. Fixed possible junk memory read in sftp_stat #258
  1215. - [Will Cosgrove brought this change]
  1216. removed INT64_C define (#260)
  1217. No longer used.
  1218. - [Will Cosgrove brought this change]
  1219. Added conditional around engine.h include
  1220. Will Cosgrove (6 Aug 2018)
  1221. - [Alex Crichton brought this change]
  1222. Fix OpenSSL link error with `no-engine` support (#259)
  1223. This commit fixes linking against an OpenSSL library that was compiled with
  1224. `no-engine` support by bypassing the initialization routines as they won't be
  1225. available anyway.
  1226. GitHub (2 Aug 2018)
  1227. - [Will Cosgrove brought this change]
  1228. ED25519 Key Support #39 (#248)
  1229. OpenSSH Key and ED25519 support #39
  1230. Added _libssh2_explicit_zero() to explicitly zero sensitive data in memory #120
  1231. * ED25519 Key file support - Requires OpenSSL 1.1.1 or later
  1232. * OpenSSH Key format reading support - Supports RSA/DSA/ECDSA/ED25519 types
  1233. * New string buffer reading functions - These add build-in bounds checking and convenance methods. Used for OpenSSL PEM file reading.
  1234. * Added new tests for OpenSSH formatted Keys
  1235. - [Will Cosgrove brought this change]
  1236. ECDSA key types are now explicit (#251)
  1237. * ECDSA key types are now explicit
  1238. Issue was brough up in pull request #248
  1239. Will Cosgrove (2 May 2018)
  1240. - [Jakob Egger brought this change]
  1241. Add Instructions for building from Master (#249)
  1242. GitHub (27 Apr 2018)
  1243. - [Will Cosgrove brought this change]
  1244. Initialize sb_intl #226
  1245. Will Cosgrove (19 Apr 2018)
  1246. - [doublex brought this change]
  1247. buffer overflow (valgrind) (#159)
  1248. - [Brendan Shanks brought this change]
  1249. mbedTLS: Remove some C99-style intermingled variable declarations (#196)
  1250. GitHub (18 Apr 2018)
  1251. - [Will Cosgrove brought this change]
  1252. fix for #160
  1253. Will Cosgrove (18 Apr 2018)
  1254. - [doublex brought this change]
  1255. fix memory leak when using mbedtls backend (#158)
  1256. _libssh2_bn_init_from_bin/_libssh2_bn_free would leak bignum from mbedtls_calloc().
  1257. - [Brendan Shanks brought this change]
  1258. mbedTLS: Avoid multiple definition errors for context handles (#197)
  1259. - [Tseng Jun brought this change]
  1260. Fix the EVP cipher meth memory leakage problem (#244)
  1261. * Fix the EVP cipher meth memory leakage problem
  1262. Looks good, thanks for the fixes.
  1263. Marc Hörsken (31 Mar 2018)
  1264. - [Will Cosgrove brought this change]
  1265. Added ECDSA defines for WinCNG (#245)
  1266. Fixed missing defines preventing building using WinCNG
  1267. GitHub (30 Mar 2018)
  1268. - [Will Cosgrove brought this change]
  1269. Fix for _libssh2_rsa_new with OpenSSL 1.0.x
  1270. missing d value assignment.
  1271. Will Cosgrove (20 Mar 2018)
  1272. - [Etienne Samson brought this change]
  1273. A collection of small fixes (#198)
  1274. * tests: Remove if-pyramids
  1275. * tests: Switch run_command arguments
  1276. * tests: Make run_command a vararg function
  1277. * tests: Xcode doesn't obey CMake's test working directory
  1278. * openssl: move manual AES-CTR cipher into crypto init
  1279. * cmake: Move our include dir before all other include paths
  1280. GitHub (15 Mar 2018)
  1281. - [Will Cosgrove brought this change]
  1282. Fixes incorrect indexing of KEX prefs string
  1283. After stripping out an invalid KEX pref entry, it would incorrectly advance again leaving invalid values in the list.
  1284. Viktor Szakats (13 Mar 2018)
  1285. - tests: fix checksrc warnings
  1286. Also:
  1287. * add 'static' qualifier to file-wide const buffers
  1288. * fix a non-ANSI C89 comment
  1289. * silence a mismatched fprintf() mask warning by adding a cast
  1290. - cmake: recognize OpenSSL 1.1 .dll names
  1291. Also fix some comment typos and a stray tab.
  1292. - docs: update an URL [ci skip]
  1293. Daniel Stenberg (12 Mar 2018)
  1294. - docs/SECURITY: the max embargo is 14 days now
  1295. Viktor Szakats (12 Mar 2018)
  1296. - docs: spelling fixes [ci skip]
  1297. Closes https://github.com/libssh2/libssh2/pull/222
  1298. GitHub (12 Mar 2018)
  1299. - [Will Cosgrove brought this change]
  1300. Fixed minor tabs/spacing issues
  1301. - [Will Cosgrove brought this change]
  1302. Update kex.c
  1303. - [Will Cosgrove brought this change]
  1304. Added basic bounds checking #206
  1305. Basic bounds checking in ecdh_sha2_nistp()
  1306. - [Will Cosgrove brought this change]
  1307. Fixed Clang warning #206
  1308. Fixed possible garbage value for secret in an error case
  1309. - [Will Cosgrove brought this change]
  1310. Fixed incorrect #if to #ifdef #206
  1311. When checking HAVE_OPAQUE_STRUCTS.
  1312. Viktor Szakats (12 Mar 2018)
  1313. - src: suppress two checksrc warnings
  1314. Ref: https://github.com/libssh2/libssh2/pull/235
  1315. - src: address fopen() warnings, add missing copyright headers
  1316. Ref: https://github.com/libssh2/libssh2/pull/235
  1317. - src: replace sprintf() with snprintf()
  1318. Ref: https://github.com/libssh2/libssh2/pull/235
  1319. - src: fix checksrc warnings
  1320. Use checksrc.pl from the curl project, with (for now)
  1321. suppressed long line warnings and indentation set to
  1322. 4 spaces. Fixes are whitespace for the most part.
  1323. Warning count went down from 2704 to 12.
  1324. Also fix codespell typos, two non-ANSI C89 comments
  1325. and a stray tab in include/libssh2.h.
  1326. Ref: https://github.com/libssh2/libssh2/pull/235
  1327. - checksrc: add source style checker
  1328. This is a slightly extended version of this original source
  1329. from the curl project:
  1330. https://github.com/curl/curl/blob/8b754c430b9a4c51aa606c687ee5014faf7c7b06/lib/checksrc.pl
  1331. This version adds the following options to customize it for
  1332. libssh2 (plus some whitespace formatting):
  1333. `-i<n>` to override indentation spaces (2)
  1334. `-m<n>` to override maximum line length (79)
  1335. Command-line used to check libssh2 sources:
  1336. $ ./checksrc.pl -i4 -m500 *.c *.h
  1337. Closes https://github.com/libssh2/libssh2/pull/236
  1338. - src: add static qualifier
  1339. To private, const strings.
  1340. Closes https://github.com/libssh2/libssh2/pull/237
  1341. - [Will Cosgrove brought this change]
  1342. Add support for ECDSA keys and host keys (#41)
  1343. This commit lands full ECDSA key support when using the OpenSSL
  1344. backend. Which includes:
  1345. New KEX methods:
  1346. ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521
  1347. Can now read OpenSSL formatted ECDSA key files.
  1348. Now supports known host keys of type ecdsa-sha2-nistp256.
  1349. New curve types:
  1350. NID_X9_62_prime256v1, NID_secp384r1, NID_secp521r1
  1351. Default host key preferred ordering is now nistp256, nistp384,
  1352. nistp521, rsa, dss.
  1353. Ref: https://github.com/libssh2/libssh2/issues/41
  1354. Closes https://github.com/libssh2/libssh2/pull/206
  1355. GitHub (15 Dec 2017)
  1356. - [Will Cosgrove brought this change]
  1357. Fixed possible crash when decoding invalid data
  1358. When trying to decode invalid data, it frees the buffer but doesn't nil it so the caller gets a junk memory pointer which they could potentially double free.
  1359. - [Will Cosgrove brought this change]
  1360. Remove call to OpenSSL_add_all_ciphers()
  1361. Now lives in libssh2 init() from PR #189
  1362. - [Will Cosgrove brought this change]
  1363. Fixed incorrect reference to decrypted block
  1364. Fixed incorrectly copied memory from p->buf into init instead of from the decrypted buffer block. The only reason this worked was because the crypt() function decrypts the value in-place and overwrites p->buf. I'm working on a fork that no longer does this and exposed this bug.
  1365. Will Cosgrove (20 Oct 2017)
  1366. - [Pan brought this change]
  1367. Fix typo in crypt.c (#218)
  1368. Kamil Dudka (17 Oct 2017)
  1369. - session: avoid printing misleading debug messages
  1370. ... while throwing LIBSSH2_ERROR_EAGAIN out of session_startup()
  1371. If the session runs in blocking mode, LIBSSH2_ERROR_EAGAIN never reaches
  1372. the libssh2 API boundary and, in non-blocking mode, these messages are
  1373. suppressed by the condition in _libssh2_error_flags() anyway.
  1374. Closes #211
  1375. Viktor Szakats (15 Oct 2017)
  1376. - win32/GNUmakefile: allow customizing dll suffixes
  1377. - New `LIBSSH2_DLL_SUFFIX` envvar will add a suffix to the generated
  1378. libssh2 dll name. Useful to add `-x64` to 64-bit builds so that
  1379. it can live in the same directory as the 32-bit one. By default
  1380. this is empty.
  1381. - New `LIBSSH2_DLL_A_SUFFIX` envvar to customize the suffix of the
  1382. generated import library (implib) for libssh2 .dll. It defaults
  1383. to `dll`, and it's useful to modify that to `.dll` to have the
  1384. standard naming scheme for mingw-built .dlls, i.e. `libssh2.dll.a`.
  1385. Ref: https://github.com/curl/curl/commit/aaa16f80256abc1463fd9374815130a165222257
  1386. Closes https://github.com/libssh2/libssh2/pull/215
  1387. - makefile.m32: allow to override gcc, ar and ranlib
  1388. Allow to ovverride certain build tools, making it possible to
  1389. use LLVM/Clang to build libssh2. The default behavior is unchanged.
  1390. To build with clang (as offered by MSYS2), these settings can
  1391. be used:
  1392. LIBSSH2_CC=clang
  1393. LIBSSH2_AR=llvm-ar
  1394. LIBSSH2_RANLIB=llvm-ranlib
  1395. Also adjust ranlib parameters to be compatible with LLVM/Clang's
  1396. ranlib tool.
  1397. Closes https://github.com/libssh2/libssh2/pull/214
  1398. GitHub (27 Sep 2017)
  1399. - [Will Cosgrove brought this change]
  1400. Fixes out of bounds memory access (#210)
  1401. If an invalid PEM file is read and the lines are longer than 128 characters it will go out of bounds and crash on line 91.
  1402. Will Cosgrove (11 Sep 2017)
  1403. - [Kamil Dudka brought this change]
  1404. scp: do not NUL-terminate the command for remote exec (#208)
  1405. It breaks SCP download/upload from/to certain server implementations.
  1406. The bug does not manifest with OpenSSH, which silently drops the NUL
  1407. byte (eventually with any garbage that follows the NUL byte) before
  1408. executing it.
  1409. Bug: https://bugzilla.redhat.com/1489736
  1410. GitHub (21 Aug 2017)
  1411. - [Viktor Szakats brought this change]
  1412. openssl.c: remove no longer used variable (#204)
  1413. after e378d2e30a40bd9bcee06dc3a4250f269098e200
  1414. - [Will Cosgrove brought this change]
  1415. Fix for #188 (#189)
  1416. * Update openssl.c
  1417. * Create openssl.h
  1418. Will Cosgrove (24 May 2017)
  1419. - [Marcel Raad brought this change]
  1420. openssl: fix build with OpenSSL 1.1 API (#176)
  1421. When building with OPENSSL_API_COMPAT=0x10100000L, OpenSSL_add_all_algorithms
  1422. and OpenSSL_add_all_ciphers don't exist. The corresponding functionality is
  1423. handled automatically with OpenSSL 1.1.
  1424. - [Sune Bredahl brought this change]
  1425. Add support for SHA256 hostkey fingerprints (#180)
  1426. Looks good, thanks!
  1427. GitHub (12 May 2017)
  1428. - [Will Cosgrove brought this change]
  1429. Fix memory leak of crypt_ctx->h using openSSL 1.1+ (#177)
  1430. Need to use EVP_CIPHER_CTX_free instead of EVP_CIPHER_CTX_reset.
  1431. Marc Hoersken (2 Mar 2017)
  1432. - tests/openssh_server/authorized_keys: add key_rsa_encrypted.pub
  1433. - tests: add simple test for passphrase-protected PEM file support
  1434. - os400qc3: enable passphrase-protected PEM file support using pem.c
  1435. - pem: fix indentation and replace assert after 386e012292
  1436. - [Keno Fischer brought this change]
  1437. pem: add passphrase-protected PEM file support for libgcrypt and wincng
  1438. Since they use our own PEM parser which did not support encrypted
  1439. PEM files, trying to use such files on these backends failed.
  1440. Fix that by augmenting the PEM parser to support encrypted PEM files.
  1441. - [Thomas brought this change]
  1442. misc: use time constant implementation for AES CTR increment
  1443. - [Thomas brought this change]
  1444. wincng: add AES CTR mode support (aes128-ctr, aes192-ctr, aes256-ctr)
  1445. - [Thomas brought this change]
  1446. openssl: move shared AES-CTR code into misc
  1447. Daniel Stenberg (20 Dec 2016)
  1448. - [Alex Crichton brought this change]
  1449. kex: acknowledge error code from libssh2_dh_key_pair()
  1450. Fixes a segfault using ssh-agent on Windows
  1451. This commit fixes a segfault seen dereferencing a null pointer on
  1452. Windows when using ssh-agent. The problem ended up being that errors
  1453. weren't being communicated all the way through, causing null pointers to
  1454. be used when functions should have bailed out sooner.
  1455. The `_libssh2_dh_key_pair` function for WinCNG was modified to propagate
  1456. errors, and then the two callsites in kex.c of
  1457. `diffie_hellman_sha{1,256}` were updated to recognize this error and
  1458. bail out.
  1459. Fixes #162
  1460. Closes #163
  1461. Alexander Lamaison (27 Nov 2016)
  1462. - [monnerat brought this change]
  1463. Implement Diffie-Hellman computations in crypto backends. (#149)
  1464. Not all backends feature the low level API needed to compute a Diffie-Hellman
  1465. secret, but some of them directly implement Diffie-Hellman support with opaque
  1466. private data. The later approach is now generalized and backends are
  1467. responsible for all Diffie Hellman computations.
  1468. As a side effect, procedures/macros _libssh2_bn_rand and _libssh2_bn_mod_exp
  1469. are no longer needed outside the backends.
  1470. Peter Stuge (16 Nov 2016)
  1471. - acinclude.m4: The mbedtls crypto backend actually requires libmbedcrypto
  1472. Examples can't be linked with libmbedtls but need libmbedcrypto, and
  1473. any users of libssh2 which use libtool and libssh2.la would encounter
  1474. the same problem.
  1475. This changes the mbedtls detection to search for libmbedcrypto, which
  1476. is the actual dependency for the backend.
  1477. - acinclude.m4: Add CPPFLAGS=-I$prefix-dir/include in LIBSSH2_LIB_HAVE_LINKFLAGS
  1478. This is absolutely neccessary for header files to be found when
  1479. AC_LIB_HAVE_LINKFLAGS searches for libraries.
  1480. - acinclude.m4: Make saved variables in LIBSSH2_LIB_HAVE_LINKFLAGS uniform
  1481. - docs/HACKING.CRYPTO: Improve documentation for autoconf build system
  1482. Alexander Lamaison (16 Nov 2016)
  1483. - [Alex Arslan brought this change]
  1484. Check for netinet/in.h in the tests cmake file (#148)
  1485. - [Patrick Monnerat brought this change]
  1486. Define new Diffie-Hellman context for mbedTLS
  1487. - [monnerat brought this change]
  1488. Make libssh2 work again on os400. (#118)
  1489. * os400: minimum supported OS version is now V6R1.
  1490. Do not log compiler informational messages.
  1491. * Implement crypto backend specific Diffie-Hellman computation.
  1492. This feature is now needed on os400 because the QC3 library does not
  1493. implement bn_mod_exp() natively. Up to now, this function was emulated using
  1494. an RSA encryption, but commits ca5222ea819cc5ed797860070b4c6c1aeeb28420 and
  1495. 7934c9ce2a029c43e3642a492d3b9e494d1542be (CVE-2016-0787) broke the emulation
  1496. because QC3 only supports RSA exponents up to 512 bits.
  1497. Happily, QC3 supports a native API for Diffie-Hellman computation, with
  1498. opaque random value: this commit implements the use of this API and, as a
  1499. side effect, enables support of this feature for any other crypto backend that
  1500. would use it.
  1501. A "generic" Diffie-Hellman computation internal API supports crypto backends
  1502. not implementing their own: this generic API uses the same functions as before.
  1503. * Fix typos in docs/HACKING.CRYPTO.
  1504. - [Peter Stuge brought this change]
  1505. acinclude.m4: Fixup OpenSSL EVP_aes_128_ctr() detection
  1506. - [Peter Stuge brought this change]
  1507. configure.ac: Add --with-crypto= instead of many different --with-$backend
  1508. The new --with-crypto option replaces the previous backend-specific
  1509. --with-{openssl,libgcrypt,mbedtls,wincng} options and fixes some issues.
  1510. * libgcrypt or mbedtls would previously be used whenever found, even
  1511. if configure was passed --without-libgcrypt or --without-mbedtls.
  1512. * If --with-$backend was specified then configure would not fail even
  1513. if that library could not be found, and would instead use whichever
  1514. crypto library was found first.
  1515. The new option defaults to `auto`, which makes configure check for all
  1516. supported crypto libraries in turn, choosing the first one found, or
  1517. exiting with an error if none can be found.
  1518. - [Tony Kelman brought this change]
  1519. Build mbedtls from source on Travis (#133)
  1520. * Revert "Revert "travis: Test mbedtls too""
  1521. This reverts commit c4c60eac5ca756333034b07dd9e0b97741493ed3.
  1522. * travis: Build mbedtls from source on Travis
  1523. Use TOOLCHAIN_OPTION when calling cmake on mbedtls
  1524. * tests: only run DSA tests for non-mbedtls
  1525. crypto backends
  1526. - [Peter Stuge brought this change]
  1527. configure.ac src/Makefile.am: Remove dead AM_CONDITIONAL(OS400QC3)
  1528. According to os400/README400 this backend can not be built
  1529. with configure+make, and the conditional is hard coded to false.
  1530. - [Peter Stuge brought this change]
  1531. configure.ac: Add -DNDEBUG to CPPFLAGS in non-debug builds
  1532. There are a few uses of assert() in channel.c, sftp.c and transport.c.
  1533. - [Peter Stuge brought this change]
  1534. src/global.c: Fix conditional AES-CTR support
  1535. Most of libssh2 already has conditional support for AES-CTR according to
  1536. the LIBSSH2_AES_CTR crypto backend #define, but global.c needed fixing.
  1537. - [Peter Stuge brought this change]
  1538. src/crypto.h src/userauth.c: Fix conditional RSA support
  1539. Most of libssh2 already has conditional support for RSA according to
  1540. the LIBSSH2_RSA crypto backend #define, but crypto.h and userauth.c
  1541. needed a few small fixes.
  1542. - [Peter Stuge brought this change]
  1543. src/kex.c: Cast libssh2_sha{1,256}_update data arguments properly
  1544. The update functions take a const unsigned char * but were called
  1545. with (const) char * in some places, causing unneccessary warnings.
  1546. - [Peter Stuge brought this change]
  1547. docs/HACKING.CRYPTO: Fix two type typos
  1548. - [Sergei Trofimovich brought this change]
  1549. acinclude.m4: fix ./configure --with-libgcrypt
  1550. The change fixes passing of bogus gcrypt prefix.
  1551. Reproducible as:
  1552. $ ./configure --with-libgcrypt
  1553. $ make V=1
  1554. ...
  1555. /bin/sh ../libtool --tag=CC --mode=link gcc -g -O2 -Iyes/include -version-info 1:1:0 -no-undefined -export-symbols-regex '^libssh2_.*' -lgcrypt -lz -Lyes/lib -o libssh2.la -rpath /usr/local/lib channel.lo comp.lo crypt.lo hostkey.lo kex.lo mac.lo misc.lo packet.lo publickey.lo scp.lo session.lo sftp.lo userauth.lo transport.lo version.lo knownhost.lo agent.lo libgcrypt.lo pem.lo keepalive.lo global.lo -lgcrypt
  1556. ../libtool: line 7475: cd: yes/lib: No such file or directory
  1557. libtool: error: cannot determine absolute directory name of 'yes/lib'
  1558. These
  1559. -Iyes/include
  1560. -Lyes/lib
  1561. come from libgcrypt code autodetection:
  1562. if test -n "$use_libgcrypt" && test "$use_libgcrypt" != "no"; then
  1563. LDFLAGS="$LDFLAGS -L$use_libgcrypt/lib"
  1564. CFLAGS="$CFLAGS -I$use_libgcrypt/include"
  1565. I assume it's a typo to use yes/no flag as a prefix and changed
  1566. it to '$with_libgcrypt_prefix'.
  1567. Reported-by: Mikhail Pukhlikov <[email protected]>
  1568. Signed-off-by: Sergei Trofimovich <[email protected]>
  1569. - [Zenju brought this change]
  1570. libssh2_sftp_init hang: last error not set
  1571. The problem is that the original if statement simply returns NULL, but does not set the session last error code. The consequence is that libssh2_sftp_init() also returns NULL and libssh2_session_last_errno(sshSession) == LIBSSH2_ERROR_NONE.
  1572. In my test the LIBSSH2_ERROR_EAGAIN is coming from sftp.c row 337:
  1573. if(4 != sftp->partial_size_len)
  1574. /* we got a short read for the length part */
  1575. return LIBSSH2_ERROR_EAGAIN;
  1576. with "partial_size_len == 0". Not sure if this is expected.
  1577. - [Aidan Hobson Sayers brought this change]
  1578. docs: correctly describe channel_wait_eof
  1579. channel_wait_eof waits for channel->remote.eof, which is set on
  1580. receiving a `SSH_MSG_CHANNEL_EOF` message. This message is sent
  1581. when a party has no more data to send on a channel.
  1582. - [Zenju brought this change]
  1583. Fix MSVC 14 compilation warning (#92)
  1584. 1> sftp.c
  1585. 1>libssh2-files\src\sftp.c(3393): warning C4456: declaration of 'retcode' hides previous local declaration
  1586. 1> libssh2-files\src\sftp.c(3315): note: see declaration of 'retcode'
  1587. - [Salvador Fandino brought this change]
  1588. LIBSSH2_ERROR_CHANNEL_WINDOW_FULL: add new error code
  1589. In order to signal that the requested operation can not succeed
  1590. because the receiving window had been exhausted, the error code
  1591. LIBSSH2_ERROR_BUFFER_TOO_SMALL has been reused but I have found
  1592. that in certain context it may be ambigous.
  1593. This patch introduces a new error code,
  1594. LIBSSH2_ERROR_CHANNEL_WINDOW_FULL, exclusive to signal that condition.
  1595. - [Salvador Fandino brought this change]
  1596. channel_wait_eof: handle receive window exhaustion
  1597. Until now, in blocking mode, if the remote receiving window is
  1598. exhausted this function hangs forever as data is not read and the
  1599. remote side just keeps waiting for the window to grow before sending
  1600. more data.
  1601. This patch, makes this function check for that condition and abort
  1602. with an error when it happens.
  1603. - [Salvador Fandino brought this change]
  1604. channel_wait_closed: don't fail when unread data is queued
  1605. This function was calling channel_wait_eof to ensure that the EOF
  1606. packet has already been received, but that function also checks that
  1607. the read data queue is empty before reporting the EOF. That caused
  1608. channel_wait_closed to fail with a LIBSSH2_ERROR_INVAL when some data
  1609. was queued even after a successful call to libssh2_channel_wait_eof.
  1610. This patch changes libssh2_channel_wait_closed to look directly into
  1611. channel->remote.eof so that both libssh2_channel_wait_eof and
  1612. libssh2_channel_wait_closed bahave consistently.
  1613. - [Salvador Fandino brought this change]
  1614. channel_wait_eof: fix debug message
  1615. Daniel Stenberg (25 Oct 2016)
  1616. - libssh2.h: start working on 1.8.1
  1617. Version 1.8.0 (25 Oct 2016)
  1618. Daniel Stenberg (25 Oct 2016)
  1619. - RELEASE-NOTES: adjusted for 1.8.0
  1620. Kamil Dudka (20 Oct 2016)
  1621. - Revert "aes: the init function fails when OpenSSL has AES support"
  1622. This partially reverts commit f4f2298ef3635acd031cc2ee0e71026cdcda5864
  1623. because it caused the compatibility code to call initialization routines
  1624. redundantly, leading to memory leakage with OpenSSL 1.1 and broken curl
  1625. test-suite in Fedora:
  1626. 88 bytes in 1 blocks are definitely lost in loss record 5 of 8
  1627. at 0x4C2DB8D: malloc (vg_replace_malloc.c:299)
  1628. by 0x72C607D: CRYPTO_zalloc (mem.c:100)
  1629. by 0x72A2480: EVP_CIPHER_meth_new (cmeth_lib.c:18)
  1630. by 0x4E5A550: make_ctr_evp.isra.0 (openssl.c:407)
  1631. by 0x4E5A8E8: _libssh2_init_aes_ctr (openssl.c:471)
  1632. by 0x4E5BB5A: libssh2_init (global.c:49)
  1633. Daniel Stenberg (19 Oct 2016)
  1634. - [Charles Collicutt brought this change]
  1635. libssh2_wait_socket: Fix comparison with api_timeout to use milliseconds (#134)
  1636. Fixes #74
  1637. - [Charles Collicutt brought this change]
  1638. Set err_msg on _libssh2_wait_socket errors (#135)
  1639. - Revert "travis: Test mbedtls too"
  1640. This reverts commit 3e6de50a24815e72ec5597947f1831f6083b7da8.
  1641. Travis doesn't seem to support the mbedtls-dev package
  1642. - maketgz: support "only" to only update version number locally
  1643. and fix the date output locale
  1644. - configure: make the --with-* options override the OpenSSL default
  1645. ... previously it would default to OpenSSL even with the --with-[crypto]
  1646. options used unless you specificly disabled OpenSSL. Now, enabling another
  1647. backend will automatically disable OpenSSL if the other one is found.
  1648. - [Keno Fischer brought this change]
  1649. docs: Add documentation on new cmake/configure options
  1650. - [Keno Fischer brought this change]
  1651. configure: Add support for building with mbedtls
  1652. - [wildart brought this change]
  1653. travis: Test mbedtls too
  1654. - [wildart brought this change]
  1655. crypto: add support for the mbedTLS backend
  1656. Closes #132
  1657. - [wildart brought this change]
  1658. cmake: Add CLEAR_MEMORY option, analogously to that for autoconf
  1659. - README.md: fix link typo
  1660. - README: markdown version to look nicer on github
  1661. Viktor Szakats (5 Sep 2016)
  1662. - [Taylor Holberton brought this change]
  1663. openssl: add OpenSSL 1.1.0 compatibility
  1664. Daniel Stenberg (4 Sep 2016)
  1665. - [Antenore Gatta brought this change]
  1666. tests: HAVE_NETINET_IN_H was not defined correctly (#127)
  1667. Fixes #125
  1668. - SECURITY: fix web site typo
  1669. - SECURITY: security process
  1670. GitHub (14 Aug 2016)
  1671. - [Alexander Lamaison brought this change]
  1672. Basic dockerised test suite.
  1673. This introduces a test suite for libssh2. It runs OpenSSH in a Docker
  1674. container because that works well on Windows (via docker-machine) as
  1675. well as Linux. Presumably it works on Mac too with docker-machine, but
  1676. I've not tested that.
  1677. Because the test suite is docker-machine aware, you can also run it
  1678. against a cloud provider, for more realistic network testing, by setting
  1679. your cloud provider as your active docker machine. The Appveyor CI setup
  1680. in this commit does that because Appveyor doesn't support docker
  1681. locally.
  1682. Kamil Dudka (3 Aug 2016)
  1683. - [Viktor Szakats brought this change]
  1684. misc.c: Delete unused static variables
  1685. Closes #114
  1686. Daniel Stenberg (9 Apr 2016)
  1687. - [Will Cosgrove brought this change]
  1688. Merge pull request #103 from willco007/patch-2
  1689. Fix for security issue CVE-2016-0787
  1690. Alexander Lamaison (2 Apr 2016)
  1691. - [Zenju brought this change]
  1692. Fix MSVC 14 compilation errors
  1693. For _MSC_VER == 1900 these macros are not needed and create problems:
  1694. 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition (compiling source file libssh2-files\src\mac.c)
  1695. 1> \win32\libssh2_config.h(27): note: see previous definition of 'snprintf' (compiling source file libssh2-files\src\mac.c)
  1696. 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration (compiling source file libssh2-files\src\mac.c)
  1697. Daniel Stenberg (26 Mar 2016)
  1698. - [Brad Harder brought this change]
  1699. _libssh2_channel_open: speeling error fixed in channel error message
  1700. Alexander Lamaison (15 Mar 2016)
  1701. - Link with crypt32.lib on Windows.
  1702. Makes linking with static OpenSSL work again. Although it's not
  1703. required for dynamic OpenSSL, it does no harm.
  1704. Fixes #98.
  1705. - [Craig A. Berry brought this change]
  1706. Tweak VMS help file building.
  1707. Primarily this is handling cases where top-level files moved into
  1708. the docs/ directory. I also corrected a typo and removed the
  1709. claim that libssh2 is public domain.
  1710. - [Craig A. Berry brought this change]
  1711. Build with standard stat structure on VMS.
  1712. This gets us large file support, is available on any VMS release
  1713. in the last decade and more, and gives stat other modern features
  1714. such as 64-bit ino_t.
  1715. - [Craig A. Berry brought this change]
  1716. Update vms/libssh2_config.h.
  1717. VMS does have stdlib.h, gettimeofday(), and OpenSSL. The latter
  1718. is appropriate to hard-wire in the configuration because it's
  1719. installed by default as part of the base operating system and
  1720. there is currently no libgcrypt port.
  1721. - [Craig A. Berry brought this change]
  1722. VMS can't use %zd for off_t format.
  1723. %z is a C99-ism that VMS doesn't currently have; even though the
  1724. compiler is C99-compliant, the library isn't quite. The off_t used
  1725. for the st_size element of the stat can be 32-bit or 64-bit, so
  1726. detect what we've got and pick a format accordingly.
  1727. - [Craig A. Berry brought this change]
  1728. Normalize line endings in libssh2_sftp_get_channel.3.
  1729. Somehow it got Windows-style CRLF endings so convert to just LF,
  1730. for consistency as well as not to confuse tools that will regard
  1731. the \r as content (e.g. the OpenVMS help librarian).
  1732. Dan Fandrich (29 Feb 2016)
  1733. - libgcrypt: Fixed a NULL pointer dereference on OOM
  1734. Daniel Stenberg (24 Feb 2016)
  1735. - [Viktor Szakats brought this change]
  1736. url updates, HTTP => HTTPS
  1737. Closes #87
  1738. Dan Fandrich (23 Feb 2016)
  1739. - RELEASE-NOTES: removed some duplicated names
  1740. Version 1.7.0 (23 Feb 2016)
  1741. Daniel Stenberg (23 Feb 2016)
  1742. - web: the site is now HTTPS
  1743. - RELEASE-NOTES: 1.7.0 release
  1744. - diffie_hellman_sha256: convert bytes to bits
  1745. As otherwise we get far too small numbers.
  1746. Reported-by: Andreas Schneider
  1747. CVE-2016-0787
  1748. Alexander Lamaison (18 Feb 2016)
  1749. - Allow CI failures with VS 2008 x64.
  1750. Appveyor doesn't support this combination.
  1751. Daniel Stenberg (16 Feb 2016)
  1752. - [Viktor Szakats brought this change]
  1753. GNUmakefile: list system libs after user libs
  1754. Otherwise some referenced WinSock functions will fail to
  1755. resolve when linking against LibreSSL 2.3.x static libraries
  1756. with mingw.
  1757. Closes #80
  1758. - [Viktor Szakats brought this change]
  1759. openssl: apply new HAVE_OPAQUE_STRUCTS macro
  1760. Closes #81
  1761. - [Viktor Szakats brought this change]
  1762. openssl: fix LibreSSL support after OpenSSL 1.1.0-pre1/2 support
  1763. Alexander Lamaison (14 Feb 2016)
  1764. - sftp.h: Fix non-C90 type.
  1765. uint64_t does not exist in C90. Use libssh2_uint64_t instead.
  1766. - Exclude sshd tests from AppVeyor.
  1767. They fail complaining that sshd wasn't invoked with an absolute path.
  1768. - Test on more versions of Visual Studio.
  1769. - Fix Appveyor builds.
  1770. Daniel Stenberg (14 Feb 2016)
  1771. - [Viktor Szakats brought this change]
  1772. openssl: add OpenSSL 1.1.0-pre3-dev compatibility
  1773. by using API instead of accessing an internal structure.
  1774. Closes #83
  1775. - RELEASE-NOTES: synced with 996b04ececdf
  1776. - include/libssh2.h: next version is 1.7.0
  1777. - configure: build "silent" if possible
  1778. - sftp: re-indented some minor stuff
  1779. - [Jakob Egger brought this change]
  1780. sftp.c: ensure minimum read packet size
  1781. For optimum performance we need to ensure we don't request tiny packets.
  1782. - [Jakob Egger brought this change]
  1783. sftp.c: Explicit return values & sanity checks
  1784. - [Jakob Egger brought this change]
  1785. sftp.c: Check Read Packet File Offset
  1786. This commit adds a simple check to see if the offset of the read
  1787. request matches the expected file offset.
  1788. We could try to recover, from this condition at some point in the future.
  1789. Right now it is better to return an error instead of corrupted data.
  1790. - [Jakob Egger brought this change]
  1791. sftp.c: Don't return EAGAIN if data was written to buffer
  1792. - [Jakob Egger brought this change]
  1793. sftp.c: Send at least one read request before reading
  1794. This commit ensures that we have sent at least one read request before
  1795. we try to read data in sftp_read().
  1796. Otherwise sftp_read() would return 0 bytes (indicating EOF) if the
  1797. socket is not ready for writing.
  1798. - [Jakob Egger brought this change]
  1799. sftp.c: stop reading when buffer is full
  1800. Since we can only store data from a single chunk in filep,
  1801. we have to stop receiving data as soon as the buffer is full.
  1802. This adresses the following bug report:
  1803. https://github.com/libssh2/libssh2/issues/50
  1804. Salvador Fandiño (21 Jan 2016)
  1805. - agent_disconnect_unix: unset the agent fd after closing it
  1806. "agent_disconnect_unix", called by "libssh2_agent_disconnect", was
  1807. leaving the file descriptor in the agent structure unchanged. Later,
  1808. "libssh2_agent_free" would call again "libssh2_agent_disconnect" under
  1809. the hood and it would try to close again the same file descriptor. In
  1810. most cases that resulted in just a harmless error, but it is also
  1811. possible that the file descriptor had been reused between the two
  1812. calls resulting in the closing of an unrelated file descriptor.
  1813. This patch sets agent->fd to LIBSSH2_INVALID_SOCKET avoiding that
  1814. issue.
  1815. Signed-off-by: Salvador Fandiño <[email protected]>
  1816. Daniel Stenberg (18 Jan 2016)
  1817. - [Patrick Monnerat brought this change]
  1818. os400qc3: support encrypted private keys
  1819. PKCS#8 EncryptedPrivateKeyinfo structures are recognized and decoded to get
  1820. values accepted by the Qc3 crypto library.
  1821. - [Patrick Monnerat brought this change]
  1822. os400qc3: New PKCS#5 decoder
  1823. The Qc3 library is not able to handle PKCS#8 EncryptedPrivateKeyInfo structures
  1824. by itself. It is only capable of decrypting the (encrypted) PrivateKeyInfo
  1825. part, providing a key encryption key and an encryption algorithm are given.
  1826. Since the encryption key and algorithm description part in a PKCS#8
  1827. EncryptedPrivateKeyInfo is a PKCS#5 structure, such a decoder is needed to
  1828. get the derived key method and hash, as well as encryption algorith and
  1829. initialisation vector.
  1830. - [Patrick Monnerat brought this change]
  1831. os400qc3: force continuous update on non-final hash/hmac computation
  1832. - [Patrick Monnerat brought this change]
  1833. os400qc3: Be sure hmac keys have a minimum length
  1834. The Qc3 library requires a minimum key length depending on the target
  1835. hash algorithm. Append binary zeroes to the given key if not long enough.
  1836. This matches RFC 2104 specifications.
  1837. - [Patrick Monnerat brought this change]
  1838. os400qc3: Slave descriptor for key encryption key
  1839. The Qc3 library requires the key encryption key to exist as long as
  1840. the encrypted key is used. Its descriptor token is then kept as an
  1841. "encrypted key slave" for recursive release.
  1842. - [Patrick Monnerat brought this change]
  1843. os400qc3.c: comment PEM/DER decoding
  1844. - [Patrick Monnerat brought this change]
  1845. os400qc3.c: improve ASN.1 header byte checks
  1846. - [Patrick Monnerat brought this change]
  1847. os400qc3.c: improve OID matching
  1848. - [Patrick Monnerat brought this change]
  1849. os400: os400qc3.c: replace malloc by LIBSSH2_ALLOC or alloca where possible
  1850. - [Patrick Monnerat brought this change]
  1851. os400: asn1_new_from_bytes(): use data from a single element only
  1852. - [Patrick Monnerat brought this change]
  1853. os400: fix an ILE/RPG prototype
  1854. - [Patrick Monnerat brought this change]
  1855. os400: implement character encoding conversion support
  1856. - [Patrick Monnerat brought this change]
  1857. os400: do not miss some external prototypes
  1858. Build procedure extproto() did not strip braces from header files, thus
  1859. possibly prepended them to true prototypes. This prevented the prototype to
  1860. be recognized as such.
  1861. The solution implemented here is to map braces to semicolons, effectively
  1862. considering them as potential prototype delimiters.
  1863. - [Patrick Monnerat brought this change]
  1864. os400: Really add specific README
  1865. - [Patrick Monnerat brought this change]
  1866. os400: Add specific README and include new files in dist tarball
  1867. - [Patrick Monnerat brought this change]
  1868. os400: add compilation scripts
  1869. - [Patrick Monnerat brought this change]
  1870. os400: include files for ILE/RPG
  1871. In addition, file os400/macros.h declares all procedures originally
  1872. defined as macros. It must not be used for real inclusion and is only
  1873. intended to be used as a `database' for macro wrapping procedures generation.
  1874. - [Patrick Monnerat brought this change]
  1875. os400: add supplementary header files/wrappers. Define configuration.
  1876. - [Patrick Monnerat brought this change]
  1877. Protect callback function calls from macro substitution
  1878. Some structure fields holding callback addresses have the same name as the
  1879. underlying system function (connect, send, recv). Set parentheses around
  1880. their reference to suppress a possible macro substitution.
  1881. Use a macro for connect() on OS/400 to resolve a const/nonconst parameter
  1882. problem.
  1883. - [Patrick Monnerat brought this change]
  1884. Add interface for OS/400 crypto library QC3
  1885. - [Patrick Monnerat brought this change]
  1886. misc: include stdarg.h for debug code
  1887. - [Patrick Monnerat brought this change]
  1888. Document crypto library interface
  1889. - [Patrick Monnerat brought this change]
  1890. Feature an optional crypto-specific macro to rsa sign a data fragment vector
  1891. OS/400 crypto library is unable to sign a precomputed SHA1 hash: however
  1892. it does support a procedure that hashes data fragments and rsa signs.
  1893. If defined, the new macro _libssh2_rsa_sha1_signv() implements this function
  1894. and disables use of _libssh2_rsa_sha1_sign().
  1895. The function described above requires that the struct iovec unused slacks are
  1896. cleared: for this reason, macro libssh2_prepare_iovec() has been introduced.
  1897. It should be defined as empty for crypto backends that are not sensitive
  1898. to struct iovec unused slack values.
  1899. - [Patrick Monnerat brought this change]
  1900. Fold long lines in include files
  1901. - [Viktor Szakats brought this change]
  1902. kex.c: fix indentation
  1903. Closes #71
  1904. - [Viktor Szakats brought this change]
  1905. add OpenSSL-1.1.0-pre2 compatibility
  1906. Closes #70
  1907. - [Viktor Szakats brought this change]
  1908. add OpenSSL 1.1.0-pre1 compatibility
  1909. * close https://github.com/libssh2/libssh2/issues/69
  1910. * sync a declaration with the rest of similar ones
  1911. * handle EVP_MD_CTX_new() returning NULL with OpenSSL 1.1.0
  1912. * fix potential memory leak with OpenSSL 1.1.0 in
  1913. _libssh2_*_init() functions, when EVP_MD_CTX_new() succeeds,
  1914. but EVP_DigestInit() fails.
  1915. Marc Hoersken (22 Dec 2015)
  1916. - wincng.c: fixed _libssh2_wincng_hash_final return value
  1917. _libssh2_wincng_hash_final was returning the internal BCRYPT
  1918. status code instead of a valid libssh2 return value (0 or -1).
  1919. This also means that _libssh2_wincng_hash never returned 0.
  1920. - wincng.c: fixed possible memory leak in _libssh2_wincng_hash
  1921. If _libssh2_wincng_hash_update failed _libssh2_wincng_hash_final
  1922. would never have been called before.
  1923. Reported by Zenju.
  1924. Kamil Dudka (15 Dec 2015)
  1925. - [Paul Howarth brought this change]
  1926. libssh2.pc.in: fix the output of pkg-config --libs
  1927. ... such that it does not include LDFLAGS used to build libssh2 itself.
  1928. There was a similar fix in the curl project long time ago:
  1929. https://github.com/bagder/curl/commit/curl-7_19_7-56-g4c8adc8
  1930. Bug: https://bugzilla.redhat.com/1279966
  1931. Signed-off-by: Kamil Dudka <[email protected]>
  1932. Marc Hoersken (6 Dec 2015)
  1933. - hostkey.c: align code path of ssh_rsa_init to ssh_dss_init
  1934. - hostkey.c: fix invalid memory access if libssh2_dsa_new fails
  1935. Reported by dimmaq, fixes #66
  1936. Daniel Stenberg (3 Nov 2015)
  1937. - [Will Cosgrove brought this change]
  1938. gcrypt: define libssh2_sha256_ctx
  1939. Looks like it didn't make it into the latest commit for whatever reason.
  1940. Closes #58
  1941. - [Salvador Fandino brought this change]
  1942. libssh2_session_set_last_error: Add function
  1943. Net::SSH2, the Perl wrapping module for libssh2 implements several features*
  1944. on top of libssh2 that can fail and so need some mechanism to report the error
  1945. condition to the user.
  1946. Until now, besides the error state maintained internally by libssh2, another
  1947. error state was maintained at the Perl level for every session object and then
  1948. additional logic was used to merge both error states. That is a maintenance
  1949. nighmare, and actually there is no way to do it correctly and consistently.
  1950. In order to allow the high level language to add new features to the library
  1951. but still rely in its error reporting features the new function
  1952. libssh2_session_set_last_error (that just exposses _libssh2_error_flags) is
  1953. introduced.
  1954. *) For instance, connecting to a remote SSH service giving the hostname and
  1955. port.
  1956. Signed-off-by: Salvador Fandino <[email protected]>
  1957. Signed-off-by: Salvador Fandiño <[email protected]>
  1958. - [Salvador Fandino brought this change]
  1959. _libssh2_error: Support allocating the error message
  1960. Before this patch "_libssh2_error" required the error message to be a
  1961. static string.
  1962. This patch adds a new function "_libssh2_error_flags" accepting an
  1963. additional "flags" argument and specifically the flag
  1964. "LIBSSH2_ERR_FLAG_DUP" indicating that the passed string must be
  1965. duplicated into the heap.
  1966. Then, the method "_libssh2_error" has been rewritten to use that new
  1967. function under the hood.
  1968. Signed-off-by: Salvador Fandino <[email protected]>
  1969. Signed-off-by: Salvador Fandiño <[email protected]>
  1970. - [Will Cosgrove brought this change]
  1971. added engine.h include to fix warning
  1972. - [sune brought this change]
  1973. kex.c: removed dupe entry from libssh2_kex_methods[]
  1974. Closes #51
  1975. - [Salvador Fandiño brought this change]
  1976. userauth: Fix off by one error when reading public key file
  1977. After reading the public key from file the size was incorrectly
  1978. decremented by one.
  1979. This was usually a harmless error as the last character on the public
  1980. key file is an unimportant EOL. But if due to some error the public key
  1981. file is empty, the public key size becomes (uint)(0 - 1), resulting in
  1982. an unrecoverable out of memory error later.
  1983. Signed-off-by: Salvador Fandi??o <sfandino-/[email protected]>
  1984. - [Salvador Fandino brought this change]
  1985. channel: Detect bad usage of libssh2_channel_process_startup
  1986. A common novice programmer error (at least among those using the
  1987. wrapping Perl module Net::SSH2), is to try to reuse channels.
  1988. This patchs detects that incorrect usage and fails with a
  1989. LIBSSH2_ERROR_BAD_USE error instead of hanging.
  1990. Signed-off-by: Salvador Fandino <sfandino-/[email protected]>
  1991. - [Will Cosgrove brought this change]
  1992. kex: Added diffie-hellman-group-exchange-sha256 support
  1993. ... and fixed HMAC_Init depricated usage
  1994. Closes #48
  1995. Alexander Lamaison (21 Sep 2015)
  1996. - Prefixed new #defines to prevent collisions.
  1997. Other libraries might have their own USE_WIN32_*FILES.
  1998. - [keith-daigle brought this change]
  1999. Update examples/scp.c to fix bug where large files on win32 would cause got to wrap and go negative
  2000. - [David Byron brought this change]
  2001. add libssh2_scp_recv2 to support large (> 2GB) files on windows
  2002. Daniel Stenberg (17 Sep 2015)
  2003. - [sune brought this change]
  2004. WinCNG: support for SHA256/512 HMAC
  2005. Closes #47
  2006. - [brian m. carlson brought this change]
  2007. Add support for HMAC-SHA-256 and HMAC-SHA-512.
  2008. Implement support for these algorithms and wire them up to the libgcrypt
  2009. and OpenSSL backends. Increase the maximum MAC buffer size to 64 bytes
  2010. to prevent buffer overflows. Prefer HMAC-SHA-256 over HMAC-SHA-512, and
  2011. that over HMAC-SHA-1, as OpenSSH does.
  2012. Closes #40
  2013. - [Zenju brought this change]
  2014. kex: free server host key before allocating it (again)
  2015. Fixes a memory leak when Synology server requests key exchange
  2016. Closes #43
  2017. - [Viktor Szakats brought this change]
  2018. GNUmakefile: up OpenSSL version
  2019. closes #23
  2020. - [Viktor Szakats brought this change]
  2021. GNUmakefile: add -m64 CFLAGS when targeting mingw64, add -m32/-m64 to LDFLAGS
  2022. libssh2 equivalent of curl patch https://github.com/bagder/curl/commit/d21b66835f2af781a3c2a685abc92ef9f0cd86be
  2023. This allows to build for the non-default target when using a multi-target mingw distro.
  2024. Also bump default OpenSSL dependency path to 1.0.2c.
  2025. - [Viktor Szakats brought this change]
  2026. GNUmakefile: add support for LIBSSH2_LDFLAG_EXTRAS
  2027. It is similar to existing LIBSSH2_CFLAG_EXTRAS, but for
  2028. extra linker options.
  2029. Also delete some line/file ending whitespace.
  2030. closes #27
  2031. - [nasacj brought this change]
  2032. hostkey.c: Fix compiling error when OPENSSL_NO_MD5 is defined
  2033. Closes #32
  2034. - [Mizunashi Mana brought this change]
  2035. openssl.h: adjust the rsa/dsa includes
  2036. ... to work when built without DSA support.
  2037. Closes #36
  2038. Alexander Lamaison (26 Jul 2015)
  2039. - Let CMake build work as a subproject.
  2040. Patch contributed by JasonHaslam.
  2041. - Fix builds with Visual Studio 2015.
  2042. VS2015 moved stdio functions to the header files as inline function. That means check_function_exists can't detect them because it doesn't use header files - just does a link check. Instead we need to use check_symbol_exists with the correct headers.
  2043. Kamil Dudka (2 Jul 2015)
  2044. - cmake: include CMake files in the release tarballs
  2045. Despite we announced the CMake support in libssh2-1.6.0 release notes,
  2046. the files required by the CMake build system were not included in the
  2047. release tarballs. Hence, the only way to use CMake for build was the
  2048. upstream git repository.
  2049. This commit makes CMake actually supported in the release tarballs.
  2050. - tests/mansyntax.sh: fix 'make distcheck' with recent autotools
  2051. Do not create symbolic links off the build directory. Recent autotools
  2052. verify that out-of-source build works even if the source directory tree
  2053. is not writable.
  2054. - openssl: fix memleak in _libssh2_dsa_sha1_verify()
  2055. Daniel Stenberg (12 Jun 2015)
  2056. - openssl: make libssh2_sha1 return error code
  2057. - use the internal prefix _libssh2_ for non-exported functions
  2058. - removed libssh2_md5() since it wasn't used
  2059. Reported-by: Kamil Dudka
  2060. - [LarsNordin-LNdata brought this change]
  2061. SFTP: Increase speed and datasize in SFTP read
  2062. The function sftp_read never return more then 2000 bytes (as it should
  2063. when I asked Daniel). I increased the MAX_SFTP_READ_SIZE to 30000 but
  2064. didn't get the same speed as a sftp read in SecureSSH. I analyzed the
  2065. code and found that a return always was dona when a chunk has been read.
  2066. I changed it to a sliding buffer and worked on all available chunks. I
  2067. got an increase in speed and non of the test I have done has failed
  2068. (both local net and over Internet). Please review and test. I think
  2069. 30000 is still not the optimal MAX_SFTP_READ_SIZE, my next goal is to
  2070. make an API to enable changing this value (The SecureSSH sftp_read has
  2071. more complete filled packages when comparing the network traffic)
  2072. - bump: start working on 1.6.1
  2073. Version 1.6.0 (5 Jun 2015)
  2074. Daniel Stenberg (5 Jun 2015)
  2075. - RELEASE-NOTES: synced with 858930cae5c6a
  2076. Marc Hoersken (19 May 2015)
  2077. - wincng.c: fixed indentation
  2078. - [sbredahl brought this change]
  2079. wincng.c: fixed memleak in (block) cipher destructor
  2080. Alexander Lamaison (6 May 2015)
  2081. - [Jakob Egger brought this change]
  2082. libssh2_channel_open: more detailed error message
  2083. The error message returned by libssh2_channel_open in case of a server side channel open failure is now more detailed and includes the four standard error conditions in RFC 4254.
  2084. - [Hannes Domani brought this change]
  2085. kex: fix libgcrypt memory leaks of bignum
  2086. Fixes #168.
  2087. Marc Hoersken (3 Apr 2015)
  2088. - configure.ac: check for SecureZeroMemory for clear memory feature
  2089. - Revert "wincng.c: fix clear memory feature compilation with mingw"
  2090. This reverts commit 2d2744efdd0497b72b3e1ff6e732aa4c0037fc43.
  2091. Autobuilds show that this did not solve the issue.
  2092. And it seems like RtlFillMemory is defined to memset,
  2093. which would be optimized out by some compilers.
  2094. - wincng.c: fix clear memory feature compilation with mingw
  2095. Alexander Lamaison (1 Apr 2015)
  2096. - [LarsNordin-LNdata brought this change]
  2097. Enable use of OpenSSL that doesn't have DSA.
  2098. Added #if LIBSSH2_DSA for all DSA functions.
  2099. - [LarsNordin-LNdata brought this change]
  2100. Use correct no-blowfish #define with OpenSSL.
  2101. The OpenSSL define is OPENSSL_NO_BF, not OPENSSL_NO_BLOWFISH.
  2102. Marc Hoersken (25 Mar 2015)
  2103. - configure: error if explicitly enabled clear-memory is not supported
  2104. This takes 22bd8d81d8fab956085e2079bf8c29872455ce59 and
  2105. b8289b625e291bbb785ed4add31f4759241067f3 into account,
  2106. but still makes it enabled by default if it is supported
  2107. and error out in case it is unsupported and was requested.
  2108. Daniel Stenberg (25 Mar 2015)
  2109. - configure: make clear-memory default but only WARN if backend unsupported
  2110. ... instead of previous ERROR.
  2111. Marc Hoersken (24 Mar 2015)
  2112. - wincng.h: fix warning about computed return value not being used
  2113. - nonblocking examples: fix warning about unused tvdiff on Mac OS X
  2114. Daniel Stenberg (24 Mar 2015)
  2115. - openssl: fix compiler warnings
  2116. - cofigure: fix --disable-clear-memory check
  2117. Marc Hoersken (23 Mar 2015)
  2118. - scp.c: improved command length calculation
  2119. Reduced number of calls to strlen, because shell_quotearg already
  2120. returns the length of the resulting string (e.q. quoted path)
  2121. which we can add to the existing and known cmd_len.
  2122. Removed obsolete call to memset again, because we can put a final
  2123. NULL-byte at the end of the string using the calculated length.
  2124. - scp.c: improved and streamlined formatting
  2125. - scp.c: fix that scp_recv may transmit not initialised memory
  2126. - scp.c: fix that scp_send may transmit not initialised memory
  2127. Fixes ticket 244. Thanks Torsten.
  2128. - kex: do not ignore failure of libssh2_sha1_init()
  2129. Based upon 43b730ce56f010e9d33573fcb020df49798c1ed8.
  2130. Fixes ticket 290. Thanks for the suggestion, mstrsn.
  2131. - wincng.h: fix return code of libssh2_md5_init()
  2132. - openssl.c: fix possible segfault in case EVP_DigestInit fails
  2133. - wincng.c: fix possible use of uninitialized variables
  2134. - wincng.c: fix unused argument warning if clear memory is not enabled
  2135. - wincng: Added explicit clear memory feature to WinCNG backend
  2136. This re-introduces the original feature proposed during
  2137. the development of the WinCNG crypto backend. It still needs
  2138. to be added to libssh2 itself and probably other backends.
  2139. Memory is cleared using the function SecureZeroMemory which is
  2140. available on Windows systems, just like the WinCNG backend.
  2141. - wincng.c: fixed mixed line-endings
  2142. - wincng.c: fixed use of invalid parameter types in a8d14c5dcf
  2143. - wincng.c: only try to load keys corresponding to the algorithm
  2144. - wincng.c: moved PEM headers into definitions
  2145. - wincng.h: fixed invalid parameter name
  2146. - wincng: fixed mismatch with declarations in crypto.h
  2147. - userauth.c: fixed warning C6001: using uninitialized sig and sig_len
  2148. - pem.c: fixed warning C6269: possible incorrect order of operations
  2149. - wincng: add support for authentication keys to be passed in memory
  2150. Based upon 18cfec8336e and daa2dfa2db.
  2151. - pem.c: add _libssh2_pem_parse_memory to parse PEM from memory
  2152. Requirement to implement 18cfec8336e for Libgcrypt and WinCNG.
  2153. - pem.c: fix copy and paste mistake from 55d030089b8
  2154. - userauth.c: fix another possible dereference of a null pointer
  2155. - userauth.c: fix possible dereference of a null pointer
  2156. - pem.c: reduce number of calls to strlen in readline
  2157. Alexander Lamaison (17 Mar 2015)
  2158. - [Will Cosgrove brought this change]
  2159. Initialise HMAC_CTX in more places.
  2160. Missed a couple more places we init ctx to avoid openssl threading crash.
  2161. - Build build breakage in WinCNG backend caused when adding libssh2_userauth_publickey_frommemory.
  2162. The new feature isn't implemented for the WinCNG backend currently, but the WinCNG backend didn't contain any implementation of the required backend functions - even ones that returns an error. That caused link errors.
  2163. This change fixes the problem by providing an implementation of the backend functions that returns an error.
  2164. - Fix breakage in WinCNG backend caused by introducing libssh2_hmac_ctx_init.
  2165. The macro was defined to nothing for the libgcrypt backend, but not for WinCNG. This brings the latter into line with the former.
  2166. Daniel Stenberg (15 Mar 2015)
  2167. - userauth_publickey_frommemory.3: add AVAILABILITY
  2168. ... it will be added in 1.6.0
  2169. - libssh2: next version will be called 1.6.0
  2170. ... since we just added a new function.
  2171. - docs: add libssh2_userauth_publickey_frommemory.3 to dist
  2172. The function and man page were added in commit 18cfec8336e
  2173. - [Jakob Egger brought this change]
  2174. direct_tcpip: Fixed channel write
  2175. There were 3 bugs in this loop:
  2176. 1) Started from beginning after partial writes
  2177. 2) Aborted when 0 bytes were sent
  2178. 3) Ignored LIBSSH2_ERROR_EAGAIN
  2179. See also:
  2180. https://trac.libssh2.org/ticket/281
  2181. https://trac.libssh2.org/ticket/293
  2182. Alexander Lamaison (15 Mar 2015)
  2183. - [Will Cosgrove brought this change]
  2184. Must init HMAC_CTX before using it.
  2185. Must init ctx before using it or openssl will reuse the hmac which is not thread safe and causes a crash.
  2186. Added libssh2_hmac_ctx_init macro.
  2187. - Add continuous integration configurations.
  2188. Linux-based CI is done by Travis CI. Windows-based CI is done by Appveyor.
  2189. - [David Calavera brought this change]
  2190. Allow authentication keys to be passed in memory.
  2191. All credits go to Joe Turpin, I'm just reaplying and cleaning his patch:
  2192. http://www.libssh2.org/mail/libssh2-devel-archive-2012-01/0015.shtml
  2193. * Use an unimplemented error for extracting keys from memory with libgcrypt.
  2194. Daniel Stenberg (14 Mar 2015)
  2195. - docs: include the renamed INSTALL* files in dist
  2196. Alexander Lamaison (13 Mar 2015)
  2197. - Prevent collisions between CMake and Autotools in examples/ and tests/.
  2198. - Avoid clash between CMake build and Autotools.
  2199. Autotools expects a configuration template file at src/libssh2_config.h.in, which buildconf generates. But the CMake build system has its CMake-specific version of the file at this path. This means that, if you don't run buildconf, the Autotools build will fail because it configured the wrong header template.
  2200. See https://github.com/libssh2/libssh2/pull/8.
  2201. - Merge pull request #8 from alamaison/cmake
  2202. CMake build system.
  2203. - CMake build system.
  2204. Tested:
  2205. - Windows:
  2206. - Visual C++ 2005/2008/2010/2012/2013/MinGW-w64
  2207. - static/shared
  2208. - 32/64-bit
  2209. - OpenSSL/WinCNG
  2210. - Without zlib
  2211. - Linux:
  2212. - GCC 4.6.3/Clang 3.4
  2213. - static/shared
  2214. - 32/64-bit
  2215. - OpenSSL/Libgcrypt
  2216. - With/Without zlib
  2217. - MacOS X
  2218. - AppleClang 6.0.0
  2219. - static
  2220. - 64-bit
  2221. - OpenSSL
  2222. - Without zlib
  2223. Conflicts:
  2224. README
  2225. - Man man syntax tests fail gracefully if man version is not suitable.
  2226. - Return valid code from test fixture on failure.
  2227. The sshd test fixture was returning -1 if an error occurred, but negative error codes aren't technically valid (google it). Bash on Windows converted them to 0 which made setup failure look as though all tests were passing.
  2228. - Let mansyntax.sh work regardless of where it is called from.
  2229. Daniel Stenberg (12 Mar 2015)
  2230. - [Viktor Szakáts brought this change]
  2231. mingw build: allow to pass custom CFLAGS
  2232. Allow to pass custom `CFLAGS` options via environment variable
  2233. `LIBSSH2_CFLAG_EXTRAS`. Default and automatically added options of
  2234. `GNUmakefile` have preference over custom ones. This addition is useful
  2235. for passing f.e. custom CPU tuning or LTO optimization (`-flto
  2236. -ffat-lto-objects`) options. The only current way to do this is to edit
  2237. `GNUmakefile`. This patch makes it unnecessary.
  2238. This is a mirror of similar libcurl patch:
  2239. https://github.com/bagder/curl/pull/136
  2240. - [Will Cosgrove brought this change]
  2241. userauth: Fixed prompt text no longer being copied to the prompts struct
  2242. Regression from 031566f9c
  2243. - README: update the git repo locations
  2244. - wait_socket: wrong use of difftime()
  2245. With reversed arguments it would always return a negative value...
  2246. Bug: https://github.com/bagder/libssh2/issues/1
  2247. - bump: start working toward 1.5.1 now
  2248. Version 1.5.0 (11 Mar 2015)
  2249. Daniel Stenberg (11 Mar 2015)
  2250. - RELEASE-NOTES: 1.5.0 release
  2251. - [Mariusz Ziulek brought this change]
  2252. kex: bail out on rubbish in the incoming packet
  2253. CVE-2015-1782
  2254. Bug: http://www.libssh2.org/adv_20150311.html
  2255. - docs: move INSTALL, AUTHORS, HACKING and TODO to docs/
  2256. And with this, cleanup README to be shorter and mention the new source
  2257. code home.
  2258. - .gitignore: don't ignore INSTALL
  2259. Dan Fandrich (4 Mar 2015)
  2260. - examples/x11.c: include sys/select.h for improved portability
  2261. Daniel Stenberg (4 Mar 2015)
  2262. - RELEASE-NOTES: synced with a8473c819bc068
  2263. In preparation for the upcoming 1.5.0 release.
  2264. Guenter Knauf (8 Jan 2015)
  2265. - NetWare build: added some missing exports.
  2266. Marc Hoersken (29 Dec 2014)
  2267. - knownhost.c: fix use of uninitialized argument variable wrote
  2268. Detected by clang scan in line 1195, column 18.
  2269. - examples/x11.c: fix result of operation is garbage or undefined
  2270. Fix use of uninitialized structure w_size_bck.
  2271. Detected by clang scan in line 386, column 28.
  2272. - examples/x11.c: remove dead assigments of some return values
  2273. Detected by clang scan in line 212, column 9.
  2274. Detected by clang scan in line 222, column 13.
  2275. Detected by clang scan in line 410, column 13.
  2276. - examples/x11.c: fix possible memory leak if read fails
  2277. Detected by clang scan in line 224, column 21.
  2278. - examples/x11.c: fix invalid removal of first list element
  2279. Fix use of memory after it was being freed.
  2280. Detected by clang scan in line 56, column 12.
  2281. - userauth.c: make sure that sp_len is positive and avoid overflows
  2282. ... if the pointer subtraction of sp1 - pubkey - 1 resulted in a
  2283. negative or larger value than pubkey_len, memchr would fail.
  2284. Reported by Coverity CID 89846.
  2285. - channel.c: remove logically dead code, host cannot be NULL here
  2286. ... host cannot be NULL in line 525, because it is always
  2287. valid (e.g. at least set to "0.0.0.0") after lines 430 and 431.
  2288. Reported by Coverity CID 89807.
  2289. - session.c: check return value of session_nonblock during startup
  2290. Reported by Coverity CID 89803.
  2291. - session.c: check return value of session_nonblock in debug mode
  2292. Reported by Coverity CID 89805.
  2293. - pem.c: fix mixed line-endings introduced with 8670f5da24
  2294. - pem.c: make sure there's a trailing zero and b64data is not NULL
  2295. ... if there is no base64 data between PEM header and footer.
  2296. Reported by Coverity CID 89823.
  2297. - kex.c: make sure mlist is not set to NULL
  2298. ... if the currently unsupported LANG methods are called.
  2299. Reported by Coverity CID 89834.
  2300. - packet.c: i < 256 was always true and i would overflow to 0
  2301. Visualize that the 0-termination is intentional, because the array
  2302. is later passed to strlen within _libssh2_packet_askv.
  2303. - silence multiple data conversion warnings
  2304. Daniel Stenberg (23 Dec 2014)
  2305. - agent_connect_unix: make sure there's a trailing zero
  2306. ... if the path name was too long. Reported by Coverity CID 89801.
  2307. Marc Hoersken (22 Dec 2014)
  2308. - examples on Windows: use native SOCKET-type instead of int
  2309. And check return values accordingly.
  2310. - userauth.c: improve readability and clarity of for-loops
  2311. Daniel Stenberg (22 Dec 2014)
  2312. - calloc: introduce LIBSSH2_CALLOC()
  2313. A simple function using LIBSSH2_ALLOC + memset, since this pattern was
  2314. used in multiple places and this simplies code in general.
  2315. Marc Hoersken (15 Dec 2014)
  2316. - libssh2_priv.h: Ignore session, context and format parameters
  2317. - x11 example: check return value of socket function
  2318. - examples: fixed mixed line-endings introduced with aedfba25b8
  2319. - wincng.c: explicitly ignore BCrypt*AlgorithmProvider return codes
  2320. Fixes VS2012 code analysis warning C6031:
  2321. return value ignored: <function> could return unexpected value
  2322. - wincng.c: fix possible invalid memory write access
  2323. Fixes VS2012 code analysis warning C6386:
  2324. buffer overrun: accessing 'pbOutput', the writable size is
  2325. 'cbOutput' bytes, but '3' bytes may be written: libssh2 wincng.c 610
  2326. - tests on Windows: check for WSAStartup return code
  2327. Fixes VS2012 code analysis warning C6031:
  2328. return value ignored: <function> could return unexpected value
  2329. - wincng.c: fix possible NULL pointer de-reference of bignum
  2330. Fixes VS2012 code analysis warning C6011:
  2331. dereferencing NULL pointer 'bignum'. libssh2 wincng.c 1567
  2332. - wincng.c: fix possible use of uninitialized memory
  2333. Fixes VS2012 code analysis warning C6001:
  2334. using uninitialized memory 'cbDecoded'. libssh2 wincng.c 553
  2335. - packet.c: fix possible NULL pointer de-reference within listen_state
  2336. Fixes VS2012 code analysis warning C6011:
  2337. dereferencing NULL pointer 'listen_state->channel'. libssh2 packet.c 221
  2338. - kex.c: fix possible NULL pointer de-reference with session->kex
  2339. Fixes VS2012 code analysis warning C6011:
  2340. dereferencing NULL pointer 'session->kex'. libssh2 kex.c 1761
  2341. - agent.c: check return code of MapViewOfFile
  2342. Fixes VS2012 code analysis warning C6387: 'p+4' may be '0':
  2343. this does not adhere to the specification for the function
  2344. 'memcpy': libssh2 agent.c 330
  2345. Fixes VS2012 code analysis warning C6387: 'p' may be '0':
  2346. this does not adhere to the specification for the function
  2347. 'UnmapViewOfFile': libssh2 agent.c 333
  2348. - examples on Windows: check for socket return code
  2349. Fixes VS2012 code analysis warning C28193:
  2350. The variable holds a value that must be examined
  2351. - examples on Windows: check for WSAStartup return code
  2352. Fixes VS2012 code analysis warning C6031:
  2353. return value ignored: <function> could return unexpected value
  2354. Guenter Knauf (11 Dec 2014)
  2355. - wincng.c: silent some more gcc compiler warnings.
  2356. - wincng.c: silent gcc compiler warnings.
  2357. - Watcom build: added support for WinCNG build.
  2358. - build: updated dependencies in makefiles.
  2359. Daniel Stenberg (4 Dec 2014)
  2360. - configure: change LIBS not LDFLAGS when checking for libs
  2361. Closes #289
  2362. Patch-by: maurerpe
  2363. Guenter Knauf (3 Dec 2014)
  2364. - MinGW build: some more GNUMakefile tweaks.
  2365. test/GNUmakefile: added architecture autodetection; added switches to
  2366. CFLAGS and RCFLAGS to make sure that the right architecture is used.
  2367. Added support to build with WinCNG.
  2368. - sftpdir.c: added authentication method detection.
  2369. Stuff copied over from ssh2.c to make testing a bit easier.
  2370. - NMake build: fixed LIBS settings.
  2371. - NMake build: added support for WinCNG build.
  2372. - MinGW build: some GNUMakefile tweaks.
  2373. Added architecture autodetection; added switches to CFLAGS and
  2374. RCFLAGS to make sure that the right architecture is used.
  2375. Added support to build with WinCNG.
  2376. - MinGW build: Fixed redefine warnings.
  2377. - Updated copyright year.
  2378. Daniel Stenberg (31 Aug 2014)
  2379. - COPYING: bump the copyright year
  2380. Dan Fandrich (28 Jul 2014)
  2381. - docs: fixed a bunch of typos
  2382. - docs: added missing libssh2_session_handshake.3 file
  2383. Marc Hoersken (19 May 2014)
  2384. - wincng.c: specify the required libraries for dependencies using MSVC
  2385. Initially reported by Bob Kast as "for MS VS builds, specify the
  2386. libraries that are required so they don't need to go into all
  2387. project files that may use this library". Thanks a lot.
  2388. - [Bob Kast brought this change]
  2389. windows build: do not export externals from static library
  2390. If you are building a DLL, then you need to explicitly export each
  2391. entry point. When building a static library, you should not.
  2392. libssh2 was exporting the entry points whether it was building a DLL or a
  2393. static library. To elaborate further, if libssh2 was used as a static
  2394. library, which was being linked into a DLL, the libssh2 API would be
  2395. exported from that separate DLL.
  2396. Daniel Stenberg (19 May 2014)
  2397. - [Mikhail Gusarov brought this change]
  2398. Fix typos in manpages
  2399. Marc Hoersken (18 May 2014)
  2400. - wincng.c: Fixed memory leak in case of an error during ASN.1 decoding
  2401. - configure: Display individual crypto backends on separate lines
  2402. This avoids line-wrapping in between parameters and makes the
  2403. error message look like the following:
  2404. configure: error: No crypto library found!
  2405. Try --with-libssl-prefix=PATH
  2406. or --with-libgcrypt-prefix=PATH
  2407. or --with-wincng on Windows
  2408. - [Bob Kast brought this change]
  2409. libssh2_priv.h: a 1 bit bit-field should be unsigned
  2410. some compilers may not like this
  2411. - knownhost.c: Fixed warning that pointer targets differ in signedness
  2412. - wincng.c: Fixed warning about pointer targets differing in signedness
  2413. - tcpip-forward.c: Fixed warning that pointer targets differ in signedness
  2414. libssh2_channel_forward_listen_ex uses ints instead of unsigned ints.
  2415. - misc.c: Fixed warning about mixed declarations and code
  2416. - libgcrypt.h: Fixed warning about pointer targets differing in signedness
  2417. - wincng.h: Fixed warning about pointer targets differing in signedness
  2418. - misc.c: Fixed warning about unused parameter abstract
  2419. - tcpip-forward.c: Removed unused variables shost, sport and sockopt
  2420. - wincng.h: Added forward declarations for all WinCNG functions
  2421. Initially reported by Bob Kast as "Wincng - define function
  2422. prototypes for wincng routines". Thanks a lot.
  2423. Also replaced structure definitions with type definitions.
  2424. - [Bob Kast brought this change]
  2425. libssh2.h: on Windows, a socket is of type SOCKET, not int
  2426. - win32: Added WinCNG targets to generated Visual Studio project
  2427. Inspired by Bob Kast's reports, this commit enables the compilation
  2428. of libssh2 with WinCNG using the generated Visual Studio project files.
  2429. This commit adds WinCNG support to parts of the existing Win32 build
  2430. infrastructure, until new build systems, like pre-defined VS project
  2431. files or CMake files may be added.
  2432. This commit and b20bfeb3e519119a48509a1099c06d65aa7da1d7 raise one
  2433. question: How to handle build systems, like VS project files, that
  2434. need to include all source files regardless of the desired target,
  2435. including all supported crypto backends? For now the mentioned commit
  2436. added a check for LIBSSH2_OPENSSL to openssl.c and with this commit
  2437. the supported crypto backends are hardcoded within Makefile.am.
  2438. - libssh2_priv msvc: Removed redundant definition of inline keyword
  2439. Initially reported by Bob Kast as "Remove redundant 'inline' define".
  2440. Thanks a lot.
  2441. - wincng: Made data parameter to hash update function constant
  2442. Initially reported by Bob Kast as "formal parameter must be const
  2443. since it is used in contexts where the actual parameter may be const".
  2444. Thanks a lot.
  2445. - wincng: fix cross-compilation against the w64 mingw-runtime package
  2446. - openssl: Check for LIBSSH2_OPENSSL in order to compile with openssl
  2447. - wincng: Fixed use of possible uninitialized variable pPaddingInfo
  2448. Reported by Bob Kast, thanks a lot.
  2449. - wincng: Added cast for double to unsigned long conversion
  2450. - wincng: Cleaned up includes and check NTSTATUS using macro
  2451. Removed header file combination that is not supported on a real
  2452. Windows platform and can only be compiled using MinGW. Replaced
  2453. custom NTSTATUS return code checks with BCRYPT_SUCCESS macro.
  2454. Daniel Stenberg (16 Mar 2014)
  2455. - userauth_hostbased_fromfile: zero assign to avoid uninitialized use
  2456. Detected by clang-analyze
  2457. - channel_receive_window_adjust: store windows size always
  2458. Avoid it sometimes returning without storing it, leaving calling
  2459. functions with unknown content!
  2460. Detected by clang-analyzer
  2461. - publickey_packet_receive: avoid junk in returned pointers
  2462. clang-analyzer found this risk it would return a non-initialized pointer
  2463. in a success case
  2464. Peter Stuge (16 Mar 2014)
  2465. - [Marc Hoersken brought this change]
  2466. Added Windows Cryptography API: Next Generation based backend
  2467. - [Marc Hoersken brought this change]
  2468. knownhost.c: fixed that 'key_type_len' may be used uninitialized
  2469. ../src/knownhost.c: In function 'libssh2_knownhost_readline':
  2470. ../src/knownhost.c:651:16: warning: 'key_type_len' may be used
  2471. uninitialized in this function [-Wmaybe-uninitialized]
  2472. rc = knownhost_add(hosts, hostbuf, NULL,
  2473. ^
  2474. ../src/knownhost.c:745:12: note: 'key_type_len' was declared here
  2475. size_t key_type_len;
  2476. ^
  2477. - [Marc Hoersken brought this change]
  2478. pem.c: always compile pem.c independently of crypto backend
  2479. - Fix non-autotools builds: Always define the LIBSSH2_OPENSSL CPP macro
  2480. Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 introduced a crypto
  2481. library abstraction in the autotools build system, to allow us to more
  2482. easily support new crypto libraries. In that process it was found that
  2483. all other build system which we support are hard-coded to build with
  2484. OpenSSL. Commit f5c1a0d98bd51aeb24aca3d49c7c81dcf8bd858d fixes automake
  2485. introduced into non-autotools build systems but still overlooked the
  2486. CPP macro saying that we are using OpenSSL.
  2487. Thanks to Marc Hörsken for identifying this issue and proposing a fix
  2488. for win32/{GNUmakefile,config.mk}. This commit uses a slightly different
  2489. approach but the end result is the same.
  2490. Dan Fandrich (15 Mar 2014)
  2491. - channel_close: Close the channel even in the case of errors
  2492. - sftp_close_handle: ensure the handle is always closed
  2493. Errors are reported on return, but otherwise the close path is
  2494. completed as much as possible and the handle is freed on exit.
  2495. Alexander Lamaison (6 Mar 2014)
  2496. - knownhost: Restore behaviour of `libssh2_knownhost_writeline` with short buffer.
  2497. Commit 85c6627c changed the behaviour of `libssh2_knownhost_writeline` so that it stopped returning the number of bytes needed when the given buffer was too small. Also, the function changed such that is might write to part of the buffer before realising it is too small.
  2498. This commit restores the original behaviour, whilst keeping the unknown-key-type functionality that 85c6627c. Instead of writing to the buffer piecemeal, the length of the various parts is calculated up front and the buffer written only if there is enough space. The calculated necessary size is output in `outlen` regardless of whether the buffer was written to.
  2499. The main use-case for the original behaviour that this commit restores is to allow passing in a NULL buffer to get the actual buffer size needed, before calling the function again with the buffer allocated to the exact size required.
  2500. - knownhost: Fix DSS keys being detected as unknown.
  2501. I missing `else` meant ssh-dss format keys were being re-detected as unknown format.
  2502. Dan Fandrich (6 Mar 2014)
  2503. - knownhosts: Abort if the hosts buffer is too small
  2504. This could otherwise cause a match on the wrong host
  2505. - agent_list_identities: Fixed memory leak on OOM
  2506. - Fixed a few typos
  2507. - userauth: Fixed an attempt to free from stack on error
  2508. - Fixed a few memory leaks in error paths
  2509. - Fixed two potential use-after-frees of the payload buffer
  2510. The first might occur if _libssh2_packet_add returns an error, as
  2511. fullpacket_state wasn't reset to idle so if it were possible for
  2512. fullpacket to be called again, it would return to the same state
  2513. handler and re-use the freed p->packet buffer.
  2514. The second could occur if decrypt returned an error, as it freed the
  2515. packet buffer but did not clear total_num, meaning that freed buffer
  2516. could be written into again later.
  2517. Alexander Lamaison (28 Nov 2013)
  2518. - Fix missing `_libssh2_error` in `_libssh2_channel_write`.
  2519. In one case, the error code from `_libssh2_transport_read` was being returned from `_libssh2_channel_write` without setting it as the last error by calling `_libssh2_error`. This commit fixes that.
  2520. Found when using a session whose socket had been inadvertently destroyed. The calling code got confused because via `libssh2_session_last_error` it appeared no error had occurred, despite one being returned from the previous function.
  2521. Kamil Dudka (21 Nov 2013)
  2522. - [Mark McPherson brought this change]
  2523. openssl: initialise the digest context before calling EVP_DigestInit()
  2524. When using the OpenSSL libraries in FIPS mode, the function call
  2525. EVP_DigestInit() is actually #defined to FIPS_digestinit().
  2526. Unfortunately wheres EVP_DigestInit() initialises the context and then
  2527. calls EVP_DigestInit_ex(), this function assumes that the context has
  2528. been pre-initialised and crashes when it isn't.
  2529. Bug: https://trac.libssh2.org/ticket/279
  2530. Fixes #279
  2531. - [Marc Hörsken brought this change]
  2532. .gitignore: Ignore files like src/libssh2_config.h.in~
  2533. Peter Stuge (13 Nov 2013)
  2534. - Move automake conditionals added by commit d512b25f out of Makefile.inc
  2535. Commit d512b25f69a1b6778881f6b4b5ff9cfc6023be42 added automake
  2536. conditionals to Makefile.inc but since Makefile.inc is included
  2537. from Makefile for all other build systems that does not work.
  2538. This commit instead adds Makefile.OpenSSL.inc and Makefile.libgcrypt.inc
  2539. and moves the automake conditional to its proper place, src/Makefile.am.
  2540. The automake conditional includes the correct Makefile.$name.inc per
  2541. the crypto library selection/detection done by configure.
  2542. All non-autotools build system files in libssh2 are hardcoded to use
  2543. OpenSSL and do not get a conditional but at least there is some reuse
  2544. because they can all include the new Makefile.OpenSSL.inc.
  2545. Daniel Stenberg (27 Oct 2013)
  2546. - [Salvador Fandino brought this change]
  2547. Set default window size to 2MB
  2548. The default channel window size used until now was 256KB. This value is
  2549. too small and results on a bottleneck on real-life networks where
  2550. round-trip delays can easily reach 300ms.
  2551. The issue was not visible because the configured channel window size
  2552. was being ignored and a hard-coded value of ~22MB being used instead,
  2553. but that was fixed on a previous commit.
  2554. This patch just changes the default window size
  2555. (LIBSSH2_CHANNEL_WINDOW_DEFAULT) to 2MB. It is the same value used by
  2556. OpenSSH and in our opinion represents a good compromise between memory
  2557. used and transfer speed.
  2558. Performance tests were run to determine the optimum value. The details
  2559. and related discussion are available from the following thread on the
  2560. libssh2 mailing-list:
  2561. http://www.libssh2.org/mail/libssh2-devel-archive-2013-10/0018.shtml
  2562. http://article.gmane.org/gmane.network.ssh.libssh2.devel/6543
  2563. An excerpt follows:
  2564. "I have been running some transfer test and measuring their speed.
  2565. My setup was composed of a quad-core Linux machine running Ubuntu 13.10
  2566. x86_64 with a LXC container inside. The data transfers were performed
  2567. from the container to the host (never crossing through a physical
  2568. network device).
  2569. Network delays were simulated using the tc tool. And ping was used to
  2570. verify that they worked as intended during the tests.
  2571. The operation performed was the equivalent to the following ssh command:
  2572. $ ssh container "dd bs=16K count=8K if=/dev/zero" >/dev/null
  2573. Though, establishment and closing of the SSH connection was excluded
  2574. from the timings.
  2575. I run the tests several times transferring files of sizes up to 128MB
  2576. and the results were consistent between runs.
  2577. The results corresponding to the 128MB transfer are available here:
  2578. https://docs.google.com/spreadsheet/ccc?key=0Ao1yRmX6PQQzdG5wSFlrZl9HRWNET3ZyN0hnaGo5ZFE&usp=sharing
  2579. It clearly shows that 256KB is too small as the default window size.
  2580. Moving to a 512MB generates a great improvement and after the 1MB mark
  2581. the returns rapidly diminish. Other factors (TCP window size, probably)
  2582. become more limiting than the channel window size
  2583. For comparison I also performed the same transfers using OpenSSH. Its
  2584. speed is usually on par with that of libssh2 using a window size of 1MB
  2585. (even if it uses a 2MB window, maybe it is less aggressive sending the
  2586. window adjust msgs)."
  2587. Signed-off-by: Salvador Fandino <[email protected]>
  2588. - [Salvador brought this change]
  2589. _libssh2_channel_read: Honour window_size_initial
  2590. _libssh2_channel_read was using an arbitrary hard-coded limit to trigger
  2591. the window adjusting code. The adjustment used was also hard-coded and
  2592. arbitrary, 15MB actually, which would limit the usability of libssh2 on
  2593. systems with little RAM.
  2594. This patch, uses the window_size parameter passed to
  2595. libssh2_channel_open_ex (stored as remote.window_size_initial) plus the
  2596. buflen as the base for the trigger and the adjustment calculation.
  2597. The memory usage when using the default window size is reduced from 22MB
  2598. to 256KB per channel (actually, if compression is used, these numbers
  2599. should be incremented by ~50% to account for the errors between the
  2600. decompressed packet sizes and the predicted sizes).
  2601. My tests indicate that this change does not impact the performance of
  2602. transfers across localhost or a LAN, being it on par with that of
  2603. OpenSSH. On the other hand, it will probably slow down transfers on
  2604. networks with high bandwidth*delay when the default window size
  2605. (LIBSSH2_CHANNEL_WINDOW_DEFAULT=256KB) is used.
  2606. Signed-off-by: Salvador Fandino <[email protected]>
  2607. - [Salvador Fandino brought this change]
  2608. knownhosts: handle unknown key types
  2609. Store but don't use keys of unsupported types on the known_hosts file.
  2610. Currently, when libssh2 parses a known_host file containing keys of some
  2611. type it doesn't natively support, it stops reading the file and returns
  2612. an error.
  2613. That means, that the known_host file can not be safely shared with other
  2614. software supporting other key types (i.e. OpenSSH).
  2615. This patch adds support for handling keys of unknown type. It can read
  2616. and write them, even if they are never going to be matched.
  2617. At the source level the patch does the following things:
  2618. - add a new unknown key type LIBSSH2_KNOWNHOST_KEY_UNKNOWN
  2619. - add a new slot (key_type_name) on the known_host struct that is
  2620. used to store the key type in ascii form when it is not supported
  2621. - parse correctly known_hosts entries with unknown key types and
  2622. populate the key_type_name slot
  2623. - print correctly known_hosts entries of unknown type
  2624. - when checking a host key ignore keys that do not match the key
  2625. Fixes #276
  2626. - windows build: fix build errors
  2627. Fixes various link errors with VS2010
  2628. Reported-by: "kdekker"
  2629. Fixes #272
  2630. - man page: add missing function argument
  2631. for libssh2_userauth_publickey_fromfile_ex()
  2632. Reported-by: "pastey"
  2633. Fixes #262
  2634. - [Salvador brought this change]
  2635. Fix zlib deflate usage
  2636. Deflate may return Z_OK even when not all data has been compressed
  2637. if the output buffer becomes full.
  2638. In practice this is very unlikely to happen because the output buffer
  2639. size is always some KBs larger than the size of the data passed for
  2640. compression from the upper layers and I think that zlib never expands
  2641. the data so much, even on the worst cases.
  2642. Anyway, this patch plays on the safe side checking that the output
  2643. buffer is not exhausted.
  2644. Signed-off-by: Salvador <[email protected]>
  2645. - [Salvador brought this change]
  2646. comp_method_zlib_decomp: Improve buffer growing algorithm
  2647. The old algorithm was O(N^2), causing lots and lots of reallocations
  2648. when highly compressed data was transferred.
  2649. This patch implements a simpler one that just doubles the buffer size
  2650. everytime it is exhausted. It results in O(N) complexity.
  2651. Also a smaller inflate ratio is used to calculate the initial size (x4).
  2652. Signed-off-by: Salvador <[email protected]>
  2653. - [Salvador brought this change]
  2654. Fix zlib usage
  2655. Data may remain in zlib internal buffers when inflate() returns Z_OK
  2656. and avail_out == 0. In that case, inflate has to be called again.
  2657. Also, once all the data has been inflated, it returns Z_BUF_ERROR to
  2658. signal that the input buffer has been exhausted.
  2659. Until now, the way to detect that a packet payload had been completely
  2660. decompressed was to check that no data remained on the input buffer
  2661. but that didn't account for the case where data remained on the internal
  2662. zlib buffers.
  2663. That resulted in packets not being completely decompressed and the
  2664. missing data reappearing on the next packet, though the bug was masked
  2665. by the buffer allocation algorithm most of the time and only manifested
  2666. when transferring highly compressible data.
  2667. This patch fixes the zlib usage.
  2668. Signed-off-by: Salvador <[email protected]>
  2669. - [Salvador brought this change]
  2670. _libssh2_channel_read: fix data drop when out of window
  2671. After filling the read buffer with data from the read queue, when the
  2672. window size was too small, "libssh2_channel_receive_window_adjust" was
  2673. called to increase it. In non-blocking mode that function could return
  2674. EAGAIN and, in that case, the EAGAIN was propagated upwards and the data
  2675. already read on the buffer lost.
  2676. The function was also moving between the two read states
  2677. "libssh2_NB_state_idle" and "libssh2_NB_state_created" both of which
  2678. behave in the same way (excepting a debug statment).
  2679. This commit modifies "_libssh2_channel_read" so that the
  2680. "libssh2_channel_receive_window_adjust" call is performed first (when
  2681. required) and if everything goes well, then it reads the data from the
  2682. queued packets into the read buffer.
  2683. It also removes the useless "libssh2_NB_state_created" read state.
  2684. Some rotted comments have also been updated.
  2685. Signed-off-by: Salvador <[email protected]>
  2686. - [Salvador Fandino brought this change]
  2687. window_size: redid window handling for flow control reasons
  2688. Until now, the window size (channel->remote.window_size) was being
  2689. updated just after receiving the packet from the transport layer.
  2690. That behaviour is wrong because the channel queue may grow uncontrolled
  2691. when data arrives from the network faster that the upper layer consumes
  2692. it.
  2693. This patch adds a new counter, read_avail, which keeps a count of the
  2694. bytes available from the packet queue for reading. Also, now the window
  2695. size is adjusted when the data is actually read by an upper layer.
  2696. That way, if the upper layer stops reading data, the window will
  2697. eventually fill and the remote host will stop sending data. When the
  2698. upper layers reads enough data, a window adjust packet is delivered and
  2699. the transfer resumes.
  2700. The read_avail counter is used to detect the situation when the remote
  2701. server tries to send data surpassing the window size. In that case, the
  2702. extra data is discarded.
  2703. Signed-off-by: Salvador <[email protected]>
  2704. Peter Stuge (15 Sep 2013)
  2705. - configure.ac: Call zlib zlib and not libz in text but keep option names
  2706. - configure.ac: Reorder --with-* options in --help output
  2707. - configure.ac: Rework crypto library detection
  2708. This further simplifies adding new crypto libraries.
  2709. - Clean up crypto library abstraction in build system and source code
  2710. libssh2 used to explicitly check for libgcrypt and default to OpenSSL.
  2711. Now all possible crypto libraries are checked for explicitly, making
  2712. the addition of further crypto libraries both simpler and cleaner.
  2713. - configure.ac: Add zlib to Requires.private in libssh2.pc if using zlib
  2714. - Revert "Added Windows Cryptography API: Next Generation based backend"
  2715. This reverts commit d385230e15715e67796f16f3e65fd899f21a638b.
  2716. Daniel Stenberg (7 Sep 2013)
  2717. - [Leif Salomonsson brought this change]
  2718. sftp_statvfs: fix for servers not supporting statfvs extension
  2719. Fixes issue arising when server does not support statfvs and or fstatvfs
  2720. extensions. sftp_statvfs() and sftp_fstatvfs() after this patch will
  2721. handle the case when SSH_FXP_STATUS is returned from server.
  2722. - [Marc Hoersken brought this change]
  2723. Added Windows Cryptography API: Next Generation based backend
  2724. - [Kamil Dudka brought this change]
  2725. partially revert "window_size: explicit adjustments only"
  2726. This partially reverts commit 03ca9020756a4e16f0294e5b35e9826ee6af2364
  2727. in order to fix extreme slowdown when uploading to localhost via SFTP.
  2728. I was able to repeat the issue on RHEL-7 on localhost only. It did not
  2729. occur when uploading via network and it did not occur on a RHEL-6 box
  2730. with the same version of libssh2.
  2731. The problem was that sftp_read() used a read-ahead logic to figure out
  2732. the window_size, but sftp_packet_read() called indirectly from
  2733. sftp_write() did not use any read-ahead logic.
  2734. - _libssh2_channel_write: client spins on write when window full
  2735. When there's no window to "write to", there's no point in waiting for
  2736. the socket to become writable since it most likely just will continue to
  2737. be.
  2738. Patch-by: ncm
  2739. Fixes #258
  2740. - _libssh2_channel_forward_cancel: avoid memory leaks on error
  2741. Fixes #257
  2742. - _libssh2_packet_add: avoid using uninitialized memory
  2743. In _libssh2_packet_add, called by _libssh2_packet_read, a call to
  2744. _libssh2_packet_send that is supposed to send a one-byte message
  2745. SSH_MSG_REQUEST_FAILURE would send an uninitialized byte upon re-entry
  2746. if its call to _send returns _EAGAIN.
  2747. Fixes #259
  2748. - _libssh2_channel_forward_cancel: accessed struct after free
  2749. ... and the assignment was pointless anyway since the struct was about
  2750. to be freed. Bug introduced in dde2b094.
  2751. Fixes #268
  2752. Peter Stuge (2 Jun 2013)
  2753. - [Marc Hoersken brought this change]
  2754. Fixed compilation using mingw-w64
  2755. - [Marc Hoersken brought this change]
  2756. knownhost.c: use LIBSSH2_FREE macro instead of free
  2757. Use LIBSSH2_FREE instead of free since
  2758. _libssh2_base64_encode uses LIBSSH2_ALLOC
  2759. Daniel Stenberg (18 May 2013)
  2760. - [Matthias Kerestesch brought this change]
  2761. libssh2_agent_init: init ->fd to LIBSSH2_INVALID_SOCKET
  2762. ... previously it was left at 0 which is a valid file descriptor!
  2763. Bug: https://trac.libssh2.org/ticket/265
  2764. Fixes #265
  2765. - userauth_password: pass on the underlying error code
  2766. _libssh2_packet_requirev() may return different errors and we pass that
  2767. to the parent instead of rewriting it.
  2768. Bug: http://libssh2.org/mail/libssh2-devel-archive-2013-04/0029.shtml
  2769. Reported by: Cosmin
  2770. Peter Stuge (9 May 2013)
  2771. - [Marc Hoersken brought this change]
  2772. libcrypt.c: Fix typo in _libssh2_rsa_sha1_sign() parameter type
  2773. Kamil Dudka (4 May 2013)
  2774. - configure.ac: replace AM_CONFIG_HEADER with AC_CONFIG_HEADERS
  2775. Reported by: Quintus
  2776. Bug: https://trac.libssh2.org/ticket/261
  2777. Guenter Knauf (12 Apr 2013)
  2778. - Fixed copyright string for NetWare build.
  2779. Daniel Stenberg (9 Apr 2013)
  2780. - [Richard W.M. Jones brought this change]
  2781. sftp: Add support for fsync (OpenSSH extension).
  2782. The new libssh2_sftp_fsync API causes data and metadata in the
  2783. currently open file to be committed to disk at the server.
  2784. This is an OpenSSH extension to the SFTP protocol. See:
  2785. https://bugzilla.mindrot.org/show_bug.cgi?id=1798
  2786. - [Richard W.M. Jones brought this change]
  2787. sftp: statvfs: Along error path, reset the correct 'state' variable.
  2788. - [Richard W.M. Jones brought this change]
  2789. sftp: seek: Don't flush buffers on same offset
  2790. Signed-off-by: Richard W.M. Jones <[email protected]>
  2791. Guenter Knauf (9 Feb 2013)
  2792. - Updated dependency libs.
  2793. - Fixed tool macro names.
  2794. Daniel Stenberg (29 Nov 2012)
  2795. - [Seth Willits brought this change]
  2796. compiler warnings: typecast strlen in macros
  2797. ... in macro parameters to avoid compiler warnings about lost precision.
  2798. Several macros in libssh2.h call strlen and pass the result directly to
  2799. unsigned int parameters of other functions, which warns about precision
  2800. loss because strlen returns size_t which is unsigned long on at least
  2801. some platforms (such as OS X). The fix is to simply typecast the
  2802. strlen() result to unsigned int.
  2803. - libssh2.h: bump version to 1.4.4-DEV
  2804. Version 1.4.3 (27 Nov 2012)
  2805. Daniel Stenberg (27 Nov 2012)
  2806. - RELEASE-NOTES: fixed for 1.4.3
  2807. - sftp_read: return error if a too large package arrives
  2808. Peter Stuge (13 Nov 2012)
  2809. - Only define _libssh2_dsa_*() functions when building with DSA support
  2810. Guenter Knauf (8 Nov 2012)
  2811. - Added .def file to output.
  2812. Kamil Dudka (1 Nov 2012)
  2813. - libssh2_hostkey_hash.3: update the description of return value
  2814. The function returns NULL also if the hash algorithm is not available.
  2815. Guenter Knauf (24 Oct 2012)
  2816. - Fixed mode acciedently committed.
  2817. - Ignore generated file.
  2818. - Added hack to make use of Makefile.inc.
  2819. This should avoid further maintainance of the objects list.
  2820. - Fixed MSVC NMakefile.
  2821. Added missing source files; added resource for DLL.
  2822. Kamil Dudka (22 Oct 2012)
  2823. - examples: use stderr for messages, stdout for data
  2824. Reported by: Karel Srot
  2825. Bug: https://bugzilla.redhat.com/867462
  2826. - openssl: do not leak memory when handling errors
  2827. ,.. in aes_ctr_init(). Detected by Coverity.
  2828. - channel: fix possible NULL dereference
  2829. ... in libssh2_channel_get_exit_signal(). Detected by Coverity.
  2830. - Revert "aes: the init function fails when OpenSSL has AES support"
  2831. This partially reverts commit f4f2298ef3635acd031cc2ee0e71026cdcda5864.
  2832. We need to use the EVP_aes_???_ctr() functions in FIPS mode.
  2833. - crypt: use hard-wired cipher block sizes consistently
  2834. - openssl: do not ignore failure of EVP_CipherInit()
  2835. - kex: do not ignore failure of libssh2_md5_init()
  2836. The MD5 algorithm is disabled when running in FIPS mode.
  2837. Daniel Stenberg (21 Aug 2012)
  2838. - [Peter Krempa brought this change]
  2839. known_hosts: Fail when parsing unknown keys in known_hosts file.
  2840. libssh2_knownhost_readfile() silently ignored problems when reading keys
  2841. in unsupported formats from the known hosts file. When the file is
  2842. written again from the internal structures of libssh2 it gets truntcated
  2843. to the point where the first unknown key was located.
  2844. * src/knownhost.c:libssh2_knownhost_readfile() - return error if key
  2845. parsing fails
  2846. - AUTHORS: synced with 42fec44c8a4
  2847. 31 recent authors added
  2848. - [Dave Hayden brought this change]
  2849. compression: add support for [email protected]
  2850. Add a "use_in_auth" flag to the LIBSSH2_COMP_METHOD struct and a
  2851. separate "[email protected]" method, along with checking session->state
  2852. for LIBSSH2_STATE_AUTHENTICATED. Appears to work on the OpenSSH servers
  2853. I've tried against, and it should work as before with normal zlib
  2854. compression.
  2855. - [Dmitry Smirnov brought this change]
  2856. configure: gcrypt doesn't come with pkg-config support
  2857. ... so use plain old -lgcrypt to the linker to link with it.
  2858. Fixes #225
  2859. - sftp_read: Value stored to 'next' is never read
  2860. Detected by clang-analyzer
  2861. - publickey_init: errors are negative, fix check
  2862. Detected by clang-analyzer.
  2863. - [Maxime Larocque brought this change]
  2864. session_free: wrong variable used for keeping state
  2865. If libssh2_session_free is called without the channel being freed
  2866. previously by libssh2_channel_free a memory leak could occur.
  2867. A mismatch of states variables in session_free() prevent the call to
  2868. libssh2_channel_free function. session->state member is used instead of
  2869. session->free_state.
  2870. It causes a leak of around 600 bytes on every connection on my systems
  2871. (Linux, x64 and PPC).
  2872. (Debugging done under contract for Accedian Networks)
  2873. Fixes #246
  2874. Guenter Knauf (29 Jun 2012)
  2875. - Small NetWare makefile tweak.
  2876. - Some small Win32 makefile fixes.
  2877. Daniel Stenberg (19 Jun 2012)
  2878. - libssh2_userauth_publickey_fromfile_ex.3: mention publickey == NULL
  2879. - comp_method_zlib_decomp: handle Z_BUF_ERROR when inflating
  2880. When using libssh2 to perform an SFTP file transfer from the "JSCAPE MFT
  2881. Server" (http://www.jscape.com) the transfer failed. The default JSCAPE
  2882. configuration is to enforce zlib compression on SSH2 sessions so the
  2883. session was compressed. The relevant part of the debug trace contained:
  2884. [libssh2] 1.052750 Transport: unhandled zlib error -5
  2885. [libssh2] 1.052750 Failure Event: -29 - decompression failure
  2886. The trace comes from comp_method_zlib_decomp() in comp.c. The "unhandled
  2887. zlib error -5" is the status returned from the zlib function
  2888. inflate(). The -5 status corresponds to "Z_BUF_ERROR".
  2889. The inflate() function takes a pointer to a z_stream structure and
  2890. "inflates" (decompresses) as much as it can. The relevant fields of the
  2891. z_stream structure are:
  2892. next_in - pointer to the input buffer containing compressed data
  2893. avail_in - the number of bytes available at next_in
  2894. next_out - pointer to the output buffer to be filled with uncompressed
  2895. data
  2896. avail_out - how much space available at next_out
  2897. To decompress data you set up a z_stream struct with the relevant fields
  2898. filled in and pass it to inflate(). On return the fields will have been
  2899. updated so next_in and avail_in show how much compressed data is yet to
  2900. be processed and next_out and avail_out show how much space is left in
  2901. the output buffer.
  2902. If the supplied output buffer is too small then on return there will be
  2903. compressed data yet to be processed (avail_in != 0) and inflate() will
  2904. return Z_OK. In this case the output buffer must be grown, avail_out
  2905. updated and inflate() called again.
  2906. If the supplied output buffer was big enough then on return the
  2907. compressed data will have been exhausted (avail_in == 0) and inflate()
  2908. will return Z_OK, so the data has all been uncompressed.
  2909. There is a corner case where inflate() makes no progress. That is, there
  2910. may be unprocessed compressed data and space available in the output
  2911. buffer and yet the function does nothing. In this case inflate() will
  2912. return Z_BUF_ERROR. From the zlib documentation and the source code it
  2913. is not clear under what circumstances this happens. It could be that it
  2914. needs to write multiple bytes (all in one go) from its internal state to
  2915. the output buffer before processing the next chunk of input but but
  2916. can't because there is not enough space (though my guesses as to the
  2917. cause are not really relevant). Recovery from Z_BUF_ERROR is pretty
  2918. simple - just grow the output buffer, update avail_out and call
  2919. inflate() again.
  2920. The comp_method_zlib_decomp() function does not handle the case when
  2921. inflate() returns Z_BUF_ERROR. It treats it as a non-recoverable error
  2922. and basically aborts the session.
  2923. Fixes #240
  2924. Guenter Knauf (12 Jun 2012)
  2925. - MinGW makefile tweaks.
  2926. Use GNU tools when compiling on Linux.
  2927. Fixed dist and dev targets.
  2928. - NetWare makefile tweaks.
  2929. Changed to use Windows commandline tools instead of
  2930. GNU tools when compiling on Windows. Fixed dist and
  2931. dev targets. Enabled nlmconv error for unresolved
  2932. symbols.
  2933. Daniel Stenberg (11 Jun 2012)
  2934. - Revert "config.rpath: generated file, no need to keep in git"
  2935. This reverts commit 1ac7bd09cc685755577fb2c8829adcd081e7ab3c.
  2936. This file still used by lib/*m4 functions so we need to keep the file
  2937. around.
  2938. - BINDINGS: added PySsh2, a Python-ctypes binding
  2939. Guenter Knauf (8 Jun 2012)
  2940. - Fixed MinGW debug build.
  2941. Daniel Stenberg (5 Jun 2012)
  2942. - BINDINGS: Added the Cocoa/Objective-C one
  2943. ... and sorted the bindings after the languages, alphabetically
  2944. Reported by: Mike Abdullah
  2945. - BINDINGS: document the bindings we know of
  2946. Guenter Knauf (4 Jun 2012)
  2947. - Fixed LIBSSH2_INT64_T_FORMAT macro.
  2948. Usually a format macro should hold the whole format, otherwise
  2949. it should be named a prefix. Also fixed usage of this macro in
  2950. scp.c for a signed var where it was used as prefix for unsigned.
  2951. - Removed obsolete define from makefiles.
  2952. - Renamed NetWare makefiles.
  2953. - Renamed NetWare makefiles.
  2954. - Synced MinGW makefiles with 56c64a6..39e438f.
  2955. Also synced MinGW test makefile with b092696..f8cb874.
  2956. Peter Stuge (30 May 2012)
  2957. - Revert "sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN"
  2958. This reverts commit 04e79e0c798674a0796be8a55f63dd92e6877790.
  2959. - sftp: Don't send attrs.permissions on read-only SSH_FXP_OPEN
  2960. This works around a protocol violation in the ProFTPD 1.3.4 mod_sftp
  2961. server, as reported by Will Cosgrove in:
  2962. http://libssh2.org/mail/libssh2-devel-archive-2012-05/0079.shtml
  2963. Based on a suggested fix by TJ Saunders in:
  2964. http://libssh2.org/mail/libssh2-devel-archive-2012-05/0104.shtml
  2965. Guenter Knauf (28 May 2012)
  2966. - Try to detect OpenSSL build type automatically.
  2967. Also fixed recently added libgdi32 linkage which is only
  2968. required when OpenSSL libs are linked statically.
  2969. Daniel Stenberg (25 May 2012)
  2970. - config.rpath: generated file, no need to keep in git
  2971. Guenter Knauf (22 May 2012)
  2972. - Updated dependency libary versions.
  2973. Daniel Stenberg (18 May 2012)
  2974. - 1.4.3: towards the future
  2975. Version 1.4.2 (18 May 2012)
  2976. Daniel Stenberg (18 May 2012)
  2977. - RELEASE-NOTES: synced with 92a9f952794
  2978. Alexander Lamaison (15 May 2012)
  2979. - win32/libssh2_config.h: Remove hardcoded #define LIBSSH2_HAVE_ZLIB.
  2980. Rationale: Everything else in this file states a fact about the win32
  2981. platform that is unconditional for that platform. There is nothing
  2982. unconditional about the presence of zlib. It is neither included with
  2983. Windows nor with the platform SDK. Therefore, this is not an appropriate
  2984. place to assert its presence. Especially as, once asserted, it cannot be
  2985. overridden using a compiler flag.
  2986. In contrast, if it is omitted, then it can easily be reasserted by adding
  2987. a compiler flag defining LIBSSH2_HAVE_ZLIB.
  2988. Daniel Stenberg (14 May 2012)
  2989. - RELEASE-NOTES: synced with 69a3354467c
  2990. - _libssh2_packet_add: SSH_MSG_CHANNEL_REQUEST default to want_reply
  2991. RFC4254 says the default 'want_reply' is TRUE but the code defaulted to
  2992. FALSE. Now changed.
  2993. Fixes #233
  2994. - gettimeofday: no need for a replacement under cygwin
  2995. Fixes #224
  2996. Alexander Lamaison (13 May 2012)
  2997. - Prevent sftp_packet_read accessing freed memory.
  2998. sftp_packet_add takes ownership of the packet passed to it and (now that we
  2999. handle zombies) might free the packet. sftp_packet_read uses the packet type
  3000. byte as its return code but by this point sftp_packet_add might have freed
  3001. it. This change fixes the problem by caching the packet type before calling
  3002. sftp_packet_add.
  3003. I don't understand why sftp_packet_read uses the packet type as its return
  3004. code. A future change might get rid of this entirely.
  3005. Daniel Stenberg (12 May 2012)
  3006. - sftp_packet_flush: flush zombies too
  3007. As this function is called when the SFTP session is closed, it needs to
  3008. also kill all zombies left in the SFTP session to avoid leaking memory
  3009. just in case some zombie would still be in there.
  3010. - sftp_packetlist_flush: zombies must not have responses already
  3011. When flushing the packetlist, we must only add the request as a zombie
  3012. if no response has already been received. Otherwise we could wrongly
  3013. make it a zombie even though the response was already received and then
  3014. we'd get a zombie stuck there "forever"...
  3015. - sftp_read: on EOF remove packet before flush
  3016. Since the sftp_packetlist_flush() function will move all the existing
  3017. FXP_READ requests in this handle to the zombie list we must first remove
  3018. this just received packet as it is clearly not a zombie.
  3019. - sftp_packet_require: sftp_packet_read() returning 0 is not an error
  3020. Exactly as the comment in the code said, checking the return code from
  3021. sftp_packet_read() with <= was wrong and it should be < 0. With the new
  3022. filtering on incoming packets that are "zombies" we can now see this
  3023. getting zero returned.
  3024. - sftp_packetlist_flush: only make it zombie if it was sent
  3025. The list of outgoing packets may also contain packets that never were
  3026. sent off and we better not make them zombies too.
  3027. - [Alexander Lamaison brought this change]
  3028. Mark outstanding read requests after EOF as zombies.
  3029. In order to be fast, sftp_read sends many read requests at once. With a small
  3030. file, this can mean that when EOF is received back, many of these requests are
  3031. still outstanding. Responses arriving after we close the file and abandon the
  3032. file handle are queued in the SFTP packet queue and never collected. This
  3033. causes transfer speed to drop as a progressively longer queue must be searched
  3034. for every packet.
  3035. This change introduces a zombie request-ID list in the SFTP session that is
  3036. used to recognise these outstanding requests and prevent them being added to
  3037. the queue.
  3038. Peter Stuge (23 Apr 2012)
  3039. - [Rafael Kitover brought this change]
  3040. Update win32/GNUmakefile to use OpenSSL 1.0.1a
  3041. libcrypto on win32 now depends on gdi32.dll, so move the OpenSSL LDLIBS
  3042. block to before the compiler definitions, so that libcrypto gets added
  3043. first, and then add -lgdi32 into the following common LDLIBS for gcc.
  3044. Guenter Knauf (23 Apr 2012)
  3045. - Changed 'Requires' to 'Requires.private'.
  3046. Only static builds need to link against the crypto libs.
  3047. - Fixed 'Requires:' names.
  3048. The 'Requires:' line lists the names of the .pc files.
  3049. - Added 'Requires:' line to libssh2.pc.
  3050. This is necessary so that other libs which lookup libssh2 info
  3051. via pkg-config can add the right crypto lib dependencies.
  3052. - Updated dependency lib versions.
  3053. Peter Stuge (18 Apr 2012)
  3054. - configure.ac: Add option to disable build of the example applications
  3055. Examples are built by default. Any of the following options on the
  3056. configure command line will skip building them:
  3057. --disable-examples-build
  3058. --enable-examples-build=no
  3059. --enable-examples-build=false
  3060. - userauth.c: fread() from public key file to correctly detect any errors
  3061. If the filename parameter for file_read_publickey() was the name of a
  3062. directory instead of a file then libssh2 would spin trying to fgetc()
  3063. from the FILE * for the opened directory when trying to determine the
  3064. length of the encoded public key, since fgetc() can't report errors.
  3065. Use fread() instead to correctly detect this error condition along
  3066. with many others.
  3067. This fixes the problem reported in
  3068. http://www.libssh2.org/mail/libssh2-devel-archive-2012-04/0021.shtml
  3069. Reported-by: Oleksiy Zagorskyi <[email protected]>
  3070. - Return LIBSSH2_ERROR_SOCKET_DISCONNECT on EOF when reading banner
  3071. Guenter Knauf (17 Apr 2012)
  3072. - Fixed copyright year.
  3073. - Updated dependency lib versions in static makefiles.
  3074. Daniel Stenberg (6 Apr 2012)
  3075. - version: bump to 1.4.2
  3076. We're on the 1.4.2 track now (at least)
  3077. Version 1.4.1 (4 Apr 2012)
  3078. Daniel Stenberg (4 Apr 2012)
  3079. - RELEASE-NOTES: updated for 1.4.1 release
  3080. - always do "forced" window updates
  3081. When calling _libssh2_channel_receive_window_adjust() internally, we now
  3082. always use the 'force' option to prevent libssh2 to avoid sending the
  3083. update if the update isn't big enough.
  3084. It isn't fully analyzed but we have seen corner cases which made a
  3085. necessary window update not get send due to this and then the other side
  3086. doesn't send data our side then sits waiting for forever.
  3087. - channel_read: force window adjusts!
  3088. if there's not enough room to receive the data that's being requested,
  3089. the window adjustment needs to be sent to the remote and thus the force
  3090. option has to be used. _libssh2_channel_receive_window_adjust() would
  3091. otherwise "queue" small window adjustments for a later packet but that
  3092. is really terribly for the small buffer read that for example is the
  3093. final little piece of a very large file as then there is no logical next
  3094. packet!
  3095. Reported by: Armen Babakhanian
  3096. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0130.shtml
  3097. - [Paul Howarth brought this change]
  3098. aes: the init function fails when OpenSSL has AES support
  3099. The internal init function only worked fine when the configure script
  3100. didn't detect the OpenSSL AES_CTR function!
  3101. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0111.shtml
  3102. Reported by: Paul Howarth
  3103. - [Matthew Booth brought this change]
  3104. transport_send: Finish in-progress key exchange before sending data
  3105. _libssh2_channel_write() first reads outstanding packets before writing
  3106. new data. If it reads a key exchange request, it will immediately start
  3107. key re-exchange, which will require sending a response. If the output
  3108. socket is full, this will result in a return from
  3109. _libssh2_transport_read() of LIBSSH2_ERROR_EAGAIN. In order not to block
  3110. a write because there is no data to read, this error is explicitly
  3111. ignored and the code continues marshalling a packet for sending. When it
  3112. is sent, the remote end immediately drops the connection because it was
  3113. expecting a continuation of the key exchange, but got a data packet.
  3114. This change adds the same check for key exchange to
  3115. _libssh2_transport_send() that is in _libssh2_transport_read(). This
  3116. ensures that key exchange is completed before any data packet is sent.
  3117. - channel_write: acknowledge transport errors
  3118. When draining data off the socket with _libssh2_transport_read() (which
  3119. in turn has to be done so that we can be sure to have read any possible
  3120. window-increasing packets), this code previously ignored errors which
  3121. could lead to nasty loops. Now all error codes except EAGAIN will cause
  3122. the error to be returned at once.
  3123. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0068.shtml
  3124. Reported by: Matthew Booth
  3125. - [Steven Dake brought this change]
  3126. In examples/x11.c, Make sure sizeof passed to read operation is correct
  3127. sizeof(buf) expands to 8 or 4 (since its a pointer). This variable may
  3128. have been static in the past, leading to this error.
  3129. Signed-off-by: Steven Dake <[email protected]>
  3130. - [Steven Dake brought this change]
  3131. Fix suspicious sizeof usage in examples/x11.c
  3132. In the x11 example, sizeof(buf) = 8UL (on x86_64), when this should
  3133. probably represent the buffer size available. I am not sure how to
  3134. test that this change is actually correct, however.
  3135. Signed-off-by: Steven Dake <[email protected]>
  3136. - sftp_packet_read: follow-up fix for EAGAIN/window adjust
  3137. The commit in 7194a9bd7ba45 wasn't complete. This change makes sure
  3138. variables are initialized properly before used in the EAGAIN and window
  3139. adjust cases.
  3140. - sftp_packet_add: use named error code instead of number
  3141. - sftp_packet_add: verify the packet before accepting it
  3142. In order to bail out as quickly as possible when things are wrong and
  3143. out of sync, make sure the SFTP message is one we understand.
  3144. - SFTP: preserve the original error code more
  3145. Lots of places in the code translated the original error into the more
  3146. generic LIBSSH2_ERROR_SOCKET_TIMEOUT but this turns out to distort the
  3147. original error reason a lot and makes tracking down the real origin of a
  3148. problem really hard. This change makes the original error code be
  3149. preserved to a larger extent when return up to the parent function.
  3150. - sftp_packet_read: adjust window size as necessary
  3151. Commit 03ca9020756 tried to simplify the window sizing logic but broke
  3152. SFTP readdir as there was no window sizing code left there so large
  3153. directory listings no longer worked.
  3154. This change introduces window sizing logic to the sftp_packet_read()
  3155. function so that it now tells the remote about the local size having a
  3156. window size that suffice when it is about to ask for directory data.
  3157. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2012-03/0069.shtml
  3158. Reported by: Eric
  3159. - [Steven Dake brought this change]
  3160. Tell C compiler we don't care about return code of libssh2_init
  3161. The call of libssh2_init returns a return code, but nothing could be done
  3162. within the _libssh2_init_if_needed execution path.
  3163. Signed-off-by: Steven Dake <[email protected]>
  3164. - [Steven Dake brought this change]
  3165. Add comment indicating a resource leak is not really a resource leak
  3166. While possibly obvious to those investigating the code, coverity complains
  3167. about this out of scope leak.
  3168. Signed-off-by: Steven Dake <[email protected]>
  3169. - [Steven Dake brought this change]
  3170. Use safer snprintf rather then sprintf in scp_send()
  3171. Signed-off-by: Steven Dake <[email protected]>
  3172. - [Steven Dake brought this change]
  3173. Use safer snprintf rather then sprintf in scp_recv()
  3174. While the buffer is indeed allocated to a safe length, better safe then sorry.
  3175. Signed-off-by: Steven Dake <[email protected]>
  3176. - [Steven Dake brought this change]
  3177. use snprintf in knownhost_writeline() rather then sprintf
  3178. Although the function checks the length, if the code was in error, there
  3179. could potentially be a buffer overrun with the use of sprintf. Instead replace
  3180. with snprintf.
  3181. Signed-off-by: Steven Dake <[email protected]>
  3182. - [Steven Dake brought this change]
  3183. Add tracing to print packets left on session at libssh2_session_free
  3184. Signed-off-by: Steven Dake <[email protected]>
  3185. Peter Stuge (2 Mar 2012)
  3186. - Define and use LIBSSH2_INVALID_SOCKET instead of INVALID_SOCKET
  3187. INVALID_SOCKET is a special value in Windows representing a
  3188. non-valid socket identifier. We were #defining this to -1 on
  3189. non-Windows platforms, causing unneccessary namespace pollution.
  3190. Let's have our own identifier instead.
  3191. Thanks to Matt Lawson for pointing this out.
  3192. - nw/Makefile.netware: Fix project name typo to avoid needless confusion
  3193. - example/x11: Set raw terminal mode manually instead of with cfmakeraw()
  3194. OpenSolaris has no cfmakeraw() so to make the example more portable
  3195. we simply do the equivalent operations on struct termios ourselves.
  3196. Thanks to Tom Weber for reporting this problem, and finding a solution.
  3197. Daniel Stenberg (17 Feb 2012)
  3198. - sftp_write: cannot return acked data *and* EAGAIN
  3199. Whenever we have acked data and is about to call a function that *MAY*
  3200. return EAGAIN we must return the number now and wait to get called
  3201. again. Our API only allows data *or* EAGAIN and we must never try to get
  3202. both.
  3203. Peter Stuge (13 Feb 2012)
  3204. - example/x11: Build only when sys/un.h is found by configure
  3205. The example can't be built on systems without AF_UNIX sockets.
  3206. Daniel Stenberg (10 Feb 2012)
  3207. - [Alexander Lamaison brought this change]
  3208. Simplified sftp_read.
  3209. Removed the total_read variable that originally must have tracked how
  3210. much data had been written to the buffer. With non-blocking reads, we
  3211. must return straight away once we have read data into the buffer so this
  3212. variable served not purpose.
  3213. I think it was still hanging around in case the initial processing of
  3214. 'leftover' data meant we wrote to the buffer but this case, like the
  3215. others, must return immediately. Now that it does, the last remaining
  3216. need for the variable is gone.
  3217. - [Alexander Lamaison brought this change]
  3218. Cleaned up sftp_read and added more explanation.
  3219. Replaced the gotos which were implementing the state machine with
  3220. a switch statement which makes the states more explicit.
  3221. - sftp_read: avoid data *and* EAGAIN
  3222. Whenever we have data and is about to call a function that *MAY* return
  3223. EAGAIN we must return the data now and wait to get called again. Our API
  3224. only allows data *or* EAGAIN and we must never try to get both.
  3225. Peter Stuge (2 Feb 2012)
  3226. - Add a tcpip-forward example which demonstrates remote port forwarding
  3227. - libssh2.h: Add missing prototype for libssh2_session_banner_set()
  3228. - example/subsystem_netconf.c: Return error when read buffer is too small
  3229. Also remove a little redundancy in the read loop condition.
  3230. - example/subsystem_netconf.c: Add a missing newline in an error message
  3231. - Fix undefined reference to _libssh_error in libgcrypt backend
  3232. Commit 209de22299b4b58e582891dfba70f57e1e0492db introduced a function
  3233. call to a non-existing function, and since then the libgcrypt backend
  3234. has not been buildable.
  3235. Version 1.4.0 (31 Jan 2012)
  3236. Daniel Stenberg (31 Jan 2012)
  3237. - RELEASE-NOTES: synced with 6bd584d29 for 1.4.0
  3238. - s/1.3.1/1.4.0
  3239. We're bumping the minor number
  3240. - [Jernej Kovacic brought this change]
  3241. libssh2_session_supported_algs: fix compiler warning
  3242. - [Jernej Kovacic brought this change]
  3243. session_supported_algs docs: added an example
  3244. - [Gellule Xg brought this change]
  3245. sftp-seek: clear EOF flag
  3246. Set the EOF flag to False when calling seek64 to be able to get some
  3247. data back on a following read
  3248. - [Peter Krempa brought this change]
  3249. userauth: Provide more informations if ssh pub key extraction fails
  3250. If the function that extracts/computes the public key from a private key
  3251. fails the errors it reports were masked by the function calling it. This
  3252. patch modifies the key extraction function to return errors using
  3253. _libssh_error() function. The error messages are tweaked to contain
  3254. reference to the failed operaton in addition to the reason.
  3255. * AUTHORS: - add my name
  3256. * libgcrypt.c: _libssh2_pub_priv_keyfile(): - return a more verbose
  3257. error using
  3258. _libssh2_error() func.
  3259. * openssl.c: - modify call graph of _libssh2_pub_priv_keyfile() to use
  3260. _libssh2_error for error reporting();
  3261. * userauth.c: - tweak functions calling _libssh2_pub_priv_keyfile() not
  3262. to shadow error messages
  3263. - TODO: remove issues we (sort of) did already
  3264. - ssh2_exec: skip error outputs for EAGAIN
  3265. Since the example uses non-blocking mode, it will just flood the output
  3266. with this "nonsense" error.
  3267. Guenter Knauf (30 Nov 2011)
  3268. - Some NetWare makefile tweaks.
  3269. Daniel Stenberg (18 Nov 2011)
  3270. - LIBSSH2_SFTP_PACKET_MAXLEN: increase to 80000
  3271. Some SFTP servers send SFTP packets larger than 40000. Since the limit
  3272. is only present to avoid insane sizes anyway, we can easily bump it.
  3273. The define was formerly in the public header libssh2_sftp.h but served
  3274. no external purpose and was moved into the source dir.
  3275. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-11/0004.shtml
  3276. Reported by: Michael Harris
  3277. Alexander Lamaison (18 Nov 2011)
  3278. - [Peter Krempa brought this change]
  3279. knownhost_check(): Don't dereference ext if NULL is passed
  3280. Documentation for libssh2_knownhost_checkp() and related functions
  3281. states that the last argument is filled with data if non-NULL.
  3282. "knownhost if set to non-NULL, it must be a pointer to a 'struct
  3283. libssh2_knownhost' pointer that gets filled in to point to info about a
  3284. known host that matches or partially matches."
  3285. In this function ext is dereferenced even if set to NULL, causing
  3286. segfault in applications not needing the extra data.
  3287. Daniel Stenberg (11 Nov 2011)
  3288. - [Peter Krempa brought this change]
  3289. knownhost_add: Avoid dereferencing uninitialized memory on error path.
  3290. In function knownhost_add, memory is alocated for a new entry. If normal
  3291. alocation is used, memory is not initialized to 0 right after, but a
  3292. check is done to verify if correct key type is passed. This test is done
  3293. BEFORE setting the memory to null, and on the error path function
  3294. free_host() is called, that tries to dereference unititialized memory,
  3295. resulting into a glibc abort().
  3296. * knownhost.c - knownhost_add(): - move typemask check before alloc
  3297. - windows build: add define to avoid compiler warning
  3298. A recent mingw compiler has started to complain on "#warning Please
  3299. include winsock2.h before windows.h" unless the magic define is set
  3300. first.
  3301. Reported by: Vincent Torri
  3302. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-10/0064.shtml
  3303. Henrik Nordstrom (31 Oct 2011)
  3304. - [Vincent Torri brought this change]
  3305. Correct Windows include file name case, simplifying cross-compilation
  3306. When cross compiling to Windows, libssh2.h include Windows header files
  3307. with upper case filenames : BaseTsd.h and WinSock2.h.
  3308. These files have lowercase names with mingw-w64 (iirc, it's the same with
  3309. mingw). And as on Windows, being lowercase or uppercase does not matter.
  3310. Daniel Stenberg (25 Oct 2011)
  3311. - [Jernej Kovacic brought this change]
  3312. libssh2_session_supported_algs: added
  3313. - [Kamil Dudka brought this change]
  3314. example/sftp_RW_nonblock: do not ignore LIBSSH2_ERROR_EAGAIN
  3315. Bug: https://bugzilla.redhat.com/745420
  3316. Peter Stuge (5 Oct 2011)
  3317. - example/ssh2_agent: Print host key fingerprint before authentication
  3318. Also moves the comment about not being authenticated to before the
  3319. agent authentication takes place, so that it better matches the code.
  3320. Daniel Stenberg (29 Sep 2011)
  3321. - OpenSSL EVP: fix threaded use of structs
  3322. Make sure we don't clear or reset static structs after first init so
  3323. that they work fine even when used from multiple threads. Init the
  3324. structs in the global init.
  3325. Help and assistance by: John Engstrom
  3326. Fixes #229 (again)
  3327. - openssl: don't init static structs differently
  3328. make_ctr_evp() is changed to take a struct pointer, and then each
  3329. _libssh2_EVP_aes_[keylen]_ctr function is made to pass in their own
  3330. static struct
  3331. Reported by: John Engstrom
  3332. Fixes #229
  3333. Guenter Knauf (27 Sep 2011)
  3334. - Removed obsolete include path.
  3335. Daniel Stenberg (21 Sep 2011)
  3336. - read_state: clear the state variable better
  3337. Set read_state back to idle before trying to send anything so that if
  3338. the state somehow is wrongly set.
  3339. Also, avoid such a case of confusion by resetting the read_state when an
  3340. sftp handle is closed.
  3341. - sftp_read: remove leftover fprintf
  3342. Reported by: Alexander Lamaison
  3343. - sftp.h: fix the #ifdef to prevent multiple inclusions
  3344. - sftp_read: use a state variable to avoid bad writes
  3345. When a channel_write call has gotten an EAGAIN back, we try harder to
  3346. continue the same write in the subsequent invoke.
  3347. - window_size: explicit adjustments only
  3348. Removed the automatic window_size adjustments from
  3349. _libssh2_channel_read() and instead all channel readers must now make
  3350. sure to enlarge the window sizes properly themselves.
  3351. libssh2_channel_read_ex() - the public function, now grows the window
  3352. size according to the requested buffer size. Applications can still opt
  3353. to grow the window more on demand. Larger windows tend to give higher
  3354. performance.
  3355. sftp_read() now uses the read-ahead logic to figure out a window_size.
  3356. - libssh2.h: bump the default window size to 256K
  3357. - libssh2_userauth_keyboard_interactive.3: fix man warning
  3358. It seemed to occur due to the excessive line length
  3359. - [Mikhail Gusarov brought this change]
  3360. Add missing .gitignore entries
  3361. - [Mikhail Gusarov brought this change]
  3362. Add manpage syntax checker to 'check' target
  3363. In virtually every libssh2 release Debian's lintian catches syntax errors in
  3364. manpages. Prevent it by checking manpages as a part of testsuite.
  3365. - libssh2_banner_set.3: fix nroff syntax mistake
  3366. Guenter Knauf (10 Sep 2011)
  3367. - Use predefined resource compiler macro.
  3368. - Added casts to silent compiler warnings.
  3369. - Fixed uint64_t printf.
  3370. - Fixed macro function signatures.
  3371. - NetWare makefile tweaks.
  3372. - Removed unused var.
  3373. - Added 2 samples not mentioned.
  3374. - Dont build x11 sample with MinGW.
  3375. - Fixed executable file description.
  3376. - Removed unused var.
  3377. - Kill stupid gcc 3.x uninitialized warning.
  3378. - Build all examples.
  3379. - More MinGW makefile tweaks.
  3380. Renamed *.mingw makefiles to GNUmakefile since GNU make picks these
  3381. up automatically, and therefore win32/Makefile removed.
  3382. - Removed forgotten WINSOCK_VERSION defines.
  3383. Daniel Stenberg (9 Sep 2011)
  3384. - libssh2_session_startup(3) => libssh2_session_handshake(3)
  3385. Propagate for the current function in docs and examples.
  3386. libssh2_session_startup() is deprecated.
  3387. - libssh2_banner_set => libssh2_session_banner_get
  3388. Marked the old function as deprecated. Added the new name in the correct
  3389. name space with the same arguments and functionality.
  3390. - new function: libssh2_session_banner_get
  3391. Returns the banner from the server handshake
  3392. Fixes #226
  3393. - libssh2.h: bump version to 1.4.0 for new function(s)
  3394. - remove embedded CVS/svn tags
  3395. - [liuzl brought this change]
  3396. API add:libssh2_sftp_get_channel
  3397. Return the channel of sftp, then caller can
  3398. control the channel's behavior.
  3399. Signed-off-by: liuzl <[email protected]>
  3400. - _libssh2_channel_read: react on errors from receive_window_adjust
  3401. Previously the function would ignore all errors except for EAGAIN.
  3402. - sftp_read: extend and clarify the documentation
  3403. - sftp_read: cap the read ahead maximum amount
  3404. Now we only go up to LIBSSH2_CHANNEL_WINDOW_DEFAULT*30 bytes SFTP read
  3405. ahead, which currently equals 64K*30 == 1966080 bytes.
  3406. - _libssh2_channel_read: fix non-blocking window adjusting
  3407. If EAGAIN is returned when adjusting the receive window, we must not
  3408. read from the transport directly until we've finished the adjusting.
  3409. Guenter Knauf (8 Sep 2011)
  3410. - Fix for systems which need sys/select.h.
  3411. - The files were not gone but renamed ...
  3412. Daniel Stenberg (6 Sep 2011)
  3413. - sftp_read: added documenting comment
  3414. Taken from some recent email conversations I added some descriptions of
  3415. the logic in sftp_read() to aid readers.
  3416. - 1.3.1: start the work
  3417. Version 1.3.0 (6 Sep 2011)
  3418. Daniel Stenberg (6 Sep 2011)
  3419. - Makefile.am: the Makefile.win32 files are gone
  3420. - RELEASE-NOTES: updated for 1.3.0
  3421. - sftp_read: a short read is not end of file
  3422. A returned READ packet that is short will now only reduce the
  3423. offset.
  3424. This is a temporary fix as it is slightly better than the previous
  3425. approach but still not very good.
  3426. - [liuzl brought this change]
  3427. _libssh2_packet_add: adjust window size when truncating
  3428. When receiving more data than what the window size allows on a
  3429. particular channel, make sure that the window size is adjusted in that
  3430. case too. Previously it would only adjust the window in the non-error
  3431. case.
  3432. Guenter Knauf (29 Aug 2011)
  3433. - Silent compiler warning with MinGW64.
  3434. - Fixed link to native Win32 awk tool.
  3435. - Renamed MinGW makefiles.
  3436. - Some MinGW makefile tweaks.
  3437. Enable build without GNU tools and with MinGW64 compiler.
  3438. - Fixed aes_ctr_do_cipher() signature.
  3439. Daniel Stenberg (26 Aug 2011)
  3440. - [liuzl brought this change]
  3441. libssh2_sftp_seek64: flush packetlist and buffered data
  3442. When seeking to a new position, flush the packetlist and buffered data
  3443. to prevent already received or pending data to wrongly get used when
  3444. sftp-reading from the new offset within the file.
  3445. - sftp_read: advance offset correctly for buffered copies
  3446. In the case where a read packet has been received from the server, but
  3447. the entire contents couldn't be copied to the user-buffer, the data is
  3448. instead buffered and copied to the user's buffer in the next invocation
  3449. of sftp_read(). When that "extra" copy is made, the 'offset' pointer was
  3450. not advanced accordingly.
  3451. The biggest impact of this flaw was that the 'already' variable at the
  3452. top of the function that figures out how much data "ahead" that has
  3453. already been asked for would slowly go more and more out of sync, which
  3454. could lead to the file not being read all the way to the end.
  3455. This problem was most noticable in cases where the application would
  3456. only try to read the exact file size amount, like curl does. In the
  3457. examples libssh2 provides the sftp read function is most often called
  3458. with a fixed size large buffer and then the bug would not appear as
  3459. easily.
  3460. This bug was introduced in the SFTP rewrite in 1.2.8.
  3461. Bug: http://curl.haxx.se/mail/lib-2011-08/0305.html
  3462. http://www.libssh2.org/mail/libssh2-devel-archive-2011-08/0085.shtml
  3463. - wrap some long lines < 80 columns
  3464. - LIBSSH2_RECV: fix typo, use the RECV_FD macro
  3465. - subsystem_netconf.c: fix compiler warnings
  3466. - [Henrik Nordstrom brought this change]
  3467. Custom callbacks for performing low level socket I/O
  3468. - version bump: start working towards 1.3.0
  3469. Version 1.2.9 (16 Aug 2011)
  3470. Daniel Stenberg (16 Aug 2011)
  3471. - RELEASE-NOTES: synced with 95d69d3a81261
  3472. - [Henrik Nordstrom brought this change]
  3473. Document prototypes for macro defined functions
  3474. - [Henrik Nordstrom brought this change]
  3475. Avoid reuse after free when closing X11 channels
  3476. - _libssh2_channel_write: handle window_size == 0 better
  3477. When about to send data on the channel and the window size is 0, we must
  3478. not just return 0 if the transport_read() function returned EAGAIN as it
  3479. then causes a busy-loop.
  3480. Bug: http://libssh2.org/mail/libssh2-devel-archive-2011-08/0011.shtml
  3481. - gettimeofday: fix name space pollution
  3482. For systems without its own gettimeofday() implementation, we still must
  3483. not provide one outside our namespace.
  3484. Reported by: Bill Segall
  3485. Dan Fandrich (5 Aug 2011)
  3486. - libssh2.pc.in: Fixed spelling in pkgconfig file
  3487. Peter Stuge (17 Jul 2011)
  3488. - example/subsystem_netconf.c: Add missing #include <string.h>
  3489. - example/subsystem_netconf.c: Discard ]]>]]> and return only XML response
  3490. - example/subsystem_netconf.c: Fix uninitialized variable bug
  3491. - example: Add subsystem_netconf.c
  3492. This example demonstrates how to use libssh2 to send a request to
  3493. the NETCONF subsystem available e.g. in JunOS.
  3494. See also http://tools.ietf.org/html/draft-ietf-netconf-ssh-06
  3495. Daniel Stenberg (16 Jul 2011)
  3496. - man page cleanups: non-existing functions need no man pages
  3497. - libssh2_new_host_entry.3: removed
  3498. This is just junk leftovers.
  3499. - userauth_keyboard_interactive: fix buffer overflow
  3500. Partly reverse 566894494b4972ae12 which was simplifying the code far too
  3501. much and ended up overflowing a buffer within the LIBSSH2_SESSION
  3502. struct. Back to allocating the buffer properly like it used to do.
  3503. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-06/0032.shtml
  3504. Reported by: Alfred Gebert
  3505. - keyboard-interactive man page: cleaned up
  3506. - [Alfred Gebert brought this change]
  3507. _libssh2_recv(): handle ENOENT error as EAGAIN
  3508. A sftp session failed with error "failure establishing ssh session" on
  3509. Solaris and HP-UX. Sometimes the first recv() function call sets errno
  3510. to ENOENT. In the man pages for recv of Solaris and HP-UX the error
  3511. ENOENT is not documented.
  3512. I tested Solaris SPARC and x86, HP-UX i64, AIX, Windows and Linux.
  3513. - agent_list_identities: fix out of scope access
  3514. An auto variable out of scope was being referenced and used.
  3515. fixes #220
  3516. - _libssh2_wait_socket: fix timeouts for poll() uses
  3517. - windows: inclusion fix
  3518. include winsock2.h for all windows compilers
  3519. - keyb-interactive: add the fixed buffer
  3520. Belongs to commit 5668944
  3521. - code cleanup: don't use C99/c++ comments
  3522. We aim for C89 compliance
  3523. - keyb-interactive: allow zero length fields
  3524. Allow zero length fields so they don't cause malloc(0) calls
  3525. Avoid free()ing NULL pointers
  3526. Avoid a malloc of a fixed 5 byte buffer.
  3527. - libssh2_channel_process_startup.3: clean up
  3528. Remove the references to the macro-fied shortcuts as they have their own
  3529. individual man pages.
  3530. Made the prototype different and more readable.
  3531. - man page: fix .BR lines
  3532. We don't use \fI etc on .BR lines
  3533. - userauth_keyboard_interactive: skip code on zero length auth
  3534. - libssh2_channel_forward_accept.3: mention how to get error
  3535. Since this returns a pointer, libssh2_session_last_errno() must be used
  3536. to get the actual error code and it wasn't that clear before.
  3537. - timeout docs: mention they're added in 1.2.9
  3538. - sftp_write_sliding.c: indent fix
  3539. Use the standard indenting and removed CVS leftover comment
  3540. - [zl liu brought this change]
  3541. sftp_write_sliding: send the complete file
  3542. When reaching the end of file there can still be data left not sent.
  3543. - [Douglas Masterson brought this change]
  3544. session_startup: init state properly
  3545. libssh2_session_startup() didn't set the state correctly so it could get
  3546. confused.
  3547. Fixes #218
  3548. - timeout: added man pages
  3549. - BLOCK_ADJUST_ERRNO: move rc to right level
  3550. We can't declare the variable within the block and use it in the final
  3551. do-while() expression to be properly portable C89.
  3552. - [Matt Lilley brought this change]
  3553. adds a timeout to blocking calls
  3554. Fixes bug #160 as per Daniel's suggestion
  3555. Adds libssh2_session_set_timeout() and libssh2_session_get_timeout()
  3556. - SCP: fix incorrect error code
  3557. After an error occurs in libssh2_scp_recv() or libssh2_scp_send(), the
  3558. function libssh2_session_last_error() would return
  3559. LIBSSH2_ERROR_SOCKET_NONE on error.
  3560. Bug: http://trac.libssh2.org/ticket/216
  3561. Patch by: "littlesavage"
  3562. Fixes #216
  3563. Guenter Knauf (19 Apr 2011)
  3564. - Updated default (recommended) dependency versions.
  3565. Daniel Stenberg (17 Apr 2011)
  3566. - libssh2_session_block_directions: fix mistake
  3567. The last LIBSSH2_SESSION_BLOCK_INBOUND should be
  3568. LIBSSH2_SESSION_BLOCK_OUTBOUND
  3569. And I shortened the short description
  3570. Reported by: "drswinghead"
  3571. - msvcproj: added libs and debug stuff
  3572. Added libraries needed to link whether using openssl dynamically or
  3573. statically
  3574. Added LIBSSH2DEBUG define to debug versions to enable tracing
  3575. URL: http://trac.libssh2.org/ticket/215
  3576. Patch by: Mark Smith
  3577. - sftp_write: clean offsets on error
  3578. When an error has occurred on FXP_WRITE, we must make sure that the
  3579. offset, sent offset and acked counter are reset properly.
  3580. - example/.gitignore: ignore built binaries
  3581. - sftp_write: flush the packetlist on error
  3582. When an error occurs during write, flush the entire list of pending
  3583. outgoing SFTP packets.
  3584. - keepalive: add first basic man pages
  3585. Someone on IRC pointed out that we don't have these documented so I
  3586. wrote up a first set based on the information in the wiki:
  3587. http://trac.libssh2.org/wiki/KeepAlive
  3588. - scp_write_nonblock.c: remove pointless check
  3589. libssh2_channel_write() cannot return a value that is larger than the
  3590. input length value
  3591. Mikhail Gusarov (9 Apr 2011)
  3592. - s/\.NF/.nf/ to fix wrong macro name caught by man --warnings
  3593. Daniel Stenberg (6 Apr 2011)
  3594. - version: bump to 1.2.9_dev
  3595. Also update the copyright year range to include 2011
  3596. - configure: fix $VERSION
  3597. Stop using the $VERSION variable as it seems to be magically used by
  3598. autoconfig itself and thus gets set to the value set in AC_INIT()
  3599. without us wanting that. $LIBSSH2VER is now the libssh2 version as
  3600. detected.
  3601. Reported by: Paul Howarth
  3602. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2011-04/0008.shtml
  3603. - maketgz: use git2news.pl by the correct name
  3604. Version 1.2.8 (4 Apr 2011)
  3605. Daniel Stenberg (4 Apr 2011)
  3606. - RELEASE-NOTES: synced with fabf1a45ee
  3607. - NEWS: auto-generated from git
  3608. Starting now, the NEWS file is generated from git using the git2news.pl
  3609. script. This makes it always accurate and up-to-date, even for daily
  3610. snapshots etc.
  3611. - sftp_write: handle FXP_WRITE errors
  3612. When an sftp server returns an error back on write, make sure the
  3613. function bails out and returns the proper error.
  3614. - configure: stop using the deprecated AM_INIT_AUTOMAKE syntax
  3615. Alexander Lamaison (13 Mar 2011)
  3616. - Support unlimited number of host names in a single line of the known_hosts file.
  3617. Previously the code assumed either a single host name or a hostname,ip-address pair. However, according to the spec [1], there can be any number of comma separated host names or IP addresses.
  3618. [1] http://www.openbsd.org/cgi-bin/man.cgi?query=sshd&sektion=8
  3619. Daniel Stenberg (26 Feb 2011)
  3620. - libssh2_knownhost_readfile.3: clarify return value
  3621. This function returns the number of parsed hosts on success, not just
  3622. zero as previously documented.
  3623. Peter Stuge (26 Feb 2011)
  3624. - Don't save allocated packet size until it has actually been allocated
  3625. The allocated packet size is internal state which needs to match reality
  3626. in order to avoid problems. This commit fixes #211.
  3627. Daniel Stenberg (21 Feb 2011)
  3628. - [Alfred Gebert brought this change]
  3629. session_startup: manage server data before server identification
  3630. Fix the bug that libssh2 could not connect if the sftp server
  3631. sends data before sending the version string.
  3632. http://tools.ietf.org/html/rfc4253#section-4.2
  3633. "The server MAY send other lines of data before sending the version
  3634. string. Each line SHOULD be terminated by a Carriage Return and Line
  3635. Feed. Such lines MUST NOT begin with "SSH-", and SHOULD be encoded
  3636. in ISO-10646 UTF-8 [RFC3629] (language is not specified). Clients
  3637. MUST be able to process such lines."
  3638. - [Alfred Gebert brought this change]
  3639. fullpacket: decompression only after init
  3640. The buffer for the decompression (remote.comp_abstract) is initialised
  3641. in time when it is needed. With this fix decompression is disabled when
  3642. the buffer (remote.comp_abstract) is not initialised.
  3643. Bug: http://trac.libssh2.org/ticket/200
  3644. - _libssh2_channel_read: store last error
  3645. When the transport layer returns EAGAIN this function didn't call
  3646. _libssh2_error() which made the last_error not get set.
  3647. - sftp_write: clarified the comment header
  3648. - sftp_read: avoid wrapping counter to insanity
  3649. As pointed out in bug #206, if a second invoke of libssh2_sftp_read()
  3650. would shrink the buffer size, libssh2 would go nuts and send out read
  3651. requests like crazy. This was due to an unsigned variable turning
  3652. "negative" by some wrong math, and that value would be the amount of
  3653. data attempt to pre-buffer!
  3654. Bug: http://trac.libssh2.org/ticket/206
  3655. - sftp_packet_read: use 32bit variables for 32bit data
  3656. - libssh2_sftp_stat_ex.3: cleaned up, extended
  3657. Removed the macros from it as they have their own man pages.
  3658. Added the LIBSSH2_SFTP_ATTRIBUTES struct in here for easier reference.
  3659. - sftp_readdir: return error if buffer is too small
  3660. If asked to read data into a buffer and the buffer is too small to hold
  3661. the data, this function now returns an error instead of as previously
  3662. just copy as much as fits.
  3663. - sftp_symlink: return error if receive buffer too small
  3664. and clean up some variable type mismatches
  3665. Discussion: http://www.libssh2.org/mail/libssh2-devel-archive-2011-01/0001.shtml
  3666. - docs: clarify what happens with a too small buffer
  3667. This flaw is subject to change, but I figured it might be valuable to
  3668. users of existing code to know how it works.
  3669. - channel_request_pty_size: fix reqPTY_state
  3670. The state variable isn't properly set so every other call to the
  3671. function fails!
  3672. Bug: http://libssh2.org/mail/libssh2-devel-archive-2010-12/0096.shtml
  3673. Reported by: Steve Legg
  3674. - data size: cleanup
  3675. Fix 64bit warnings by using (s)size_t and dedicated uint32_t types more.
  3676. - [Pierre Joye brought this change]
  3677. ssize_t: proper typedef with MSVC compilers
  3678. As discussed on the mailing list, it was wrong for win64 and using the
  3679. VC-provided type is the safest approach instead of second- guessing
  3680. which one it should be.
  3681. Guenter Knauf (22 Dec 2010)
  3682. - Updated OpenSSL version.
  3683. - Expanded tabs to spaces.
  3684. Peter Stuge (21 Dec 2010)
  3685. - [Joey Degges brought this change]
  3686. _libssh2_ntohu64: fix conversion from network bytes to uint64
  3687. Cast individual bytes to uint64 to avoid overflow in arithmetic.
  3688. Daniel Stenberg (20 Dec 2010)
  3689. - libssh2_userauth_list: language fix
  3690. "faily" is not a good English word, and I also cleaned up some other minor
  3691. mistakes
  3692. - crypto: unify the generic functions
  3693. Added crypto.h that is the unified header to include when using crypto
  3694. functionality. It should be the only header that needs to adapt to the
  3695. underlying crypto library in use. It provides the set of prototypes that
  3696. are library agnostic.
  3697. - [Mark Smith brought this change]
  3698. userauth: derive publickey from private
  3699. Pass a NULL pointer for the publickey parameter of
  3700. libssh2_userauth_publickey_fromfile and
  3701. libssh2_userauth_hostbased_fromfile functions. In this case, the
  3702. functions recompute the public key from the private key file data.
  3703. This is work done by Jean-Louis CHARTON
  3704. <[email protected]>, then adapted by Mark Smith and
  3705. slightly edited further by me Daniel.
  3706. WARNING: this does leave the feature NOT WORKING when libssh2 is built
  3707. to use libgcrypt instead of OpenSSL simply due to lack of
  3708. implementation.
  3709. - ssh2_echo: Value stored to 'exitcode' is never read
  3710. - _libssh2_packet_add: fix SSH_MSG_DEBUG weirdness
  3711. I believe I may have caused this weird typo style error when I cleaned
  3712. up this function a while ago. Corrected now.
  3713. - uint32: more longs converted to proper types
  3714. I also moved the MAC struct over to the mac.h header file and made sure
  3715. that the users of that struct include that file.
  3716. - SFTP: more types to uint32_t
  3717. The 'num_names' field in the SSH_FXP_NAME response is an unsigned 32bit
  3718. value so we make sure to treat it like that.
  3719. - SFTP: request_ids are uint32_t
  3720. I went over the code and made sure we use uint32_t all over for the
  3721. request_id data. It is an unsigned 32bit value on the wire.
  3722. - SFTP: store request_id separately in packets
  3723. By using a new separate struct for incoming SFTP packets and not sharing
  3724. the generic packet struct, we can get rid of an unused field and add a
  3725. new one dedicated for holding the request_id for the incoming
  3726. package. As sftp_packet_ask() is called fairly often, a "mere" integer
  3727. comparison is MUCH faster than the previous memcmp() of (typically) 5
  3728. bytes.
  3729. - libssh2_sftp_open_ex: man page extended and cleaned up
  3730. I added the missing documentation for the 'flags' argument.
  3731. - SFTP: unify the READ/WRITE chunk structs
  3732. - SFTP: fix memory leaks
  3733. Make sure that we cleanup remainders when the handle is closed and when
  3734. the subsystem is shutdown.
  3735. Existing flaw: if a single handle sends packets that haven't been
  3736. replied to yet at the time when the handle is closed, those packets will
  3737. arrive later and end up in the generic packet brigade queue and they
  3738. will remain in there until flushed. They will use unnecessary memory,
  3739. make things slower and they will ruin the SFTP handling if the
  3740. request_id counter ever wraps (highly unlikely to every happen).
  3741. - sftp_close_handle: packet list is generic
  3742. Fix comment, simplify the loop logic
  3743. - sftp_read: pipeline reads
  3744. The SFTP read function now does transfers the same way the SFTP write
  3745. function was made to recently: it creates a list of many outgoing
  3746. FXP_READ packets that each asks for a small data chunk. The code then
  3747. tries to keep sending read request while collecting the acks for the
  3748. previous requests and returns the received data.
  3749. - sftp_write: removed unused variable
  3750. - _libssh2_channel_close: don't call transport read if disconnected
  3751. The loop that waits for remote.close to get set may end up looping
  3752. forever since session->socket_state gets set to
  3753. LIBSSH2_SOCKET_DISCONNECTED by the packet_add() function called from the
  3754. transport_read() function and after having been set to
  3755. LIBSSH2_SOCKET_DISCONNECTED, the transport_read() function will only
  3756. return 0.
  3757. Bug: http://trac.libssh2.org/ticket/198
  3758. - libssh2_sftp_seek64: new man page
  3759. Split off libssh2_sftp_seek64 from the libssh2_sftp_seek man page, and
  3760. mentioned that we consider the latter deprecated. Also added a mention
  3761. about the dangers of doing seek during writing or reading.
  3762. - sftp_seek: fix
  3763. The new SFTP write code caused a regression as the seek function no
  3764. longer worked as it didn't set the write position properly.
  3765. It should be noted that seeking is STRONGLY PROHIBITED during upload, as
  3766. the upload magic uses two different offset positions and the multiple
  3767. outstanding packets etc make them sensitive to change in the midst of
  3768. operations.
  3769. This functionality was just verified with the new example code
  3770. sftp_append. This bug was filed as bug #202:
  3771. Bug: http://trac.libssh2.org/ticket/202
  3772. - sftp_append: new example doing SFTP append
  3773. - MAX_SFTP_OUTGOING_SIZE: 30000
  3774. I ran SFTP upload tests against localhost. It showed that to make the
  3775. app reach really good speeds, I needed to do a little code tweak and
  3776. change MAX_SFTP_OUTGOING_SIZE from 4000 to 30000. The tests I did before
  3777. with the high latency tests didn't show any real difference whatever I
  3778. had that size set to.
  3779. This number is the size in bytes that libssh2 cuts off the large input
  3780. buffer and sends off as an individual sftp packet.
  3781. - sftp_write_sliding.c: new example
  3782. This is an example that is very similar to sftp_write_nonblock.c, with
  3783. the exception that this uses
  3784. 1 - a larger upload buffer
  3785. 2 - a sliding buffer mechnism to allow the app to keep sending lots of
  3786. data to libssh2 without having to first drain the buffer.
  3787. These are two key issues to make libssh2 SFTP uploads really perform
  3788. well at this point in time.
  3789. - cpp: s/#elsif/#elif
  3790. This looks like a typo as #elsif is not really C...
  3791. - _libssh2_channel_write: revert channel_write() use
  3792. The attempts made to have _libssh2_channel_write() accept larger pieces
  3793. of data and split up the data by itself into 32700 byte chunks and pass
  3794. them on to channel_write() in a loop as a way to do faster operations on
  3795. larger data blocks was a failed attempt.
  3796. The reason why it is difficult:
  3797. The API only allows EAGAIN or a length to be returned. When looping over
  3798. multiple blocks to get sent, one block can get sent and the next might
  3799. not. And yet: when transport_send() has returned EAGAIN we must not call
  3800. it again with new data until it has returned OK on the existing data it
  3801. is still working on. This makes it a mess and we do get a much easier
  3802. job by simply returning the bytes or EAGAIN at once, as in the EAGAIN
  3803. case we can assume that we will be called with the same arguments again
  3804. and transport_send() will be happy.
  3805. Unfortunately, I think we take a small performance hit by not being able
  3806. to do this.
  3807. - ssh2_echo: new example
  3808. This is a new example snippet. The code is largely based on ssh2_exec,
  3809. and is written by Tommy Lindgren. I edited it into C90 compliance and to
  3810. conform to libssh2 indent style and some more.
  3811. - send_existing: return after send_existing
  3812. When a piece of data is sent from the send_existing() function we must
  3813. make the parent function return afterwards. Otherwise we risk that the
  3814. parent function tries to send more data and ends up getting an EGAIN for
  3815. that more data and since it can only return one return code it doesn't
  3816. return info for the successfully sent data.
  3817. As this change is a regression I now added a larger comment explaining
  3818. why it has to work like this.
  3819. - _libssh2_channel_write: count resent data as written
  3820. In the logic that resends data that was kept for that purpose due to a
  3821. previous EAGAIN, the data was not counted as sent causing badness.
  3822. Peter Stuge (13 Nov 2010)
  3823. - Use fprintf(stderr, ) instead of write(2, ) for debugging
  3824. - session/transport: Correctly handle when _libssh2_send() returns -EAGAIN
  3825. - src/agent.c: Simplify _libssh2_send() error checking ever so slightly
  3826. Daniel Stenberg (12 Nov 2010)
  3827. - send/recv: use _libssh2_recv and _libssh2_send now
  3828. Starting now, we unconditionally use the internal replacement functions
  3829. for send() and recv() - creatively named _libssh2_recv() and
  3830. _libssh2_send().
  3831. On errors, these functions return the negative 'errno' value instead of
  3832. the traditional -1. This design allows systems that have no "natural"
  3833. errno support to not have to invent it. It also means that no code
  3834. outside of these two transfer functions should use the errno variable.
  3835. - channel_write: move some logic to _libssh2_channel_write
  3836. Some checks are better done in _libssh2_channel_write just once per
  3837. write instead of in channel_write() since the looping will call the
  3838. latter function multiple times per _libssh2_channel_write() invoke.
  3839. - sftp_write: handle "left over" acked data
  3840. The SFTP handle struct now buffers number of acked bytes that haven't
  3841. yet been returned. The way this is used is as following:
  3842. 1. sftp_write() gets called with a buffer of let say size 32000. We
  3843. split 32000 into 8 smaller packets and send them off one by one. One of
  3844. them gets acked before the function returns so 4000 is returned.
  3845. 2. sftp_write() gets called again a short while after the previous one,
  3846. now with a much smaller size passed in to the function. Lets say 8000.
  3847. In the mean-time, all of the remaining packets from the previous call
  3848. have been acked (7*4000 = 28000). This function then returns 8000 as all
  3849. data passed in are already sent and it can't return any more than what
  3850. it got passed in. But we have 28000 bytes acked. We now store the
  3851. remaining 20000 in the handle->u.file.acked struct field to add up in
  3852. the next call.
  3853. 3. sftp_write() gets called again, and now there's a backlogged 20000
  3854. bytes to return as fine and that will get skipped from the beginning
  3855. of the buffer that is passed in.
  3856. - sftp_write: polished and simplified
  3857. Removed unnecessary struct fields and state changes within the function.
  3858. Made the loop that checks for ACKs only check chunks that were fully
  3859. sent.
  3860. - SCP: on failure, show the numerical error reason
  3861. By calling libssh2_session_last_errno()
  3862. - SFTP: provide the numerical error reason on failure
  3863. - SCP: clean up failure treatment
  3864. When SCP send or recv fails, it gets a special message from the server
  3865. with a warning or error message included. We have no current API to
  3866. expose that message but the foundation is there. Removed unnecessary use
  3867. of session struct fields.
  3868. - sftp_write: enlarge buffer to perform better
  3869. - packets: code cleanup
  3870. I added size checks in several places. I fixed the code flow to be easier
  3871. to read in some places.
  3872. I removed unnecessary zeroing of structs. I removed unused struct fields.
  3873. - LIBSSH2_CALLBACK_MACERROR: clarify return code use
  3874. - _libssh2_userauth_publickey: avoid shadowing
  3875. - packet: avoid shadowing global symbols
  3876. - sftp_readdir: avoid shadowing
  3877. - shadowing: don't shadow the global compress
  3878. - _libssh2_packet_add: turn ifs into a single switch
  3879. - _libssh2_packet_add: check SSH_MSG_GLOBAL_REQUEST packet
  3880. - _libssh2_packet_add: SSH_MSG_DEBUG length checks
  3881. Verify lengths before using them. Read always_display from the correct
  3882. index. Don't copy stuff around just to provide zero-termination of the
  3883. strings.
  3884. - _libssh2_packet_add: SSH_MSG_IGNORE skip memmove
  3885. There's no promise of a zero termination of the data in the callback so
  3886. no longer perform ugly operation in order to provide it.
  3887. - _libssh2_packet_add: SSH_MSG_DISCONNECT length checks
  3888. Verify lengths before trying to read data.
  3889. - indent: break lines at 80 columns
  3890. - SSH_MSG_CHANNEL_OPEN_FAILURE: used defined values
  3891. We don't like magic numbers in the code. Now the acceptable failure
  3892. codes sent in the SSH_MSG_CHANNEL_OPEN_FAILURE message are added as
  3893. defined values in the private header file.
  3894. - sftp_write: don't return EAGAIN if no EAGAIN was received
  3895. This function now only returns EAGAIN if a lower layer actually returned
  3896. EAGAIN to it. If nothing was acked and no EAGAIN was received, it will
  3897. now instead return 0.
  3898. - _libssh2_wait_socket: detect nothing-to-wait-for
  3899. If _libssh2_wait_socket() gets called but there's no direction set to
  3900. wait for, this causes a "hang". This code now detects this situation,
  3901. set a 1 second timeout instead and outputs a debug output about it.
  3902. - decomp: remove the free_dest argument
  3903. Since the decompress function ALWAYS returns allocated memory we get a
  3904. lot simpler code by removing the ability to return data unallocated.
  3905. - decomp: cleaned off old compression stuff
  3906. I cleared off legacy code from when the compression and decompression
  3907. functions were a single unified function. Makes the code easier to read
  3908. too.
  3909. - [TJ Saunders brought this change]
  3910. decomp: increase decompression buffer sizes
  3911. - [TJ Saunders brought this change]
  3912. zlib: Add debug tracing of zlib errors
  3913. - sftp_packet_read: handle partial reads of the length field
  3914. SFTP packets come as [32 bit length][payload] and the code didn't
  3915. previously handle that the initial 32 bit field was read only partially
  3916. when it was read.
  3917. - [Jasmeet Bagga brought this change]
  3918. kex_agree_hostkey: fix NULL pointer derefence
  3919. While setting up the session, ssh tries to determine the type of
  3920. encryption method it can use for the session. This requires looking at
  3921. the keys offered by the remote host and comparing these with the methods
  3922. supported by libssh2 (rsa & dss). To do this there is an iteration over
  3923. the array containing the methods supported by libssh2.
  3924. If there is no agreement on the type of encryption we come to the 3rd
  3925. entry of the hostkeyp array. Here hostkeyp is valid but *hostkep is
  3926. NULL. Thus when we dereference that in (*hostkeyp)->name there is a
  3927. crash
  3928. - _libssh2_transport_send: remove dead assignment
  3929. 'data' isn't accessed beyond this point so there's no need to assign it.
  3930. - scp_recv: remove dead assignment
  3931. Instead of assigning a variable we won't read, we now use the more
  3932. explicit (void) prefix.
  3933. - sftp_write: removed superfluous assignment
  3934. - bugfix: avoid use of uninitialized value
  3935. - sftp_packet_require: propagate error codes better
  3936. There were some chances that they would cause -1 to get returned by
  3937. public functions and as we're hunting down all such occurances and since
  3938. the underlying functions do return valuable information the code now
  3939. passes back proper return codes better.
  3940. - [Alfred Gebert brought this change]
  3941. fix memory leaks (two times cipher_data) for each sftp session
  3942. - libssh2_userauth_authenticated: make it work as documented
  3943. The man page clearly says it returns 1 for "already authenticated" but
  3944. the code said non-zero. I changed the code to use 1 now, as that is also
  3945. non-zero but it gets the benefit that it now matches the documentation.
  3946. Using 1 instead of non-zero is better for two reasons:
  3947. 1. We have the opportunity to introduce other return codes in the future for
  3948. things like error and what not.
  3949. 2. We don't expose the internal bitmask variable value.
  3950. - userauth_keyboard_interactive: fix indent
  3951. - [Alfred Gebert brought this change]
  3952. fix memory leak in userauth_keyboard_interactive()
  3953. First I wanted to free the memory in session_free() but then
  3954. I had still memory leaks because in my test case the function
  3955. userauth_keyboard_interactive() is called twice. It is called
  3956. twice perhaps because the server has this authentication
  3957. methods available: publickey,gssapi-with-mic,keyboard-interactive
  3958. The keyboard-interactive method is successful.
  3959. - dist: include sftp.h in dist archives
  3960. Simon Josefsson (27 Oct 2010)
  3961. - Update header to match new function prototype, see c48840ba88.
  3962. Daniel Stenberg (26 Oct 2010)
  3963. - bugfixes: the transport rearrange left some subtle flaws now gone
  3964. - libssh2_userauth_publickey_fromfile_ex.3: cleaned up looks
  3965. - libssh2_userauth_publickey: add man page
  3966. I found an undocumented public function and we can't have it like
  3967. that. The description here is incomplete, but should serve as a template
  3968. to allow filling in...
  3969. - libssh2_sftp_write.3: added blurb about the "write ahead"
  3970. Documented the new SFTP write concept
  3971. - sftp_close_handle: free any trailing write chunks
  3972. - _libssh2_channel_write: fix warnings
  3973. - SFTP: bufgix, move more sftp stuff to sftp.h
  3974. The sftp_write function shouldn't assume that the buffer pointer will be
  3975. the same in subsequent calls, even if it assumes that the data already
  3976. passed in before haven't changed.
  3977. The sftp structs are now moved to sftp.h (which I forgot to add before)
  3978. - SFTP: use multiple outgoing packets when writing
  3979. sftp_write was rewritten to split up outgoing data into multiple packets
  3980. and deal with the acks in a more asynchronous manner. This is meant to
  3981. help overcome latency and round-trip problems with the SFTP protocol.
  3982. - TODO: implemented a lot of the ideas now
  3983. - _libssh2_channel_write: removed 32500 size limit
  3984. Neither _libssh2_channel_write nor sftp_write now have the 32500 size
  3985. limit anymore and instead the channel writing function now has its own
  3986. logic to send data in multiple calls until everything is sent.
  3987. - send_existing: don't tell parent to return when drained
  3988. That will just cause unnecessary code execution.
  3989. - _libssh2_channel_write: general code cleanup
  3990. simplified the function and removed some unused struct fields
  3991. - _libssh2_transport_send: replaces _libssh2_transport_write
  3992. The new function takes two data areas, combines them and sends them as a
  3993. single SSH packet. This allows several functions to allocate and copy
  3994. less data.
  3995. I also found and fixed a mixed up use of the compression function
  3996. arguments that I introduced in my rewrite in a recent commit.
  3997. - scp_write_nonblock: use select() instead of busyloop
  3998. Make this example nicer by not busylooping.
  3999. - send_existing: clear olen when the data is sent off
  4000. - _libssh2_transport_write: allow 256 extra bytes around the packet
  4001. - _libssh2_transport_write: remade to send without malloc
  4002. - compress: compression disabled by default
  4003. We now allow libssh2_session_flag() to enable compression with a new
  4004. flag and I added documentation for the previous LIBSSH2_FLAG_SIGPIPE
  4005. flag which I wasn't really aware of!
  4006. - comp: split the compress function
  4007. It is now made into two separate compress and decompress functions. In
  4008. preparation for upcoming further modficications.
  4009. Dan Fandrich (20 Oct 2010)
  4010. - Added header file to allow compiling in older environments
  4011. Daniel Stenberg (20 Oct 2010)
  4012. - TODO: add a possible new API for SFTP transfers
  4013. - TODO: "New Transport API" added
  4014. - TODO: add buffering plans
  4015. Simon Josefsson (13 Oct 2010)
  4016. - Mention libssh2_channel_get_exit_signal and give kudos.
  4017. - [Tommy Lindgren brought this change]
  4018. Add libssh2_channel_get_exit_signal man page.
  4019. Signed-off-by: Simon Josefsson <[email protected]>
  4020. - [Tommy Lindgren brought this change]
  4021. Add libssh2_channel_get_exit_signal.
  4022. Signed-off-by: Simon Josefsson <[email protected]>
  4023. - Add libssh2_free man page and fix typo.
  4024. - Add libssh2_free.
  4025. Daniel Stenberg (11 Oct 2010)
  4026. - scp_recv: improved treatment of channel_read() returning zero
  4027. As a zero return code from channel_read() is not an error we must make
  4028. sure that the SCP functions deal with that properly. channel_read()
  4029. always returns 0 if the channel is EOFed already so we check for EOF
  4030. after 0-reads to be able to return error properly.
  4031. - libssh2_session_methods.3: detail what can be asked for
  4032. - compression: send zlib before none
  4033. As the list of algorithms in a preferred order we should send zlib
  4034. before none to increase the chances that the server will let us do
  4035. compression.
  4036. - compress: faster check, better return codes
  4037. In the transport functions we avoid a strcmp() now and just check a
  4038. boolean instead.
  4039. The compress/decompress function's return code is now acknowledged and
  4040. used as actual return code in case of failures.
  4041. - libssh2_session_handshake: replaces libssh2_session_startup()
  4042. The function libssh2_session_startup() is now considered deprecated due
  4043. to the portability issue with the socket argument.
  4044. libssh2_session_handshake() is the name of the replacement.
  4045. - libssh2_socket_t: now externally visible
  4046. In preparation for upcominig changes, the libssh2_socket_t type is now
  4047. typedef'ed in the public header.
  4048. - _libssh2_transport_drain: removed
  4049. This function proved not to be used nor useful.
  4050. - _libssh2_channel_write: don't iterate over transport writes
  4051. When a call to _libssh2_transport_write() succeeds, we must return from
  4052. _libssh2_channel_write() to allow the caller to provide the next chunk
  4053. of data.
  4054. We cannot move on to send the next piece of data that may already have
  4055. been provided in this same function call, as we risk getting EAGAIN for
  4056. that and we can't return information both about sent data as well as
  4057. EAGAIN. So, by returning short now, the caller will call this function
  4058. again with new data to send.
  4059. - _libssh2_transport_write: updated documentation blurb
  4060. - _libssh2_transport_write: remove fprintf remainder
  4061. Mistake from previous debugging
  4062. - session: improved errors
  4063. Replaced -1/SOCKET_NONE errors with appropriate error defines instead.
  4064. Made the verbose trace output during banner receiving less annoying for
  4065. non-blocking sessions.
  4066. - crypt_init: use correct error define
  4067. - _libssh2_error: hide EAGAIN for non-blocking sessions
  4068. In an attempt to make the trace output less cluttered for non-blocking
  4069. sessions the error function now avoids calling the debug function if the
  4070. error is the EAGAIN and the session is non-blocking.
  4071. - agent: use better error defines
  4072. - comp_method_zlib_init: use correct error defines
  4073. - transport: better error codes
  4074. LIBSSH2_SOCKET_NONE (-1) should no longer be used as error code as it is
  4075. (too) generic and we should instead use specific and dedicated error
  4076. codes to better describe the error.
  4077. - channel: return code and _libssh2_error cleanup
  4078. Made sure that all transport_write() call failures get _libssh2_error
  4079. called.
  4080. - _libssh2_channel_write: limit to 32700 bytes
  4081. The well known and used ssh server Dropbear has a maximum SSH packet
  4082. length at 32768 by default. Since the libssh2 design current have a
  4083. fixed one-to-one mapping from channel_write() to the packet size created
  4084. by transport_write() the previous limit of 32768 in the channel layer
  4085. caused the transport layer to create larger packets than 32768 at times
  4086. which Dropbear rejected forcibly (by closing the connection).
  4087. The long term fix is of course to remove the hard relation between the
  4088. outgoing SSH packet size and what the input length argument is in the
  4089. transport_write() function call.
  4090. - libssh.h: add more dedicated error codes
  4091. - SCP: allow file names with bytes > 126
  4092. When parsing the SCP protocol and verifying that the data looks like a
  4093. valid file name, byte values over 126 must not be consider illegal since
  4094. UTF-8 file names will use such codes.
  4095. Reported by: Uli Zappe
  4096. Bug: http://www.libssh2.org/mail/libssh2-devel-archive-2010-08/0112.shtml
  4097. Dan Fandrich (25 Aug 2010)
  4098. - Document the three sftp stat constants
  4099. Guenter Knauf (18 Aug 2010)
  4100. - Fixed Win32 makefile which was now broken at resource build.
  4101. - It is sufficient to pipe stderr to NUL to get rid of the nasty messages.
  4102. - [Author: Guenter Knauf brought this change]
  4103. Removed Win32 ifdef completely for sys/uio.h.
  4104. No idea why we had this ifdef at all but MSVC, MingW32, Watcom
  4105. and Borland all have no sys/uio.h header; so if there's another
  4106. Win32 compiler which needs it then it should be added explicitely
  4107. instead of this negative list.
  4108. - New files should also be added to Makefile.am.
  4109. Otherwise they will never be included with release and snapshot tarballs ...
  4110. Daniel Stenberg (18 Aug 2010)
  4111. - version: bump to 1.2.8_DEV
  4112. Version 1.2.7 (17 Aug 2010)
  4113. Daniel Stenberg (17 Aug 2010)
  4114. - release: updated to hold 1.2.7 info
  4115. Guenter Knauf (17 Aug 2010)
  4116. - Use the new libssh2.rc file.
  4117. - Added resource file for libssh2.dll (shamelessly stolen from libcurl).
  4118. - Updated Win32 MSVC dependencies versions.
  4119. - Added include for sys/select.h to get fd.set on some platforms.
  4120. - Added Watcom makefile borrowed from libcurl.
  4121. This makefile compiles already all files fine for static lib, but needs
  4122. final touch when I have OpenSSL fully working with shared libs and Watcom.
  4123. - Added copyright define to libssh2.h and use it for binary builds.
  4124. - Moved version defines up in order to include from .rc file.
  4125. Blocked rest of header with ifndef so its possible to let
  4126. the rc compiler only use the version defines.
  4127. - Some minor makefile tweaks.
  4128. Daniel Stenberg (2 Aug 2010)
  4129. - example: treat the libssh2_channel_read() return code properly
  4130. A short read is not an error. Only negative values are errors!
  4131. - libssh2_wait_socket: reset error code to "leak" EAGAIN less
  4132. Since libssh2 often sets LIBSSH2_ERROR_EAGAIN internally before
  4133. _libssh2_wait_socket is called, we can decrease some amount of
  4134. confusion in user programs by resetting the error code in this function
  4135. to reduce the risk of EAGAIN being stored as error when a blocking
  4136. function returns.
  4137. - _libssh2_wait_socket: poll needs milliseconds
  4138. As reported on the mailing list, the code path using poll() should
  4139. multiple seconds with 1000 to get milliseconds, not divide!
  4140. Reported by: Jan Van Boghout
  4141. - typedef: make ssize_t get typedef without LIBSSH2_WIN32
  4142. The condition around the ssize_t typedef depended on both LIBSSH2_WIN32
  4143. *and* _MSC_VER being defined when it should be enough to depend on
  4144. _MSC_VER only. It also makes it nicer so libssh2-using code builds fine
  4145. without having custom defines.
  4146. - [John Little brought this change]
  4147. session_free: free more data to avoid memory leaks
  4148. - channel_free: ignore problems with channel_close()
  4149. As was pointed out in bug #182, we must not return failure from
  4150. _libssh2_channel_free() when _libssh2_channel_close() returns an error
  4151. that isn't EAGAIN. It can effectively cause the function to never go
  4152. through, like it did now in the case where the socket was actually
  4153. closed but socket_state still said LIBSSH2_SOCKET_CONNECTED.
  4154. I consider this fix the right thing as it now also survives other
  4155. errors, even if making sure socket_state isn't lying is also a good
  4156. idea.
  4157. - publickey_list_free: no return value from a void function
  4158. Fixed a compiler warning I introduced previously when checking input
  4159. arguments more. I also added a check for the other pointer to avoid NULL
  4160. pointer dereferences.
  4161. - [Lars Nordin brought this change]
  4162. openssl: make use of the EVP interface
  4163. Make use of the EVP interface for the AES-funktion. Using this method
  4164. supports the use of different ENGINES in OpenSSL for the AES function
  4165. (and the direct call to the AES_encrypt should not be used according to
  4166. openssl.org)
  4167. Peter Stuge (23 Jun 2010)
  4168. - [Tor Arntsen brought this change]
  4169. Don't overflow MD5 server hostkey
  4170. Use SHA_DIGEST_LENGTH and MD5_DIGEST_LENGTH in memcpy instead of hardcoded
  4171. values. An incorrect value was used for MD5.
  4172. - Fix message length bugs in libssh2_debug()
  4173. There was a buffer overflow waiting to happen when a debug message was
  4174. longer than 1536 bytes.
  4175. Thanks to Daniel who spotted that there was a problem with the message
  4176. length passed to a trace handler also after commit
  4177. 0f0652a3093111fc7dac0205fdcf8d02bf16e89f.
  4178. - Make libssh2_debug() create a correctly terminated string
  4179. Also use FILE *stderr rather than fd 2, which can very well be something
  4180. completely different.
  4181. Daniel Stenberg (23 Jun 2010)
  4182. - [TJ Saunders brought this change]
  4183. handshake: Compression enabled at the wrong time
  4184. In KEXINIT messages, the client and server agree on, among other
  4185. things, whether to use compression. This method agreement occurs
  4186. in src/kex.c's kex_agree_methods() function. However, if
  4187. compression is enabled (either client->server, server->client, or
  4188. both), then the compression layer is initialized in
  4189. kex_agree_methods() -- before NEWKEYS has been received.
  4190. Instead, the initialization of the compression layer should
  4191. happen after NEWKEYS has been received. This looks to occur
  4192. insrc/kex.c's diffie_hellman_sha1(), which even has the comment:
  4193. /* The first key exchange has been performed,
  4194. switch to active crypt/comp/mac mode */
  4195. There, after NEWKEYS is received, the cipher and mac algorithms
  4196. are initialized, and that is where the compression should be
  4197. initialized as well.
  4198. The current implementation fails if server->client compression is
  4199. enabled because most server implementations follow OpenSSH's
  4200. lead, where compression is initialized after NEWKEYS. Since the
  4201. server initializes compression after NEWKEYS, but libssh2
  4202. initializes compression after KEXINIT (i.e. before NEWKEYS), they
  4203. are out of sync.
  4204. Reported in bug report #180
  4205. - [TJ Saunders brought this change]
  4206. userauth_hostbased_fromfile: packet length too short
  4207. The packet length calculated in src/userauth.c's
  4208. userauth_hostbased_fromfile() function is too short by 4 bytes;
  4209. it forgets to add four bytes for the length of the hostname.
  4210. This causes hostbased authentication to fail, since the server
  4211. will read junk data.
  4212. verified against proftpd's mod_sftp module
  4213. - _libssh2_userauth_publickey: reject method names longer than the data
  4214. This functions get the method length by looking at the first 32
  4215. bit of data, and I now made it not accept method lengths that are
  4216. longer than the whole data set is, as given in the dedicated
  4217. function argument.
  4218. This was detected when the function was given bogus public key
  4219. data as an ascii string, which caused the first 32bits to create
  4220. a HUGE number.
  4221. - NULL resistance: make more public functions survive NULL pointer input
  4222. Sending in NULL as the primary pointer is now dealt with by more
  4223. public functions. I also narrowed the userauth.c code somewhat to
  4224. stay within 80 columns better.
  4225. - agent: make libssh2_agent_userauth() work blocking properly
  4226. previously it would always work in a non-blocking manner
  4227. Peter Stuge (17 Jun 2010)
  4228. - Fix underscore typo for 64-bit printf format specifiers on Windows
  4229. Commit 49ddf447ff4bd80285f926eac0115f4e595f9425 was missing underscores.
  4230. Daniel Stenberg (16 Jun 2010)
  4231. - libssh2_session_callback_set: extended the man page