about summary refs log tree commit diff
path: root/src/sbearssl/sbearssl_ta_cert.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2016-11-25 20:16:06 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2016-11-25 20:16:06 +0000
commit8d532683386121e70810b0d7c6642cc2c2b89cb0 (patch)
tree866010763c829a35b18603c5af58896bd14afd18 /src/sbearssl/sbearssl_ta_cert.c
parent018025f0f36a4847df265c9948dbaf7073ed3245 (diff)
downloads6-networking-8d532683386121e70810b0d7c6642cc2c2b89cb0.tar.gz
s6-networking-8d532683386121e70810b0d7c6642cc2c2b89cb0.tar.xz
s6-networking-8d532683386121e70810b0d7c6642cc2c2b89cb0.zip
Fix build bugs. It builds!
 Two things remain to do:
  - how to pass SNI information to libtls
  - how to detect cert issuer key type for ECC in bearssl
Diffstat (limited to 'src/sbearssl/sbearssl_ta_cert.c')
-rw-r--r--src/sbearssl/sbearssl_ta_cert.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sbearssl/sbearssl_ta_cert.c b/src/sbearssl/sbearssl_ta_cert.c
index d8f26e5..82019ef 100644
--- a/src/sbearssl/sbearssl_ta_cert.c
+++ b/src/sbearssl/sbearssl_ta_cert.c
@@ -5,6 +5,7 @@
 #include <bearssl.h>
 #include <skalibs/stralloc.h>
 #include <s6-networking/sbearssl.h>
+#include "sbearssl-internal.h"
 
 int sbearssl_ta_cert (sbearssl_ta *ta, sbearssl_cert const *cert, char const *certstorage, stralloc *tastorage)
 {
@@ -13,15 +14,14 @@ int sbearssl_ta_cert (sbearssl_ta *ta, sbearssl_cert const *cert, char const *ce
   struct sbearssl_strallocerr_s blah = { .sa = tastorage } ;
   size_t tastoragebase = tastorage->len ;
   int tastoragewasnull = !tastorage->s ;
-  br_x509_pkey bpk ;
-  int r ;
+  br_x509_pkey *bpk ;
+  int r = -1 ;
 
   br_x509_decoder_init(&ctx, &sbearssl_append, &blah) ;
   br_x509_decoder_push(&ctx, certstorage + cert->data, cert->datalen) ;
-  if (blah->err)
+  if (blah.err)
   {
-    r = -1 ;
-    errno = blah->err ;
+    errno = blah.err ;
     goto fail ;
   }
   bpk = br_x509_decoder_get_pkey(&ctx) ;