Encrypt in-place -- avoid unnecessary memcpy

Summary:
Rediffing after this revert: D1745940. Turns out we can't actually encrypt in-place because service-router assumes the buffer won't be modified (to support retries). This is a little unfortunate, since it "looks" like the wrap function has ownership of the underlying data.

This is about 7% perf boost seen on loadgen with 100kb requests. Without the additional copy, it would be another 7%.

Test Plan: loadgen, unittests

Reviewed By: alandau@fb.com

Subscribers: wstefancik, acampi, mhorowitz, mshneer, bmatheny, alandau, trunkagent, hannesr

FB internal diff: D1749195

Signature: t1:1749195:1418941597:feba9a1266dbd5786cd577985bc3e8c84b2ceaa4
Don't fatal when using old krb5 versions

Summary: If a service is built against an old platform, this codepath can actually be hit if it gets a valid secure thrift request. Instead of a fatal, the right thing to do is to just fail the handshake.

Test Plan: Built ThriftServer on old platform. Sent a secure thrift request to it.

Reviewed By: shamdor@fb.com

Subscribers: alandau, bmatheny, mshneer, wstefancik

FB internal diff: D1750405

Signature: t1:1750405:1418959356:b0f629510a58285b21beb13e323a20595def7742
Move TAsyncTransport to folly as AsyncTransportWrapper

Summary:
This temporary class will be useful to cut dependencies on thrift
while (roughly) maintaining the old interface.

Fixup various test classes that depend on the interface.  Next diff will be to cut fbthrift dep in proxygen/mcrouter

Test Plan: unit tests, jenkins

Reviewed By: hans@fb.com

Subscribers: fbcode-common-diffs@, andrewcox, alandau, bmatheny, alikhtarov, mshneer, trunkagent, doug, njormrod, folly-diffs@, davejwatson

FB internal diff: D1696094

Signature: t1:1696094:1418762312:6028815cce2845ac5f8e754132a038fabf5fd957
Move getFirstPrincipalInKeytab to utils

Summary: Move getFirstPrincipalInKeytab to utils

Test Plan: 1. built

Reviewed By: acampi@fb.com

Subscribers: alandau, bmatheny, mshneer

FB internal diff: D1750462

Tasks: 5391557

Signature: t1:1750462:1419018017:ca78c411d6b5a4412ab50117f3565059530e8b3c
Fix thrift2 unittests

Summary:
the IO threads init was moved after the preServe event in D1585087.  Most of the thrift unitests use ScopedServerThread - that waits for thrift server startup, but continues running when preServe is called.
After D1585087, under load, the IO threads may not have started for some of the unittests, resulting in various failures

Test Plan:
This seemed to show up most in dbg builds

fbconfig -r thrift/lib/cpp2:ThriftServerTest
fbmake dbg

sudo yum install stress
stress -c 32
_bin/thrift/lib/cpp2/ThriftServerTest

Reviewed By: alandau@fb.com

Subscribers: doug, alandau, bmatheny, mshneer, fugalh

FB internal diff: D1751826

Signature: t1:1751826:1419024407:1a6a68c1c289c6acc93f760a2e48532fbd4e8177
Specify temp cc type in ccmanager

Summary:
MakeResolve faild if cc path contains ':' as part before ':'
was considered a type

Test Plan: built

Reviewed By: mhorowitz@fb.com

Subscribers: alandau, bmatheny, mshneer

FB internal diff: D1752691

Tasks: 5868938

Signature: t1:1752691:1419038344:16896c1e7ea78fc51753af2c778b806224ed84a7
Move MockTimeoutManager from thrift to proxygen

Summary:
Only proxygen is using it, but maybe folly would be better?

Facebook:
^

Test Plan: Unit tests

Reviewed By: davejwatson@fb.com

Subscribers: noamler, doug, alandau, bmatheny, mshneer

FB internal diff: D1746748

Tasks: 5816910

Signature: t1:1746748:1419027440:090c7820433ba72a21e081be8af09a1b8814aee6
merge 57

Summary: Deps for centos: https://github.com/facebook/fbthrift/pull/57/files

Test Plan: ?? I'll trust it works

Reviewed By: haijunz@fb.com

Subscribers: doug, alandau, mshneer

FB internal diff: D1756202

Tasks: 5831166

Signature: t1:1756202:1419362942:e276b153d56f02453cc020379e8f62a10419da53
Revert "[SecureThrift] Eliminate buffer allocation during decrypt"

Summary:
Description:
It wasn't compatible with GCM mode for some reason. Thankfully we're not deployed in GCM yet other than crypto / keychain.

This reverts commit 716b8a94d812df662b0aa007153e27a0ad9fb3b9.

Test Plan: Started up crypto service locally, made sure kerberos succeeded when GCM is enabled.

Reviewed By: acampi@fb.com

Subscribers: alandau, bmatheny, mshneer, shamdor, sandeepkk, wstefancik

FB internal diff: D1756712

Signature: t1:1756712:1419373891:f4423ac4888521e44f767cdd26c24421a31ac2c4
Fix TCppServer test

Summary:
Server is using IPv6 local address and the client is connecting
to 127.0.0.1 and always get connection refused

Test Plan:
fbconfig thrift/test/py:cpp_server_test && fbmake runtests.
Also works in python 3

Reviewed By: mhorowitz@fb.com

Subscribers: ruibalp, alandau, mshneer

FB internal diff: D1756761

Tasks: 5411333

Signature: t1:1756761:1419374959:9591888908452b5af129b61e77f90f9b3f914b17
typeof -> decltype

Summary:
Fix GNUism
Originally at https://github.com/facebook/fbthrift/pull/65

Test Plan: fbmake

Reviewed By: davejwatson@fb.com

Subscribers: alandau, bmatheny, mshneer

FB internal diff: D1757982

Signature: t1:1757982:1419624330:44ce04fa20831787a62ba463d6c656e98b3fbb5a
Kill fbthrift dep

Summary:
(almost) all the necessary code has been moved to folly.  A couple last functions in SSLUtils, moved them to SSLContext

I think this is enough so that open source mcrouter doesn't need an fbthrift dep anymore - although stuff in mcrouter/facebook still uses thrift.

Test Plan:
fbconfig -r mcrouter; fbmake runtests_dev

contbuild will probably show some other projects to fix up for SSLUtils

Reviewed By: alikhtarov@fb.com

Subscribers: doug, ps, alandau, bmatheny, alikhtarov, mshneer, folly-diffs@

FB internal diff: D1747133

Signature: t1:1747133:1418946064:1c30a60e43f017213e5514d462f267f91761abbe
Bump version to 17:0