[tor-commits] [tor/release-0.4.2] Extract key length check into a new function, and check more fields.