Refactor the implementation to avoid duplication; use the result of the API to determine the proper buffer size to use.
Refactor the implementation to avoid duplication; use the result of the API to determine the proper buffer size to use.

kjav/pyopenssl,samv/pyopenssl,aalba6675/pyopenssl,JensTimmerman/pyopenssl,mitghi/pyopenssl,mhils/pyopenssl,aalba6675/pyopenssl,sorenh/pyopenssl,pyca/pyopenssl,mhils/pyopenssl,reaperhulk/pyopenssl,mschmo/pyopenssl,mitghi/pyopenssl,daodaoliang/pyopenssl,Lukasa/pyopenssl,hynek/pyopenssl,Lukasa/pyopenssl,r0ro/pyopenssl,kediacorporation/pyopenssl,adamwolf/pyopenssl,kediacorporation/pyopenssl,JensTimmerman/pyopenssl,rackerlabs/pyopenssl,elitest/pyopenssl,reaperhulk/pyopenssl,r0ro/pyopenssl,rackerlabs/pyopenssl,sholsapp/pyopenssl,hynek/pyopenssl