giampaolo / pyftpdlib

Extremely fast and scalable Python FTP server library
MIT License
1.65k stars 267 forks source link

B315 - Fix for sending encrypted response to buffered unencrypted cmd #523

Open danifus opened 4 years ago

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at ?% when pulling f1a3b6eac7d4986f8b07b0c33d873a3a41f23a11 on danifus:b315 into 1122c7df99fe294be29b6093bcf538843d8e2653 on giampaolo:master.

giampaolo commented 4 years ago

Please explain =)

danifus commented 4 years ago

I was having a look through the issues and found #315 which was a bit old and you had asked for a python test demonstrating the issue and thought I would have a go.

The summary is:

https://github.com/giampaolo/pyftpdlib/pull/523/commits/8b2d2ec476a767bf2ca0d5ab242320c8973b77fc#diff-3f8de7cee164531b3e8fa45af77f4626R355-R385 sets this up and tests that nothing is returned after the AUTH response (provided that is the way you want to go, as opposed to raising an error).

danifus commented 4 years ago

The fix just clears out asynchat inbound buffer in ftp_AUTH if a secure connection is being established. Not sure that is the proper fix and happy for you to choose a different approach