diff options
author | glen.beasley%sun.com <devnull@localhost> | 2009-03-30 23:40:54 +0000 |
---|---|---|
committer | glen.beasley%sun.com <devnull@localhost> | 2009-03-30 23:40:54 +0000 |
commit | 39ab235938c1c9db482f3d9862145fb6d92e335e (patch) | |
tree | f85aa023a3422cde893a47cf43d45f5e57549fd8 /security/nss/cmd/lib | |
parent | 3c12591114234c69c6063268104c72e5329bedc3 (diff) | |
download | nss-hg-39ab235938c1c9db482f3d9862145fb6d92e335e.tar.gz |
Bug 473147 - fix for aix, pk11mode verbose output, and pk11util/pk11mode both using pk11table.c r=bob
Diffstat (limited to 'security/nss/cmd/lib')
-rw-r--r-- | security/nss/cmd/lib/manifest.mn | 2 | ||||
-rw-r--r-- | security/nss/cmd/lib/pk11table.c | 46 | ||||
-rw-r--r-- | security/nss/cmd/lib/pk11table.h | 47 |
3 files changed, 91 insertions, 4 deletions
diff --git a/security/nss/cmd/lib/manifest.mn b/security/nss/cmd/lib/manifest.mn index ee4a29c10..767b58a10 100644 --- a/security/nss/cmd/lib/manifest.mn +++ b/security/nss/cmd/lib/manifest.mn @@ -47,6 +47,7 @@ PRIVATE_EXPORTS = secutil.h \ NSPRerrs.h \ SECerrs.h \ SSLerrs.h \ + pk11table.h \ $(NULL) CSRCS = secutil.c \ @@ -56,6 +57,7 @@ CSRCS = secutil.c \ pppolicy.c \ secerror.c \ ffs.c \ + pk11table.c \ $(NULL) REQUIRES = dbm diff --git a/security/nss/cmd/lib/pk11table.c b/security/nss/cmd/lib/pk11table.c index c233fd80d..5ec551fb2 100644 --- a/security/nss/cmd/lib/pk11table.c +++ b/security/nss/cmd/lib/pk11table.c @@ -34,8 +34,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include <pkcs11.h> -#include "pk11util.h" +#include "pk11table.h" const char *_valueString[] = { "None", @@ -483,6 +482,14 @@ const Constant _consts[] = { mkEntry(CKM_CAMELLIA_MAC, Mechanism), mkEntry(CKM_CAMELLIA_MAC_GENERAL, Mechanism), mkEntry(CKM_CAMELLIA_CBC_PAD, Mechanism), + mkEntry(CKM_SEED_KEY_GEN, Mechanism), + mkEntry(CKM_SEED_ECB, Mechanism), + mkEntry(CKM_SEED_CBC, Mechanism), + mkEntry(CKM_SEED_MAC, Mechanism), + mkEntry(CKM_SEED_MAC_GENERAL, Mechanism), + mkEntry(CKM_SEED_CBC_PAD, Mechanism), + mkEntry(CKM_SEED_ECB_ENCRYPT_DATA, Mechanism), + mkEntry(CKM_SEED_CBC_ENCRYPT_DATA, Mechanism), mkEntry(CKM_DSA_PARAMETER_GEN, Mechanism), mkEntry(CKM_DH_PKCS_PARAMETER_GEN, Mechanism), mkEntry(CKM_NETSCAPE_AES_KEY_WRAP, Mechanism), @@ -1405,7 +1412,38 @@ const Topics _topics[] = { }, }; -const Topics *topics=&_topics[0]; -const int topicCount = sizeof(_topics)/sizeof(_topics[0]); +const Topics *topics= &_topics[0]; +const int topicCount = sizeof(_topics) / sizeof(_topics[0]); +const char * +getName(CK_ULONG value, ConstType type) +{ + int i; + + for (i=0; i < constCount; i++) { + if (consts[i].type == type && consts[i].value == value) { + return consts[i].name; + } + if (type == ConstNone && consts[i].value == value) { + return consts[i].name; + } + } + return NULL; +} + +const char * +getNameFromAttribute(CK_ATTRIBUTE_TYPE type) +{ + return getName(type, ConstAttribute); +} + +int totalKnownType(ConstType type) { + int count = 0; + int i; + + for (i=0; i < constCount; i++) { + if (consts[i].type == type) count++; + } + return count; +} diff --git a/security/nss/cmd/lib/pk11table.h b/security/nss/cmd/lib/pk11table.h index 8a2f4d592..4c2e3f038 100644 --- a/security/nss/cmd/lib/pk11table.h +++ b/security/nss/cmd/lib/pk11table.h @@ -1,3 +1,40 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is the Netscape security libraries. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by the Initial Developer are Copyright (C) 1994-2000 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ +#ifndef _PK11_TABLE_H_ +#define _PK11_TABLE_H_ /* * Supported functions.. @@ -163,3 +200,13 @@ extern const int commandCount; extern const Topics *topics; extern const int topicCount; +extern const char * +getName(CK_ULONG value, ConstType type); + +extern const char * +getNameFromAttribute(CK_ATTRIBUTE_TYPE type); + +extern int totalKnownType(ConstType type); + +#endif /* _PK11_TABLE_H_ */ + |