Process curve name when loading EC keys. Fixes #1336

Not super happy with `CURVE_TYPES` so if anyone has a better suggestion speak up.
Yes I agree, I suppose this is purely an optimization, we can do it later
if (god help us) this is a bottle neck for someone.

On Fri, Sep 26, 2014 at 6:36 PM, Paul Kehrer <notifications@github.com>
wrote:

> In cryptography/hazmat/backends/openssl/backend.py:
>
> >              ec_cdata = self._lib.EVP_PKEY_get1_EC_KEY(evp_pkey)
> >              assert ec_cdata != self._ffi.NULL
> >              ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free)
> > -            return _EllipticCurvePublicKey(self, ec_cdata, None)
> > +            sn = self._ec_key_curve_sn(ec_cdata)
> > +            curve = self._sn_to_elliptic_curve(sn)
> > +            return _EllipticCurvePublicKey(self, ec_cdata, curve)
>
> I don't have a strong preference either way. When generating we know the
> curve immediately so that's why we do it this way right now. If we switch
> to lazy for consistency I'd say we should change the
> _EllipticCurvePublicKey and _EllipticCurvePrivateKey constructors to not
> take curve.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pyca/cryptography/pull/1346/files#r18117695>.
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084