]> git.ipfire.org Git - thirdparty/strongswan.git/blobdiff - src/libcharon/plugins/stroke/stroke_cred.c
Support different encoding types in certificate.get_encoding()
[thirdparty/strongswan.git] / src / libcharon / plugins / stroke / stroke_cred.c
index 68703d128180b18a3c35c8d4e1e5051b36f3c3f6..2816b9bb2fc893dbf432b04426b5c73270794fa6 100644 (file)
@@ -587,9 +587,11 @@ static void cache_cert(private_stroke_cred_t *this, certificate_t *cert)
                        snprintf(buf, sizeof(buf), "%s/%s.crl", CRL_DIR, hex);
                        free(hex.ptr);
 
-                       chunk = cert->get_encoding(cert);
-                       chunk_write(chunk, buf, "crl", 022, TRUE);
-                       free(chunk.ptr);
+                       if (cert->get_encoding(cert, CERT_ASN1_DER, &chunk))
+                       {
+                               chunk_write(chunk, buf, "crl", 022, TRUE);
+                               free(chunk.ptr);
+                       }
                }
        }
 }