diff options
| author | Miloslav Trmač <mitr@redhat.com> | 2010-10-27 00:17:51 +0200 |
|---|---|---|
| committer | Miloslav Trmač <mitr@redhat.com> | 2010-10-27 00:17:51 +0200 |
| commit | edd985803ffe80e42ba91838914dff1fc8b42780 (patch) | |
| tree | 7e2753a3aece0c916f73a8319d3511926a868a90 /lib | |
| parent | 06a02e2391625a09e194acf1c6d31aecf2266b8f (diff) | |
| download | ncrypto-edd985803ffe80e42ba91838914dff1fc8b42780.tar.gz ncrypto-edd985803ffe80e42ba91838914dff1fc8b42780.tar.xz ncrypto-edd985803ffe80e42ba91838914dff1fc8b42780.zip | |
Declare struct ncr_symm_key in an internal header
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/internal.h | 42 | ||||
| -rw-r--r-- | lib/ncrypto_local.c | 9 |
2 files changed, 44 insertions, 7 deletions
diff --git a/lib/internal.h b/lib/internal.h new file mode 100644 index 0000000..97fb77d --- /dev/null +++ b/lib/internal.h @@ -0,0 +1,42 @@ +/* Internal data structures. + +Copyright 2010 Red Hat, Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +Red Hat author: Miloslav Trmač <mitr@redhat.com> */ +#ifndef INTERNAL_H +#define INTERNAL_H + +#include <config.h> + +#include <stdint.h> +#include <ncrypto/ncrypto.h> + +struct ncr_symm_key +{ + CK_KEY_TYPE type; + size_t size; + uint8_t value[]; +}; + +#endif diff --git a/lib/ncrypto_local.c b/lib/ncrypto_local.c index 8cf4667..d13f8a8 100644 --- a/lib/ncrypto_local.c +++ b/lib/ncrypto_local.c @@ -37,6 +37,8 @@ Red Hat author: Miloslav Trmač <mitr@redhat.com> */ #include <ncrypto/ncrypto.h> +#include "internal.h" + /* Helpers */ static CK_RV @@ -58,13 +60,6 @@ ncr_get_random_bytes (void *dest, size_t size) /* Symmetric keys */ -struct ncr_symm_key -{ - CK_KEY_TYPE type; - size_t size; - uint8_t value[]; -}; - CK_RV ncr_symm_key_create (struct ncr_symm_key **key, CK_KEY_TYPE type, const void *value, size_t value_size) |
