Make the naming scheme for dispatched functions more consistent
[oweals/openssl.git] / providers / implementations / ciphers / cipher_camellia.c
index cf9af3db32b005e25412bd8747433d4833ee05ab..abb24621a66ed302c3acd8949074c120fb99cd1f 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
@@ -7,13 +7,19 @@
  * https://www.openssl.org/source/license.html
  */
 
+/*
+ * Camellia low level APIs are deprecated for public use, but still ok for
+ * internal use.
+ */
+#include "internal/deprecated.h"
+
 /* Dispatch functions for CAMELLIA cipher modes ecb, cbc, ofb, cfb, ctr */
 
 #include "cipher_camellia.h"
 #include "prov/implementations.h"
 
-static OSSL_OP_cipher_freectx_fn camellia_freectx;
-static OSSL_OP_cipher_dupctx_fn camellia_dupctx;
+static OSSL_FUNC_cipher_freectx_fn camellia_freectx;
+static OSSL_FUNC_cipher_dupctx_fn camellia_dupctx;
 
 static void camellia_freectx(void *vctx)
 {
@@ -31,7 +37,7 @@ static void *camellia_dupctx(void *ctx)
         ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
         return NULL;
     }
-    *ret = *in;
+    in->base.hw->copyctx(&ret->base, &in->base);
 
     return ret;
 }