[PATCH] Support building with BoringSSL.

Jouni Malinen j
Tue Oct 7 01:42:14 PDT 2014


On Mon, Oct 06, 2014 at 03:44:48PM -0700, Adam Langley wrote:
> On Mon, Oct 6, 2014 at 3:35 PM, Jouni Malinen <j at w1.fi> wrote:
> > -       for (i = 0; ext && i < sk_GENERAL_NAME_num(ext); i++) {
> > +       for (i = 0; ext && i < (int) sk_GENERAL_NAME_num(ext); i++) {

> However, casting to an int is something that you would need to do if
> sk_GENERAL_NAME_num was returning a size_t, which it does in
> BoringSSL, but you're not building with BoringSSL.

I was.. I tested the build against OpenSSL 0.9.8, 1.0.1, 1.0.2-beta, and
the current snapshot of BoringSSL.

> But, rather than cast, the "int i" in this function can be changed to
> a stack_index_t.

Ah, yes, that could be reasonable. I gave up on trying to figure out the
details when I hit the sk_GENERAL_NAME_num macro in OpenSSL.. Example
users of that in OpenSSL use int while BoringSSL seems to be using
size_t.

> > +#ifdef OPENSSL_IS_BORINGSSL
> > +static int tls_sess_sec_cb(SSL *s, void *secret, int *secret_len,
> > +                          STACK_OF(SSL_CIPHER) *peer_ciphers,
> > +                          const SSL_CIPHER **cipher, void *arg)
> > +#else /* OPENSSL_IS_BORINGSSL */
> >  static int tls_sess_sec_cb(SSL *s, void *secret, int *secret_len,
> >                            STACK_OF(SSL_CIPHER) *peer_ciphers,
> >                            SSL_CIPHER **cipher, void *arg)
> > +#endif /* OPENSSL_IS_BORINGSSL */

> This also seems correct, but only needed for BoringSSL. But I can't
> imagine that you got it building with BoringSSL.

The version I pushed to hostap.git did indeed build successfully with
the current snapshot of BoringSSL.

> (Again, I think Android is omitting this code which is why I didn't hit it.)

Yeah, I assumed that was the case. By the way, the android-kk branch in
hostap.git is a snapshot of the current wpa_supplicant development
version in a form that can be built on Android. I'm using that to verify
compilation and some testing purposes on Android.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list