Skip to content

Commit

Permalink
Initial implementation of p11-unity
Browse files Browse the repository at this point in the history
  • Loading branch information
Stef Walter committed Jan 21, 2011
0 parents commit a50ba77
Show file tree
Hide file tree
Showing 14 changed files with 3,718 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
*.o
*.la
*.lo
*.tar.gz

.deps
.libs
.project
.cproject
.settings

aclocal.m4
autom4te.cache
compile
config.guess
config.h*
config.log
config.status
config.sub
configure
configure.tmp
depcomp
install-sh
INSTALL
libtool
ltmain.sh
m4
Makefile
Makefile.in
missing
stamp-h1
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stef Walter <[email protected]>
47 changes: 47 additions & 0 deletions COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* 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.
* The names of contributors to this software may not be
used to endorse or promote products derived from this
software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE
COPYRIGHT OWNER OR 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.




================================================================================
PORTIONS COPYRIGHT:

Copyright 2000-2004 The Apache Software Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
31 changes: 31 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
=== ChangeLog is autogenerated ===

p11-unity relys on commit messages to provide change history. Please
write commit messages in the following format:

=== begin example commit ===

Short explanation of the commit

Longer explanation explaining exactly what's changed, whether any
external or private interfaces changed, what bugs were fixed (with bug
tracker reference if applicable) and so forth. Be concise but not too
brief.

=== end example commit ===

- Always add a brief description of the commit to the _first_ line of
the commit and terminate by two newlines. This may be the title of
a fixed bug, copied from Bugzilla.

- First line (the brief description) must only be one sentence and
should start with a capital letter unless it starts with a
lowercase symbol or identifier. Don't use a trailing full stop,
and don't exceed 72 characters.

- The main description (the body) is normal prose and should use
normal punctuation and capital letters where appropriate.

- When committing code on behalf of others use the --author option,
e.g. git commit -a --author "Joe Coder <[email protected]>" and
--signoff.
18 changes: 18 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

SUBDIRS = module

ACLOCAL_AMFLAGS = -I m4

dist-hook:
@if test -d "$(srcdir)/.git"; \
then \
echo Creating ChangeLog && \
( cd "$(top_srcdir)" && \
echo '# Generate automatically. Do not edit.'; echo; \
$(top_srcdir)/missing --run git log --stat --date=short ) > ChangeLog.tmp \
&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
|| ( rm -f ChangeLog.tmp ; \
echo Failed to generate ChangeLog >&2 ); \
else \
echo A git clone is required to generate a ChangeLog >&2; \
fi
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0.1
* Initial release
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README
21 changes: 21 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh -e

set -e

# Some boiler plate to get git setup as expected
if test -d .git; then
if test -f .git/hooks/pre-commit.sample && \
test ! -f .git/hooks/pre-commit; then
cp -pv .git/hooks/pre-commit.sample .git/hooks/pre-commit
fi
fi

set -x

aclocal
libtoolize
autoheader
automake -a
autoconf
./configure "$@"

90 changes: 90 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
AC_PREREQ(2.65)
AC_CONFIG_MACRO_DIR([m4])

AC_INIT([p11-unity],[0.1],[http://bugzilla.example.com])

AC_CONFIG_SRCDIR([module/p11-unity.c])
AC_CONFIG_HEADERS([config.h])

dnl Other initialization
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],)
LT_INIT

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AM_PROG_CC_C_O

dnl Checks for libraries.

AC_CHECK_LIB(pthread, pthread_mutex_lock,,
[AC_MSG_ERROR([could not find pthread_mutex_lock])])
AC_CHECK_LIB(dl, dlopen,,
[AC_MSG_ERROR([could not find dlopen])])

# --------------------------------------------------------------------
# PAM Module Directory

AC_ARG_WITH([pkcs11-dir],
[AC_HELP_STRING([--with-pkcs11-dir=DIR],
[directory which holds pkcs11 modules])],
[], [with_pkcs11_dir='${libdir}/pkcs11'])
PKCS11_MODULE_PATH="$with_pkcs11_dir"
AC_SUBST(PKCS11_MODULE_PATH)

AM_CONDITIONAL(WITH_PAM, test "$have_pam" = "yes")

if test "$have_pam" = "yes"; then
pam_status="yes ($with_pam_dir)"
fi

# --------------------------------------------------------------------
# Warnings to show if using GCC

AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--disable-more-warnings], [Inhibit compiler warnings]),
set_more_warnings=no)

if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
CFLAGS="$CFLAGS \
-Wall -Wstrict-prototypes -Wmissing-declarations \
-Wmissing-prototypes -Wnested-externs -Wpointer-arith \
-Wdeclaration-after-statement -Wformat=2 -Winit-self \
-Waggregate-return -Wno-missing-format-attribute"

for option in -Wmissing-include-dirs -Wundef; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
[has_option=yes],
[has_option=no])
AC_MSG_RESULT($has_option)
if test $has_option = no; then
CFLAGS="$SAVE_CFLAGS"
fi
done
fi

# ---------------------------------------------------------------------
# Debug mode

AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[Compile binaries in debug mode]))

if test "$enable_debug" = "yes"; then
CFLAGS="$CFLAGS -g -O0"
AC_DEFINE_UNQUOTED(_DEBUG, 1, [In debug mode])
echo "enabling debug compile mode"
fi

# ---------------------------------------------------------------------

AC_CONFIG_FILES([Makefile
module/Makefile
])
AC_OUTPUT

18 changes: 18 additions & 0 deletions module/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

INCLUDES = \
-DPKCS11_MODULE_PATH=\"$(PKCS11_MODULE_PATH)\"

MODULE_SRCS = \
p11-unity.c \
hash.c hash.h

lib_LTLIBRARIES = p11-unity.la

p11_unity_la_LDFLAGS = \
-module -avoid-version \
-no-undefined -export-symbols-regex 'C_GetFunctionList'

p11_unity_la_SOURCES = $(MODULE_SRCS)

EXTRA_DIST = \
pkcs11.h
Loading

0 comments on commit a50ba77

Please sign in to comment.