diff options
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | lib/internal.h | 42 | ||||
-rw-r--r-- | lib/ncrypto_local.c | 9 |
3 files changed, 46 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am index 92bdeef..f1a5885 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,7 +40,8 @@ TESTS = tests/digests tests/rsa tests/symm_ciphers tests/symm_signatures ## Rules noinst_PROGRAMS = $(TESTS) -lib_libncrypto_la_SOURCES = lib/ncrypto.c lib/ncrypto_local.c lib/ncrypto_nss.c +lib_libncrypto_la_SOURCES = lib/internal.h lib/ncrypto.c lib/ncrypto_local.c \ + lib/ncrypto_nss.c lib_libncrypto_la_LDFLAGS = -version-info 0:0:0 $(NSS_LIBS) $(OPENSSL_LIBS) tests_digests_LDADD = lib/libncrypto.la $(GLIB_LIBS) 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) |