Skip to content

Commit

Permalink
Bug 1162897, Allow certificates to be specified by RFC7512 PKCS#11 UR…
Browse files Browse the repository at this point in the history
…I, patch 0003, r=rrelyea

Add PKCS#11 URI handling support in lib/p11uri
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 26, 2016
1 parent 77b8c06 commit afa4ad3
Show file tree
Hide file tree
Showing 9 changed files with 1,383 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/platlibs.mk
Expand Up @@ -97,6 +97,7 @@ NSS_LIBS_2 = \
$(DIST)/lib/$(LIB_PREFIX)pkcs7.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)cryptohi.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)p11uri.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)certdb.$(LIB_SUFFIX) \
$(NULL)
Expand Down Expand Up @@ -129,6 +130,7 @@ NSS_LIBS_2 = \
$(DIST)/lib/$(LIB_PREFIX)pkcs7.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)cryptohi.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)p11uri.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
$(NULL)
NSS_LIBS_3 = \
Expand All @@ -141,6 +143,7 @@ NSS_LIBS_4 = \
$(DBMLIB) \
$(PKIXLIB) \
$(DIST)/lib/$(LIB_PREFIX)nss.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)p11uri.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
$(NULL)
Expand Down
2 changes: 1 addition & 1 deletion lib/manifest.mn
Expand Up @@ -28,7 +28,7 @@ ifndef NSS_BUILD_SOFTOKEN_ONLY
NSS_SRCDIRS = \
base dev pki \
$(LIBPKIX_SRCDIR) \
certdb certhigh pk11wrap cryptohi nss \
certdb certhigh p11uri pk11wrap cryptohi nss \
$(ZLIB_SRCDIR) ssl \
pkcs7 pkcs12 smime \
crmf jar \
Expand Down
2 changes: 2 additions & 0 deletions lib/nss/config.mk
Expand Up @@ -53,6 +53,7 @@ endif
SHARED_LIBRARY_LIBS = \
$(DIST)/lib/$(LIB_PREFIX)certhi.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)cryptohi.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)p11uri.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)pk11wrap.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)certdb.$(LIB_SUFFIX) \
$(DIST)/lib/$(LIB_PREFIX)nsspki.$(LIB_SUFFIX) \
Expand All @@ -74,6 +75,7 @@ SHARED_LIBRARY_LIBS = \
SHARED_LIBRARY_DIRS = \
../certhigh \
../cryptohi \
../p11uri \
../pk11wrap \
../certdb \
../pki \
Expand Down
22 changes: 22 additions & 0 deletions lib/nss/nss.def
Expand Up @@ -169,6 +169,28 @@ NSSRWLock_New;
NSSRWLock_UnlockRead;
NSSRWLock_UnlockWrite;
NSS_PutEnv;
P11URI_AnyUnrecognized;
P11URI_ClearAttribute;
P11URI_ClearAttributes;
P11URI_Format;
P11URI_Free;
P11URI_FreeString;
P11URI_GetAttribute;
P11URI_GetAttributes;
P11URI_GetModuleInfo;
P11URI_GetPinSource;
P11URI_GetPinValue;
P11URI_GetTokenInfo;
P11URI_MatchAttributes;
P11URI_MatchModuleInfo;
P11URI_MatchTokenInfo;
P11URI_New;
P11URI_Parse;
P11URI_SetAttribute;
P11URI_SetAttributes;
P11URI_SetPinSource;
P11URI_SetPinValue;
P11URI_SetUnrecognized;
PK11_Derive;
PK11_DeriveWithFlags;
PK11_DigestKey;
Expand Down
48 changes: 48 additions & 0 deletions lib/p11uri/Makefile
@@ -0,0 +1,48 @@
#! gmake
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

#######################################################################
# (1) Include initial platform-independent assignments (MANDATORY). #
#######################################################################

include manifest.mn

#######################################################################
# (2) Include "global" configuration information. (OPTIONAL) #
#######################################################################

include $(CORE_DEPTH)/coreconf/config.mk

#######################################################################
# (3) Include "component" configuration information. (OPTIONAL) #
#######################################################################



#######################################################################
# (4) Include "local" platform-dependent assignments (OPTIONAL). #
#######################################################################

include config.mk

#######################################################################
# (5) Execute "global" rules. (OPTIONAL) #
#######################################################################

include $(CORE_DEPTH)/coreconf/rules.mk

#######################################################################
# (6) Execute "component" rules. (OPTIONAL) #
#######################################################################



#######################################################################
# (7) Execute "local" rules. (OPTIONAL). #
#######################################################################

export:: private_export

15 changes: 15 additions & 0 deletions lib/p11uri/config.mk
@@ -0,0 +1,15 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

#
# Override TARGETS variable so that only static libraries
# are specifed as dependencies within rules.mk.
#

TARGETS = $(LIBRARY)
SHARED_LIBRARY =
IMPORT_LIBRARY =
PROGRAM =

23 changes: 23 additions & 0 deletions lib/p11uri/manifest.mn
@@ -0,0 +1,23 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
CORE_DEPTH = ../..

EXPORTS = \
p11uri.h \
$(NULL)

PRIVATE_EXPORTS = \
$(NULL)

MODULE = nss

CSRCS = \
p11uri.c \
$(NULL)

LIBRARY_NAME = p11uri

# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

0 comments on commit afa4ad3

Please sign in to comment.