Update copyright year
[oweals/openssl.git] / crypto / serializer / serializer_meth.c
index 103188f93a85f462dc2aa136745f63c573c2d4e0..e3e77c542a65427ab4cae2eb912c07ee81d93967 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -10,6 +10,7 @@
 #include <openssl/core.h>
 #include <openssl/core_numbers.h>
 #include <openssl/serializer.h>
+#include <openssl/ui.h>
 #include "internal/core.h"
 #include "internal/namemap.h"
 #include "internal/property.h"
@@ -416,8 +417,13 @@ void OSSL_SERIALIZER_do_all_provided(OPENSSL_CTX *libctx,
 
     data.user_fn = (void (*)(void *, void *))fn;
     data.user_arg = arg;
-    ossl_algorithm_do_all(libctx, OSSL_OP_SERIALIZER, NULL,
-                          serializer_do_one, &data);
+
+    /*
+     * No pre- or post-condition for this call, as this only creates methods
+     * temporarly and then promptly destroys them.
+     */
+    ossl_algorithm_do_all(libctx, OSSL_OP_SERIALIZER, NULL, NULL,
+                          serializer_do_one, NULL, &data);
 }
 
 void OSSL_SERIALIZER_names_do_all(const OSSL_SERIALIZER *ser,
@@ -449,7 +455,7 @@ const OSSL_PARAM *OSSL_SERIALIZER_settable_ctx_params(OSSL_SERIALIZER *ser)
 /*
  * |ser| value NULL is valid, and signifies that there is no serializer.
  * This is useful to provide fallback mechanisms.
- *  Funtions that want to verify if there is a serializer can do so with
+ *  Functions that want to verify if there is a serializer can do so with
  * OSSL_SERIALIZER_CTX_get_serializer()
  */
 OSSL_SERIALIZER_CTX *OSSL_SERIALIZER_CTX_new(OSSL_SERIALIZER *ser)
@@ -509,6 +515,7 @@ void OSSL_SERIALIZER_CTX_free(OSSL_SERIALIZER_CTX *ctx)
         if (ctx->ser != NULL && ctx->ser->freectx != NULL)
             ctx->ser->freectx(ctx->serctx);
         OSSL_SERIALIZER_free(ctx->ser);
+        UI_destroy_method(ctx->allocated_ui_method);
         OPENSSL_free(ctx);
     }
 }