From bd25bf703f26b33818e0dc9f25ece57b1583a71c Mon Sep 17 00:00:00 2001 From: "ian.mcgreer%sun.com" Date: Mon, 26 Aug 2002 20:32:39 +0000 Subject: [PATCH] clean out more directories with single function files git-svn-id: svn://10.0.0.236/branches/STAN_WORK_BRANCH@128148 18797224-902f-48f8-a5cc-f745e15eee43 --- .../lib/pkix/src/AlgorithmIdentifier/Create.c | 85 -------- .../lib/pkix/src/AlgorithmIdentifier/Decode.c | 79 -------- .../pkix/src/AlgorithmIdentifier/Destroy.c | 71 ------- .../pkix/src/AlgorithmIdentifier/Duplicate.c | 79 -------- .../lib/pkix/src/AlgorithmIdentifier/Encode.c | 81 -------- .../lib/pkix/src/AlgorithmIdentifier/Equal.c | 83 -------- .../src/AlgorithmIdentifier/GetAlgorithm.c | 71 ------- .../src/AlgorithmIdentifier/GetParameters.c | 80 -------- .../lib/pkix/src/AlgorithmIdentifier/MClear.c | 71 ------- .../pkix/src/AlgorithmIdentifier/PCreate.c | 138 ------------- .../pkix/src/AlgorithmIdentifier/PDecode.c | 137 ------------- .../pkix/src/AlgorithmIdentifier/PDestroy.c | 76 ------- .../pkix/src/AlgorithmIdentifier/PDuplicate.c | 144 ------------- .../pkix/src/AlgorithmIdentifier/PEncode.c | 117 ----------- .../lib/pkix/src/AlgorithmIdentifier/PEqual.c | 88 -------- .../src/AlgorithmIdentifier/PGetAlgorithm.c | 69 ------- .../src/AlgorithmIdentifier/PGetParameters.c | 78 ------- .../src/AlgorithmIdentifier/PSetAlgorithm.c | 75 ------- .../src/AlgorithmIdentifier/PSetParameters.c | 86 -------- .../src/AlgorithmIdentifier/SetAlgorithm.c | 76 ------- .../src/AlgorithmIdentifier/SetParameters.c | 77 ------- .../src/AlgorithmIdentifier/verifyPointer.c | 182 ----------------- .../nss/lib/pkix/src/Attribute/AddValue.c | 79 -------- .../nss/lib/pkix/src/Attribute/Create.c | 141 ------------- .../lib/pkix/src/Attribute/CreateFromArray.c | 97 --------- .../nss/lib/pkix/src/Attribute/Decode.c | 84 -------- .../nss/lib/pkix/src/Attribute/Destroy.c | 74 ------- .../nss/lib/pkix/src/Attribute/Duplicate.c | 79 -------- .../nss/lib/pkix/src/Attribute/Encode.c | 85 -------- .../nss/lib/pkix/src/Attribute/Equal.c | 88 -------- .../nss/lib/pkix/src/Attribute/FindValue.c | 84 -------- .../nss/lib/pkix/src/Attribute/GetType.c | 72 ------- .../nss/lib/pkix/src/Attribute/GetValue.c | 86 -------- .../lib/pkix/src/Attribute/GetValueCount.c | 75 ------- .../nss/lib/pkix/src/Attribute/GetValues.c | 88 -------- .../nss/lib/pkix/src/Attribute/MClear.c | 71 ------- .../nss/lib/pkix/src/Attribute/MCount.c | 87 -------- .../nss/lib/pkix/src/Attribute/MVCreate.c | 165 --------------- .../nss/lib/pkix/src/Attribute/PAddValue.c | 140 ------------- .../nss/lib/pkix/src/Attribute/PCreate.c | 139 ------------- .../lib/pkix/src/Attribute/PCreateFromArray.c | 191 ------------------ .../nss/lib/pkix/src/Attribute/PDecode.c | 153 -------------- .../nss/lib/pkix/src/Attribute/PDestroy.c | 82 -------- .../nss/lib/pkix/src/Attribute/PDuplicate.c | 189 ----------------- .../nss/lib/pkix/src/Attribute/PEncode.c | 126 ------------ .../nss/lib/pkix/src/Attribute/PEqual.c | 164 --------------- .../nss/lib/pkix/src/Attribute/PFindValue.c | 107 ---------- .../nss/lib/pkix/src/Attribute/PGetType.c | 79 -------- .../nss/lib/pkix/src/Attribute/PGetValue.c | 98 --------- .../lib/pkix/src/Attribute/PGetValueCount.c | 88 -------- .../nss/lib/pkix/src/Attribute/PGetValues.c | 145 ------------- .../nss/lib/pkix/src/Attribute/PRemoveValue.c | 121 ----------- .../nss/lib/pkix/src/Attribute/PSetType.c | 90 --------- .../nss/lib/pkix/src/Attribute/PSetValue.c | 102 ---------- .../nss/lib/pkix/src/Attribute/PSetValues.c | 135 ------------- .../nss/lib/pkix/src/Attribute/RemoveValue.c | 76 ------- .../nss/lib/pkix/src/Attribute/SetType.c | 80 -------- .../nss/lib/pkix/src/Attribute/SetValue.c | 80 -------- .../nss/lib/pkix/src/Attribute/SetValues.c | 85 -------- .../nss/lib/pkix/src/Attribute/template.c | 58 ------ .../lib/pkix/src/Attribute/verifyPointer.c | 170 ---------------- .../lib/pkix/src/X520Name/CreateFromUTF8.c | 105 ---------- .../nss/lib/pkix/src/X520Name/Decode.c | 79 -------- .../nss/lib/pkix/src/X520Name/Destroy.c | 70 ------- .../nss/lib/pkix/src/X520Name/Duplicate.c | 79 -------- .../nss/lib/pkix/src/X520Name/Encode.c | 80 -------- .../nss/lib/pkix/src/X520Name/Equal.c | 83 -------- .../lib/pkix/src/X520Name/GetUTF8Encoding.c | 78 ------- .../nss/lib/pkix/src/X520Name/MDoUTF8.c | 97 --------- .../nss/lib/pkix/src/X520Name/PCreate.c | 169 ---------------- .../lib/pkix/src/X520Name/PCreateFromUTF8.c | 164 --------------- .../nss/lib/pkix/src/X520Name/PDecode.c | 135 ------------- .../nss/lib/pkix/src/X520Name/PDestroy.c | 87 -------- .../nss/lib/pkix/src/X520Name/PDuplicate.c | 158 --------------- .../nss/lib/pkix/src/X520Name/PEncode.c | 93 --------- .../nss/lib/pkix/src/X520Name/PEqual.c | 100 --------- .../lib/pkix/src/X520Name/PGetUTF8Encoding.c | 82 -------- .../nss/lib/pkix/src/X520Name/template.c | 56 ----- .../nss/lib/pkix/src/X520Name/verifyPointer.c | 169 ---------------- 79 files changed, 8080 deletions(-) delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Create.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Decode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Destroy.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Duplicate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Encode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Equal.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/GetAlgorithm.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/GetParameters.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/MClear.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PCreate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDecode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDestroy.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDuplicate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PEncode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PEqual.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetAlgorithm.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetParameters.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetAlgorithm.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetParameters.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/SetAlgorithm.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/SetParameters.c delete mode 100644 mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/verifyPointer.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/AddValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/Create.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/CreateFromArray.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/Decode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/Destroy.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/Duplicate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/Encode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/Equal.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/FindValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/GetType.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/GetValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/GetValueCount.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/GetValues.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/MClear.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/MCount.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/MVCreate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PAddValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PCreate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PDecode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PDestroy.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PDuplicate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PEncode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PEqual.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PFindValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PGetType.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PGetValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PGetValueCount.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PGetValues.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PRemoveValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PSetType.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PSetValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/PSetValues.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/RemoveValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/SetType.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/SetValue.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/SetValues.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/template.c delete mode 100644 mozilla/security/nss/lib/pkix/src/Attribute/verifyPointer.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/CreateFromUTF8.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/Decode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/Destroy.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/Duplicate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/Encode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/Equal.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/GetUTF8Encoding.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/MDoUTF8.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/PCreate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/PCreateFromUTF8.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/PDecode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/PDestroy.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/PDuplicate.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/PEncode.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/PEqual.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/PGetUTF8Encoding.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/template.c delete mode 100644 mozilla/security/nss/lib/pkix/src/X520Name/verifyPointer.c diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Create.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Create.c deleted file mode 100644 index 7e545a1ba8c..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Create.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/Create.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:04:58 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_Create - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_POINTER - * - * Return value: - * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAlgorithmIdentifier * -NSSPKIXAlgorithmIdentifier_Create -( - NSSArena *arenaOpt, - NSSOID *algorithm, - NSSItem *parameters -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(algorithm) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - - if( PR_SUCCESS != nssItem_verifyPointer(parameters) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_Create(arenaOpt, algorithm, parameters); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Decode.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Decode.c deleted file mode 100644 index 3fcbc1ea502..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Decode.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/Decode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:05:00 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_Decode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAlgorithmIdentifier * -NSSPKIXAlgorithmIdentifier_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_Decode(arenaOpt, ber); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Destroy.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Destroy.c deleted file mode 100644 index 43d1829347b..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Destroy.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/Destroy.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:05:02 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_Destroy - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAlgorithmIdentifier_Destroy -( - NSSPKIXAlgorithmIdentifier *algid -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_Destroy(algid); -} - diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Duplicate.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Duplicate.c deleted file mode 100644 index 43c9ee5ef11..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Duplicate.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/Duplicate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:05:24 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_Duplicate - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAlgorithmIdentifier * -NSSPKIXAlgorithmIdentifier_Duplicate -( - NSSPKIXAlgorithmIdentifier *algid, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_Duplicate(algid, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Encode.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Encode.c deleted file mode 100644 index b7c2e03f06a..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Encode.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/Encode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:05:28 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_Encode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXAlgorithmIdentifier_Encode -( - NSSPKIXAlgorithmIdentifier *algid, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_Encode(algid, encoding, rvOpt, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Equal.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Equal.c deleted file mode 100644 index 1d09a7477cc..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Equal.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/Equal.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:05:32 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_Equal - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -NSSPKIXAlgorithmIdentifier_Equal -( - NSSPKIXAlgorithmIdentifier *algid1, - NSSPKIXAlgorithmIdentifier *algid2, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_Equal(algid1, algid2, statusOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/GetAlgorithm.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/GetAlgorithm.c deleted file mode 100644 index 3cd48fd88ee..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/GetAlgorithm.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/GetAlgorithm.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:05:43 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_GetAlgorithm - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSOID pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSOID * -NSSPKIXAlgorithmIdentifier_GetAlgorithm -( - NSSPKIXAlgorithmIdentifier *algid -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return (NSSOID *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_GetAlgorithm(algid); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/GetParameters.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/GetParameters.c deleted file mode 100644 index 29e2cfb4b42..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/GetParameters.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/GetParameters.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:05:47 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_GetParameters - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSItem upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSItem * -NSSPKIXAlgorithmIdentifier_GetParameters -( - NSSPKIXAlgorithmIdentifier *algid, - NSSItem *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return (NSSItem *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSItem *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_GetParameters(algid, rvOpt, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/MClear.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/MClear.c deleted file mode 100644 index 8b78649d825..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/MClear.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/MClear.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:06:07 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_AlgorithmIdentifier_Clear - * - * Wipes out cached data. - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_AlgorithmIdentifier_Clear -( - NSSPKIXAlgorithmIdentifier *algid -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSBER *)NULL != algid->ber ) { - nss_ZFreeIf(algid->ber->data); - nss_ZFreeIf(algid->ber); - } - - if( (NSSDER *)NULL != algid->der ) { - nss_ZFreeIf(algid->der->data); - nss_ZFreeIf(algid->der); - } - - return PR_SUCCESS; -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PCreate.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PCreate.c deleted file mode 100644 index dbef1ddfdc8..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PCreate.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PCreate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:06:18 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_Create - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_POINTER - * - * Return value: - * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAlgorithmIdentifier * -nssPKIXAlgorithmIdentifier_Create -( - NSSArena *arenaOpt, - NSSOID *algorithm, - NSSItem *parameters -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAlgorithmIdentifier *rv = (NSSPKIXAlgorithmIdentifier *)NULL; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(algorithm) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - - if( PR_SUCCESS != nssItem_verifyPointer(parameters) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAlgorithmIdentifier); - if( (NSSPKIXAlgorithmIdentifier *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->algorithm = algorithm; - rv->parameters = nssItem_Duplicate(parameters, arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == rv->parameters ) { - goto loser; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_AlgorithmIdentifier_add_pointer(rv) ) { - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAlgorithmIdentifier *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDecode.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDecode.c deleted file mode 100644 index 73bf54d7f92..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDecode.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PDecode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:06:42 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_Decode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAlgorithmIdentifier * -nssPKIXAlgorithmIdentifier_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAlgorithmIdentifier *rv = (NSSPKIXAlgorithmIdentifier *)NULL; - PRStatus status; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAlgorithmIdentifier); - if( (NSSPKIXAlgorithmIdentifier *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->ber = nssItem_Duplicate(ber, arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == rv->ber ) { - goto loser; - } - - status = nssASN1_DecodeBER(arena, rv, nssPKIXAlgorithmIdentifier_template, ber); - if( PR_SUCCESS != status ) { - goto loser; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_AlgorithmIdentifier_add_pointer(rv) ) { - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAlgorithmIdentifier *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDestroy.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDestroy.c deleted file mode 100644 index b4a60519826..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDestroy.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PDestroy.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:06:54 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_Destroy - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAlgorithmIdentifier_Destroy -( - NSSPKIXAlgorithmIdentifier *algid -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - -#ifdef DEBUG - (void)nss_pkix_AlgorithmIdentifier_remove_pointer(algid); -#endif /* DEBUG */ - - if( PR_TRUE == algid->i_allocated_arena ) { - return nssArena_Destroy(algid->arena); - } - - return PR_SUCCESS; -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDuplicate.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDuplicate.c deleted file mode 100644 index c784a48758e..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PDuplicate.c +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PDuplicate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:06:57 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_Duplicate - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXAlgorithmIdentifier upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAlgorithmIdentifier * -nssPKIXAlgorithmIdentifier_Duplicate -( - NSSPKIXAlgorithmIdentifier *algid, - NSSArena *arenaOpt -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAlgorithmIdentifier *rv = (NSSPKIXAlgorithmIdentifier *)NULL; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAlgorithmIdentifier *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAlgorithmIdentifier); - if( (NSSPKIXAlgorithmIdentifier *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - rv->ber = nssItem_Duplicate(algid->ber, arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == rv->ber ) { - goto loser; - } - - rv->der = nssItem_Duplicate(algid->der, arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == rv->der ) { - goto loser; - } - - rv->algorithm = algid->algorithm; - - rv->parameters = nssItem_Duplicate(algid->parameters, arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == rv->parameters ) { - goto loser; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_AlgorithmIdentifier_add_pointer(rv) ) { - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAlgorithmIdentifier *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PEncode.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PEncode.c deleted file mode 100644 index fab57fe0452..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PEncode.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PEncode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:07:04 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_Encode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -nssPKIXAlgorithmIdentifier_Encode -( - NSSPKIXAlgorithmIdentifier *algid, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* NSSDEBUG */ - - switch( encoding ) { - case NSSASN1BER: - if( (NSSBER *)NULL != algid->ber ) { - it = algid->ber; - goto done; - } - /*FALLTHROUGH*/ - case NSSASN1DER: - if( (NSSDER *)NULL != algid->der ) { - it = algid->der; - goto done; - } - break; - default: - nss_SetError(NSS_ERROR_UNSUPPORTED_ENCODING); - return (NSSBER *)NULL; - } - - it = nssASN1_EncodeItem(algid->arena, (NSSItem *)NULL, algid, - nssPKIXAlgorithmIdentifier_template, encoding); - if( (NSSBER *)NULL == it ) { - return (NSSBER *)NULL; - } - - switch( encoding ) { - case NSSASN1BER: - algid->ber = it; - break; - case NSSASN1DER: - algid->der = it; - break; - default: - PR_ASSERT(0); - break; - } - - done: - return nssItem_Duplicate(it, arenaOpt, rvOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PEqual.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PEqual.c deleted file mode 100644 index 711a99d52ae..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PEqual.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PEqual.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:07:21 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_Equal - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -nssPKIXAlgorithmIdentifier_Equal -( - NSSPKIXAlgorithmIdentifier *algid1, - NSSPKIXAlgorithmIdentifier *algid2, - PRStatus *statusOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } -#endif /* NSSDEBUG */ - - if( algid1->algorithm != algid2->algorithm ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_SUCCESS; - } - return PR_FALSE; - } - - return nssItem_Equal(algid1->parameters, algid2->parameters, statusOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetAlgorithm.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetAlgorithm.c deleted file mode 100644 index 5b962ca5916..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetAlgorithm.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PGetAlgorithm.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:07:26 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_GetAlgorithm - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSOID pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSOID * -nssPKIXAlgorithmIdentifier_GetAlgorithm -( - NSSPKIXAlgorithmIdentifier *algid -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return (NSSOID *)NULL; - } -#endif /* NSSDEBUG */ - - return algid->algorithm; -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetParameters.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetParameters.c deleted file mode 100644 index bc5ac68acb6..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetParameters.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PGetParameters.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:07:40 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_GetParameters - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSItem upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSItem * -nssPKIXAlgorithmIdentifier_GetParameters -( - NSSPKIXAlgorithmIdentifier *algid, - NSSItem *rvOpt, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return (NSSItem *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSItem *)NULL; - } - } -#endif /* NSSDEBUG */ - - return nssItem_Duplicate(algid->parameters, arenaOpt, rvOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetAlgorithm.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetAlgorithm.c deleted file mode 100644 index a4f9ade3ae8..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetAlgorithm.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PSetAlgorithm.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:07:51 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_SetAlgorithm - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_OID - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAlgorithmIdentifier_SetAlgorithm -( - NSSPKIXAlgorithmIdentifier *algid, - NSSOID *algorithm -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssOID_verifyPointer(algorithm) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - algid->algorithm = algorithm; - return nss_pkix_AlgorithmIdentifier_Clear(algid); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetParameters.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetParameters.c deleted file mode 100644 index a74d30dcb48..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetParameters.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/PSetParameters.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:08:48 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAlgorithmIdentifier_SetParameters - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_POINTER - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAlgorithmIdentifier_SetParameters -( - NSSPKIXAlgorithmIdentifier *algid, - NSSItem *parameters -) -{ - NSSItem *prev; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(parameters) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - prev = algid->parameters; - - algid->parameters = nssItem_Duplicate(parameters, algid->arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == algid->parameters ) { - algid->parameters = prev; - return PR_FAILURE; - } - - (void)nssItem_Destroy(prev); - return nss_pkix_AlgorithmIdentifier_Clear(algid); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/SetAlgorithm.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/SetAlgorithm.c deleted file mode 100644 index 2a411c558b6..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/SetAlgorithm.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/SetAlgorithm.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:08:53 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_SetAlgorithm - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_OID - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAlgorithmIdentifier_SetAlgorithm -( - NSSPKIXAlgorithmIdentifier *algid, - NSSOID *algorithm -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssOID_verifyPointer(algorithm) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_SetAlgorithm(algid, algorithm); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/SetParameters.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/SetParameters.c deleted file mode 100644 index 446f505b1e0..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/SetParameters.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/SetParameters.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:08:55 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAlgorithmIdentifier_SetParameters - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ALGORITHM_IDENTIFIER - * NSS_ERROR_INVALID_POINTER - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAlgorithmIdentifier_SetParameters -( - NSSPKIXAlgorithmIdentifier *algid, - NSSItem *parameters -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAlgorithmIdentifier_verifyPointer(algid) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(parameters) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAlgorithmIdentifier_SetParameters(algid, parameters); -} diff --git a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/verifyPointer.c b/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/verifyPointer.c deleted file mode 100644 index 14837e39eb9..00000000000 --- a/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/verifyPointer.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/AlgorithmIdentifier/Attic/verifyPointer.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:08:58 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -#ifdef DEBUG - -extern const NSSError NSS_ERROR_INTERNAL_ERROR; - -static nssPointerTracker pkix_algid_pointer_tracker; - -/* - * nss_pkix_AlgorithmIdentifier_add_pointer - * - * This method is only present in debug builds. - * - * This module-private routine adds an NSSPKIXAlgorithmIdentifier pointer to - * the internal pointer-tracker. This routine should only be used - * by the NSSPKIX module. This routine returns a PRStatus value; - * upon error it will place an error on the error stack and return - * PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INTERNAL_ERROR - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_AlgorithmIdentifier_add_pointer -( - const NSSPKIXAlgorithmIdentifier *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_algid_pointer_tracker); - if( PR_SUCCESS != rv ) { - return rv; - } - - rv = nssPointerTracker_add(&pkix_algid_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - NSSError e = NSS_GetError(); - if( NSS_ERROR_NO_MEMORY != e ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - return rv; - } - - rv = nssArena_registerDestructor(p->arena, - nss_pkix_AlgorithmIdentifier_remove_pointer, p); - if( PR_SUCCESS != rv ) { - (void)nss_pkix_AlgorithmIdentifier_remove_pointer(p); - return rv; - } - - return rv; -} - -/* - * nss_pkix_AlgorithmIdentifier_remove_pointer - * - * This method is only present in debug builds. - * - * This module-private routine removes a valid NSSPKIXAlgorithmIdentifier - * pointer from the internal pointer-tracker. This routine should - * only be used by the NSSPKIX module. This routine returns a - * PRStatus value; upon error it will place an error on the error - * stack and return PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_INTERNAL_ERROR - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_AlgorithmIdentifier_remove_pointer -( - const NSSPKIXAlgorithmIdentifier *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_remove(&pkix_algid_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - /* - * nssArena_deregisterDestructor(p->arena, - * nss_pkix_AlgorithmIdentifier_remove_pointer, p); - */ - - return rv; -} - -/* - * nssPKIXAlgorithmIdentifier_verifyPointer - * - * This method is only present in debug builds. - * - * If the specified pointer is a valid pointer to an NSSPKIXAlgorithmIdentifier - * object, this routine will return PR_SUCCESS. Otherwise, it will - * put an error on the error stack and return PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_SUCCESS if the pointer is valid - * PR_FAILURE if it isn't - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAlgorithmIdentifier_verifyPointer -( - NSSPKIXAlgorithmIdentifier *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_algid_pointer_tracker); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - rv = nssPointerTracker_verify(&pkix_algid_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - return PR_SUCCESS; -} - -#endif /* DEBUG */ - diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/AddValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/AddValue.c deleted file mode 100644 index 8e2be740e86..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/AddValue.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/AddValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:02 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_AddValue - * - * This routine adds the specified attribute value to the set in - * the specified NSSPKIXAttribute. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_AddValue -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue *value -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_AddValue(attribute, value); -} - diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/Create.c b/mozilla/security/nss/lib/pkix/src/Attribute/Create.c deleted file mode 100644 index 8aefbf24987..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/Create.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/Create.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:06 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Create - * - * This routine creates an NSSPKIXAttribute from specified components. - * This routine may return NULL upon error, in which case it will have - * created an error stack. If the optional arena argument is non-NULL, - * that arena will be used for the required memory. There must be at - * least one attribute value specified. The final argument must be - * NULL, to indicate the end of the set of attribute values. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_INSUFFICIENT_VALUES - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -NSSPKIXAttribute_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - NSSPKIXAttributeValue *value1, - ... -) -{ - va_list ap; - NSSPKIXAttribute *rv; - PRUint32 count; - - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttribute *)NULL; - } - - if( (NSSPKIXAttributeValue *)NULL == value1 ) { - nss_SetError(NSS_ERROR_INSUFFICIENT_VALUES); - return (NSSPKIXAttribute *)NULL; - } - - { - va_start(ap, typeOid); - - while( 1 ) { - NSSPKIXAttributeValue *v; - v = (NSSPKIXAttributeValue *)va_arg(ap, NSSPKIXAttributeValue *); - if( (NSSPKIXAttributeValue *)NULL == v ) { - break; - } - - if( PR_SUCCESS != nssItem_verifyPointer(v) ) { - va_end(ap); - return (NSSPKIXAttribute *)NULL; - } - } - - va_end(ap); - } -#endif /* DEBUG */ - - va_start(ap, typeOid); - - for( count = 0; ; count++ ) { - NSSPKIXAttributeValue *v; - v = (NSSPKIXAttributeValue *)va_arg(ap, NSSPKIXAttributeValue *); - if( (NSSPKIXAttributeValue *)NULL == v ) { - break; - } - -#ifdef PEDANTIC - if( count == 0xFFFFFFFF ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - va_end(ap); - return (NSSPKIXAttribute *)NULL; - } -#endif /* PEDANTIC */ - } - - va_end(ap); - - va_start(ap, typeOid); - rv = nss_pkix_Attribute_V_Create(arenaOpt, typeOid, count, ap); - va_end(ap); - - return rv; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/CreateFromArray.c b/mozilla/security/nss/lib/pkix/src/Attribute/CreateFromArray.c deleted file mode 100644 index 60251b95279..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/CreateFromArray.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/CreateFromArray.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:07 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_CreateFromArray - * - * This routine creates an NSSPKIXAttribute from specified components. - * This routine may return NULL upon error, in which case it will have - * created an error stack. If the optional arena argument is non-NULL, - * that arena will be used for the required memory. There must be at - * least one attribute value specified. The final argument must be - * NULL, to indicate the end of the set of attribute values. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -NSSPKIXAttribute_CreateFromArray -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - PRUint32 count, - NSSPKIXAttributeValue values[] -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttribute *)NULL; - } - - { - PRUint32 i; - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssItem_verifyPointer(&values[i]) ) { - return (NSSPKIXAttribute *)NULL; - } - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_CreateFromArray(arenaOpt, typeOid, count, values); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/Decode.c b/mozilla/security/nss/lib/pkix/src/Attribute/Decode.c deleted file mode 100644 index 03a26e8e273..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/Decode.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/Decode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:12 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Decode - * - * This routine creates an NSSPKIXAttribute by decoding a BER- - * or DER-encoded Attribute as defined in RFC 2459. This - * routine may return NULL upon error, in which case it will - * have created an error stack. If the optional arena argument - * is non-NULL, that arena will be used for the required memory. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_ITEM - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -NSSPKIXAttribute_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAttribute *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Decode(arenaOpt, ber); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/Destroy.c b/mozilla/security/nss/lib/pkix/src/Attribute/Destroy.c deleted file mode 100644 index 31bff295046..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/Destroy.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/Destroy.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:14 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Destroy - * - * This routine destroys an NSSPKIXAttribute. It should be called on - * all such objects created without an arena. It does not need to be - * called for objects created with an arena, but it may be. This - * routine returns a PRStatus value. Upon error, it will create an - * error stack and return PR_FAILURE. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_EXTERN PRStatus -NSSPKIXAttribute_Destroy -( - NSSPKIXAttribute *attribute -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Destroy(attribute); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/Duplicate.c b/mozilla/security/nss/lib/pkix/src/Attribute/Duplicate.c deleted file mode 100644 index 6f419e16b68..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/Duplicate.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/Duplicate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:16 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Duplicate - * - * This routine duplicates an NSSPKIXAttribute. {arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -NSSPKIXAttribute_Duplicate -( - NSSPKIXAttribute *attribute, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttribute *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Duplicate(attribute, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/Encode.c b/mozilla/security/nss/lib/pkix/src/Attribute/Encode.c deleted file mode 100644 index c0381741e38..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/Encode.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/Encode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:19 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Encode - * - * This routine returns an ASN.1 encoding of the specified - * NSSPKIXAttribute. {usual rules about itemOpt and arenaOpt} - * This routine indicates an error (NSS_ERROR_INVALID_DATA) - * if there are no attribute values (i.e., the last one was removed). - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_DATA - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXAttribute_Encode -( - NSSPKIXAttribute *attribute, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Encode(attribute, encoding, rvOpt, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/Equal.c b/mozilla/security/nss/lib/pkix/src/Attribute/Equal.c deleted file mode 100644 index 9577d3ca124..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/Equal.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/Equal.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:22 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Equal - * - * This routine compares two NSSPKIXAttribute's for equality. - * It returns PR_TRUE if they are equal, PR_FALSE otherwise. - * This routine also returns PR_FALSE upon error; if you're - * that worried about it, check for an error stack. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -NSSPKIXAttribute_Equal -( - NSSPKIXAttribute *one, - NSSPKIXAttribute *two, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(one) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(two) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Equal(one, two); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/FindValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/FindValue.c deleted file mode 100644 index e13bac0a719..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/FindValue.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/FindValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:28 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_FindValue - * - * This routine searches the set of attribute values in the specified - * NSSPKIXAttribute for the provided data. If an exact match is found, - * then that value's index is returned. If an exact match is not - * found, -1 is returned. If there is more than one exact match, one - * index will be returned. {notes about unorderdness of SET, etc} - * If the index may not be represented as an integer, an error is - * indicated. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NOT_FOUND - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value - * The index of the specified attribute value upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -NSSPKIXAttribute_FindValue -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue *value -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_FindValue(attribute, value); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/GetType.c b/mozilla/security/nss/lib/pkix/src/Attribute/GetType.c deleted file mode 100644 index d7b7650cee3..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/GetType.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/GetType.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:50 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_GetType - * - * This routine returns the attribute type oid of the specified - * NSSPKIXAttribute. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSPKIXAttributeType pointer upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttributeType * -NSSPKIXAttribute_GetType -( - NSSPKIXAttribute *attribute -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeType *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_GetType(attribute); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/GetValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/GetValue.c deleted file mode 100644 index a152ef1f613..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/GetValue.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/GetValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:53 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_GetValue - * - * This routine returns the i'th attribute value of the set of - * values in the specified NSSPKIXAttribute. Although the set - * is unordered, an arbitrary ordering will be maintained until - * the data in the attribute is changed. {usual comments about - * itemOpt and arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXAttributeValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -NSSPKIXAttribute_GetValue -( - NSSPKIXAttribute *attribute, - PRInt32 i, - NSSPKIXAttributeValue *itemOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_GetValue(attribute, i, itemOpt, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/GetValueCount.c b/mozilla/security/nss/lib/pkix/src/Attribute/GetValueCount.c deleted file mode 100644 index 9b9a1b7d457..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/GetValueCount.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/GetValueCount.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:57 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_GetValueCount - * - * This routine returns the number of attribute values present in - * the specified NSSPKIXAttribute. This routine returns a PRInt32. - * Upon error, this routine returns -1. This routine indicates an - * error if the number of values cannot be expressed as a PRInt32. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * Nonnegative integer upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -NSSPKIXAttribute_GetValueCount -( - NSSPKIXAttribute *attribute -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return -1; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_GetValueCount(attribute); -} - diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/GetValues.c b/mozilla/security/nss/lib/pkix/src/Attribute/GetValues.c deleted file mode 100644 index 0436f440d09..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/GetValues.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/GetValues.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:09:59 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_GetValues - * - * This routine returns all of the attribute values in the specified - * NSSPKIXAttribute. If the optional pointer to an array of NSSItems - * is non-null, then that array will be used and returned; otherwise, - * an array will be allocated and returned. If the limit is nonzero - * (which is must be if the specified array is nonnull), then an - * error is indicated if it is smaller than the value count. - * {arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * A valid pointer to an array of NSSItem's upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -NSSPKIXAttribute_GetValues -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue rvOpt[], - PRInt32 limit, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_GetValues(attribute, rvOpt, limit, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/MClear.c b/mozilla/security/nss/lib/pkix/src/Attribute/MClear.c deleted file mode 100644 index f89f1076996..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/MClear.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/MClear.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:03 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nss_pkix_Attribute_Clear - * - * Wipes out cached data. - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_Attribute_Clear -( - NSSPKIXAttribute *a -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSBER *)NULL != a->ber ) { - nss_ZFreeIf(a->ber->data); - nss_ZFreeIf(a->ber); - } - - if( (NSSDER *)NULL != a->der ) { - nss_ZFreeIf(a->der->data); - nss_ZFreeIf(a->der); - } - - return PR_SUCCESS; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/MCount.c b/mozilla/security/nss/lib/pkix/src/Attribute/MCount.c deleted file mode 100644 index c814fbeca50..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/MCount.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/MCount.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:04 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_Attribute_Count - * - * This module-private routine sets the valuesCount part of the - * NSSPKIXAttribute argument. It does no checking, and is intended - * only for use inside the NSSPKIXAttribute implementation itself. - * There is no error return. There is no return value. - */ - -NSS_IMPLEMENT void -nss_pkix_Attribute_Count -( - NSSPKIXAttribute *a -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((nssASN1Item **)NULL != a->asn1values); - if( (nssASN1Item *)NULL == a->asn1values ) { - nss_SetError(NSS_ERROR_ASSERTION_FAILED); - return; - } - - if( 0 == a->valuesCount ) { - PRUint32 i; - for( i = 0; i < 0xFFFFFFFF; i++ ) { - if( (nssASN1Item *)NULL == a->asn1values[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0xFFFFFFFF == i ) { - return; - } -#endif /* PEDANTIC */ - - a->valuesCount = i; - } - - return; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/MVCreate.c b/mozilla/security/nss/lib/pkix/src/Attribute/MVCreate.c deleted file mode 100644 index e0bd9759c83..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/MVCreate.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/MVCreate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:27 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_Attribute_V_Create - * - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_INTERNAL_ERROR; - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -nss_pkix_Attribute_V_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - PRUint32 count, - va_list ap -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttribute *rv = (NSSPKIXAttribute *)NULL; - PRStatus status; - PRUint32 i; - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAttribute); - if( (NSSPKIXAttribute *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - rv->type = typeOid; - { - NSSItem typeder; - NSSItem *x = nssOID_GetDEREncoding(rv->type, &typeder, arena); - if( (NSSItem *)NULL == x ) { - goto loser; - } - - rv->asn1type.size = typeder.size; - rv->asn1type.data = typeder.data; - } - - rv->valuesCount = count; - - rv->asn1values = nss_ZNEWARRAY(arena, nssASN1Item *, count); - if( (nssASN1Item **)NULL == rv->asn1values ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSItem tmp; - NSSPKIXAttributeValue *v = (NSSPKIXAttributeValue *) - va_arg(ap, NSSPKIXAttributeValue *); - - rv->asn1values[i] = nss_ZNEW(arena, nssASN1Item); - if( (nssASN1Item *)NULL == rv->asn1values[i] ) { - goto loser; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(v, arena, &tmp) ) { - goto loser; - } - - rv->asn1values[i].size = tmp.size; - rv->asn1values[i].data = tmp.data; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Attribute_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != - nssArena_registerDestructor(arena, - nss_pkix_Attribute_remove_pointer, - rv) ) { - (void)nss_pkix_Attribute_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAttribute *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PAddValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/PAddValue.c deleted file mode 100644 index 609ca269692..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PAddValue.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PAddValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:30 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_AddValue - * - * This routine adds the specified attribute value to the set in - * the specified NSSPKIXAttribute. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_AddValue -( - NSSPKIXAttribute *a, - NSSPKIXAttributeValue *value -) -{ - PRUint32 newcount; - nssASN1Item **new_asn1_items = (nssASN1Item **)NULL; - NSSItem tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((nssASN1Item **)NULL != a->asn1values); - if( (nssASN1Item **)NULL == a->asn1values ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - return PR_FAILURE; - } - - if( 0 == a->valuesCount ) { - PRUint32 i; - - for( i = 0; i < 0xFFFFFFFF; i++ ) { - if( (nssASN1Item *)NULL == a->asn1values[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0xFFFFFFFF == i ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - /* Internal error is that we don't handle them this big */ - return PR_FAILURE; - } -#endif /* PEDANTIC */ - - a->valuesCount = i; - } - - newcount = a->valuesCount + 1; - /* Check newcount for a rollover. */ - - /* Remember that our asn1values array is NULL-terminated */ - new_asn1_items = (nssASN1Item **)nss_ZRealloc(a->asn1values, - ((newcount+1) * sizeof(nssASN1Item *))); - if( (nssASN1Item **)NULL == new_asn1_items ) { - goto loser; - } - - new_asn1_items[ a->valuesCount ] = nss_ZNEW(a->arena, nssASN1Item); - if( (nssASN1Item *)NULL == new_asn1_items[ a->valuesCount ] ) { - goto loser; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(value, a->arena, &tmp) ) { - goto loser; - } - - new_asn1_items[ a->valuesCount ]->size = tmp.size; - new_asn1_items[ a->valuesCount ]->data = tmp.data; - - a->valuesCount++; - a->asn1values = new_asn1_items; - - return nss_pkix_Attribute_Clear(a); - - loser: - if( (nssASN1Item **)NULL != new_asn1_items ) { - nss_ZFreeIf(new_asn1_items[ newcount-1 ]); - /* We could realloc back down, but we actually know it's a no-op */ - a->asn1values = new_asn1_items; - } - - return PR_FAILURE; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PCreate.c b/mozilla/security/nss/lib/pkix/src/Attribute/PCreate.c deleted file mode 100644 index 1595580ab2d..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PCreate.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PCreate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:42 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_Create - * - * This routine creates an NSSPKIXAttribute from specified components. - * This routine may return NULL upon error, in which case it will have - * created an error stack. If the optional arena argument is non-NULL, - * that arena will be used for the required memory. There must be at - * least one attribute value specified. The final argument must be - * NULL, to indicate the end of the set of attribute values. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_INSUFFICIENT_VALUES - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_EXTERN NSSPKIXAttribute * -nssPKIXAttribute_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - NSSPKIXAttributeValue *value1, - ... -) -{ - va_list ap; - NSSPKIXAttribute *rv; - PRUint32 count; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttribute *)NULL; - } - - if( (NSSPKIXAttributeValue *)NULL == value1 ) { - nss_SetError(NSS_ERROR_INSUFFICIENT_VALUES); - return (NSSPKIXAttribute *)NULL; - } - - { - va_start(ap, typeOid); - - while( 1 ) { - NSSPKIXAttributeValue *v; - v = (NSSPKIXAttributeValue *)va_arg(ap, NSSPKIXAttributeValue *); - if( (NSSPKIXAttributeValue *)NULL == v ) { - break; - } - - if( PR_SUCCESS != nssItem_verifyPointer(v) ) { - va_end(ap); - return (NSSPKIXAttribute *)NULL; - } - } - - va_end(ap); - } -#endif /* NSSDEBUG */ - - va_start(ap, typeOid); - - for( count = 0; ; count++ ) { - NSSPKIXAttributeValue *v; - v = (NSSPKIXAttributeValue *)va_arg(ap, NSSPKIXAttributeValue *); - if( (NSSPKIXAttributeValue *)NULL == v ) { - break; - } - -#ifdef PEDANTIC - if( count == 0xFFFFFFFF ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - va_end(ap); - return (NSSPKIXAttribute *)NULL; - } -#endif /* PEDANTIC */ - } - - va_end(ap); - - va_start(ap, typeOid); - rv = nss_pkix_Attribute_V_Create(arenaOpt, typeOid, count, ap); - va_end(ap); - - return rv; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c b/mozilla/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c deleted file mode 100644 index 8a381c2ad43..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PCreateFromArray.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:45 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttribute_CreateFromArray - * - * This routine creates an NSSPKIXAttribute from specified components. - * This routine may return NULL upon error, in which case it will have - * created an error stack. If the optional arena argument is non-NULL, - * that arena will be used for the required memory. There must be at - * least one attribute value specified. The final argument must be - * NULL, to indicate the end of the set of attribute values. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -nssPKIXAttribute_CreateFromArray -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - PRUint32 count, - NSSPKIXAttributeValue values[] -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttribute *rv = (NSSPKIXAttribute *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttribute *)NULL; - } - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssItem_verifyPointer(&values[i]) ) { - return (NSSPKIXAttribute *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAttribute); - if( (NSSPKIXAttribute *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - rv->type = typeOid; - { - NSSItem typeder; - NSSItem *x = nssOID_GetDEREncoding(rv->type, &typeder, arena); - if( (NSSItem *)NULL == x ) { - goto loser; - } - - rv->asn1type.size = typeder.size; - rv->asn1type.data = typeder.data; - } - - rv->valuesCount = count; - - rv->asn1values = nss_ZNEWARRAY(arena, nssASN1Item *, count); - if( (nssASN1Item **)NULL == rv->asn1values ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSItem tmp; - NSSPKIXAttributeValue *v = &values[i]; - - rv->asn1values[i] = nss_ZNEW(arena, nssASN1Item); - if( (nssASN1Item *)NULL == rv->asn1values[i] ) { - goto loser; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(v, arena, &tmp) ) { - goto loser; - } - - rv->asn1values[i].size = tmp.size; - rv->asn1values[i].data = tmp.data; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Attribute_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != - nssArena_registerDestructor(arena, - nss_pkix_Attribute_remove_pointer, - rv) ) { - (void)nss_pkix_Attribute_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAttribute *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PDecode.c b/mozilla/security/nss/lib/pkix/src/Attribute/PDecode.c deleted file mode 100644 index b6752889f5d..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PDecode.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PDecode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:46 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttribute_Decode - * - * This routine creates an NSSPKIXAttribute by decoding a BER- - * or DER-encoded Attribute as defined in RFC 2459. This - * routine may return NULL upon error, in which case it will - * have created an error stack. If the optional arena argument - * is non-NULL, that arena will be used for the required memory. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_ITEM - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -nssPKIXAttribute_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttribute *rv = (NSSPKIXAttribute *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAttribute *)NULL; - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAttribute); - if( (NSSPKIXAttribute *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->ber = nssItem_Duplicate(ber, arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == rv->ber ) { - goto loser; - } - - status = nssASN1_DecodeBER(arena, rv, nssPKIXAttribute_template, ber); - if( PR_SUCCESS != status ) { - goto loser; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Attribute_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_Attribute_remove_pointer, rv) ) { - (void)nss_pkix_Attribute_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAttribute *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PDestroy.c b/mozilla/security/nss/lib/pkix/src/Attribute/PDestroy.c deleted file mode 100644 index c0db2f37f89..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PDestroy.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PDestroy.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:47 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_Destroy - * - * This routine destroys an NSSPKIXAttribute. It should be called on - * all such objects created without an arena. It does not need to be - * called for objects created with an arena, but it may be. This - * routine returns a PRStatus value. Upon error, it place an error on - * the error stack and return PR_FAILURE. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_Destroy -( - NSSPKIXAttribute *attribute -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - -#ifdef DEBUG - (void)nss_pkix_Attribute_remove_pointer(attribute); - (void)nssArena_RemoveDestructor(arena, nss_pkix_Attribute_remove_pointer, - attribute); -#endif /* DEBUG */ - - if( PR_TRUE == attribute->i_allocated_arena ) { - return nssArena_Destroy(attribute->arena); - } - - return PR_SUCCESS; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PDuplicate.c b/mozilla/security/nss/lib/pkix/src/Attribute/PDuplicate.c deleted file mode 100644 index 1d23e87b07c..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PDuplicate.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PDuplicate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:10:50 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_Duplicate - * - * This routine duplicates an NSSPKIXAttribute. {arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -nssPKIXAttribute_Duplicate -( - NSSPKIXAttribute *attribute, - NSSArena *arenaOpt -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttribute *rv = (NSSPKIXAttribute *)NULL; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return PR_FAILURE; - } - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAttribute); - if( (NSSPKIXAttribute *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - if( (NSSBER *)NULL != attribute->ber ) { - rv->ber = nssItem_Duplicate(arena, attribute->ber, (NSSItem *)NULL); - if( (NSSBER *)NULL == rv->ber ) { - goto loser; - } - } - - if( (NSSDER *)NULL != attribute->der ) { - rv->der = nssItem_Duplicate(arena, attribute->der, (NSSItem *)NULL); - if( (NSSDER *)NULL == rv->der ) { - goto loser; - } - } - - if( (void *)NULL != attribute->asn1type.data ) { - rv->asn1type.size = attribute->asn1type.size; - rv->asn1type.data = nss_ZAlloc(arena, attribute->asn1type.size); - if( (void *)NULL == rv->asn1type.data ) { - goto loser; - } - (void)nsslibc_memcpy(rv->asn1type.data, attribute->asn1type.data, - rv->asn1type.size); - } - - if( (nssASN1Item **)NULL != attribute->asn1values ) { - rv->asn1values = nss_ZNEWARRAY(arena, nssASN1Item *, attribute->valuesCount); - if( (nssASN1Item **)NULL == rv->asn1values ) { - goto loser; - } - - for( i = 0; i < attribute->valuesCount; i++ ) { - nssASN1Item *src; - nssASN1Item *dst; - - src = attribute->asn1values[i]; - dst = nss_ZNEW(arena, nssASN1Item); - if( (nssASN1Item *)NULL == dst ) { - goto loser; - } - - rv->asn1values[i] = dst; - - dst->size = src->size; - dst->data = nss_ZAlloc(arena, dst->size); - if( (void *)NULL == dst->data ) { - goto loser; - } - (void)nsslibc_memcpy(dst->data, src->data, src->size); - } - } - - rv->type = attribute->type; /* NULL or otherwise */ - rv->valuescount = attribute->valuesCount; - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Attribute_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != - nssArena_registerDestructor(arena, - nss_pkix_Attribute_remove_pointer, - rv) ) { - (void)nss_pkix_Attribute_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAttribute *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PEncode.c b/mozilla/security/nss/lib/pkix/src/Attribute/PEncode.c deleted file mode 100644 index cbaac4d9ceb..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PEncode.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PEncode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:11:03 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttribute_Encode - * - * This routine returns an ASN.1 encoding of the specified - * NSSPKIXAttribute. {usual rules about itemOpt and arenaOpt} - * This routine indicates an error (NSS_ERROR_INVALID_DATA) - * if there are no attribute values (i.e., the last one was removed). - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_DATA - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -nssPKIXAttribute_Encode -( - NSSPKIXAttribute *a, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - NSSBER *it; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* NSSDEBUG */ - - switch( encoding ) { - case NSSASN1BER: - if( (NSSBER *)NULL != a->ber ) { - it = a->ber; - goto done; - } - /*FALLTHROUGH*/ - case NSSASN1DER: - if( (NSSDER *)NULL != a->der ) { - it = a->der; - goto done; - } - break; - default: - nss_SetError(NSS_ERROR_UNSUPPORTED_ENCODING); - return (NSSBER *)NULL; - } - - it = nssASN1_EncodeItem(a->arena, (NSSItem *)NULL, a, - nssPKIXAttribute_template, encoding); - if( (NSSBER *)NULL == it ) { - return (NSSBER *)NULL; - } - - switch( encoding ) { - case NSSASN1BER: - a->ber = it; - break; - case NSSASN1DER: - a->der = it; - break; - default: - PR_ASSERT(0); - break; - } - - done: - return nssItem_Duplicate(it, arenaOpt, rvOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PEqual.c b/mozilla/security/nss/lib/pkix/src/Attribute/PEqual.c deleted file mode 100644 index 7f94ae311ea..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PEqual.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PEqual.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:11:07 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_Equal - * - * This routine compares two NSSPKIXAttribute's for equality. - * It returns PR_TRUE if they are equal, PR_FALSE otherwise. - * This routine also returns PR_FALSE upon error; if you're - * that worried about it, check for an error stack. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -nssPKIXAttribute_Equal -( - NSSPKIXAttribute *one, - NSSPKIXAttribute *two, - PRStatus *statusOpt -) -{ - PRStatus dummyStatus = PR_SUCCESS; /* quiet warnings */ - PRStatus *status; - PRUint32 i; - - if( (PRStatus *)NULL != statusOpt ) { - status = statusOpt; - *status = PR_SUCCESS; - } else { - status = &dummyStatus; - } - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(one) ) { - *status = PR_FAILURE; - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(two) ) { - *status = PR_FAILURE; - return PR_FALSE; - } -#endif /* NSSDEBUG */ - - if( ((NSSDER *)NULL != one->der) && ((NSSDER *)NULL != two->der) ) { - return nssItem_Equal(one->der, two->der, statusOpt); - } - - if( (NSSPKIXAttributeType *)NULL == one->type ) { - NSSItem berOid; - berOid.size = one->asn1type.size; - berOid.data = one->asn1type.data; - one->type = (NSSPKIXAttributeType *)NSSOID_CreateFromBER(&berOid); - } - - if( (NSSPKIXAttributeType *)NULL == two->type ) { - NSSItem berOid; - berOid.size = two->asn1type.size; - berOid.data = two->asn1type.data; - two->type = (NSSPKIXAttributeType *)NSSOID_CreateFromBER(&berOid); - } - - if( one->type != two->type ) { - return PR_FALSE; - } - - if( 0 == one->valuesCount ) { - nss_pkix_Attribute_Count(one); - } - -#ifdef PEDANTIC - if( 0 == one->valuesCount ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - *statusOpt = PR_FAILURE; - return PR_FALSE; - } -#endif /* PEDANTIC */ - - if( 0 == two->valuesCount ) { - nss_pkix_Attribute_Count(two); - } - -#ifdef PEDANTIC - if( 0 == two->valuesCount ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - *statusOpt = PR_FAILURE; - return PR_FALSE; - } -#endif /* PEDANTIC */ - - if( one->valuesCount != two->valuesCount ) { - return PR_FALSE; - } - - *status = nss_pkix_Attribute_Distinguish(one); - if( PR_FAILURE == *status ) { - return PR_FALSE; - } - - *status = nss_pkix_Attribute_Distinguish(two); - if( PR_FAILURE == *status ) { - return PR_FALSE; - } - - for( i == 0; i < one->valuesCount; i++ ) { - NSSItem onetmp, twotmp; - - onetmp.size = one->asn1values[i]->size; - onetmp.data = one->asn1values[i]->data; - twotmp.size = two->asn1values[i]->size; - twotmp.data = two->asn1values[i]->data; - - if( PR_FALSE == nssItem_Equal(&one, &two, statusOpt) ) { - return PR_FALSE; - } - } - - return PR_TRUE; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PFindValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/PFindValue.c deleted file mode 100644 index 7e77b29466a..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PFindValue.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PFindValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:11:09 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_FindValue - * - * This routine searches the set of attribute values in the specified - * NSSPKIXAttribute for the provided data. If an exact match is found, - * then that value's index is returned. If an exact match is not - * found, -1 is returned. If there is more than one exact match, one - * index will be returned. {notes about unorderdness of SET, etc} - * If the index may not be represented as an integer, an error is - * indicated. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NOT_FOUND - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value - * The index of the specified attribute value upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -nssPKIXAttribute_FindValue -( - NSSPKIXAttribute *a, - NSSPKIXAttributeValue *attributeValue -) -{ - PRUint32 i; - nssASN1Item **a; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((nssASN1Item **)NULL != a->asn1values); - if( (nssASN1Item **)NULL == a->asn1values ) { - nss_SetError(NSS_ERROR_ASSERTION_FAILED); - return -1; - } - - for( i = 0, a = &a->asn1values[0]; *a; a++, (i > 0x7fffffff) || i++ ) { - NSSItem tmp; - - tmp.size = (*a)->size; - tmp.data = (*a)->data; - - if( PR_TRUE == nssItem_Equal(attributeValue, &tmp, (PRStatus *)NULL) ) { - if( i > 0x7fffffff ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } - return (PRInt32)i; - } - } - - nss_SetError(NSS_ERROR_NOT_FOUND); - return -1; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PGetType.c b/mozilla/security/nss/lib/pkix/src/Attribute/PGetType.c deleted file mode 100644 index ea108fdb702..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PGetType.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PGetType.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:11:24 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_GetType - * - * This routine returns the attribute type oid of the specified - * NSSPKIXAttribute. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSPKIXAttributeType pointer upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttributeType * -nssPKIXAttribute_GetType -( - NSSPKIXAttribute *a -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return (NSSPKIXAttributeType *)NULL; - } -#endif /* NSSDEBUG */ - - if( (NSSPKIXAttributeType *)NULL == a->type ) { - NSSItem ber; - - ber.size = a->asn1type.size; - ber.data = a->asn1type.data; - - a->type = (NSSPKIXAttributeType *)NSSOID_CreateFromBER(&ber); - } - - return a->type; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PGetValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/PGetValue.c deleted file mode 100644 index 027c083a55d..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PGetValue.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PGetValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:11:48 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_GetValue - * - * This routine returns the i'th attribute value of the set of - * values in the specified NSSPKIXAttribute. Although the set - * is unordered, an arbitrary ordering will be maintained until - * the data in the attribute is changed. {usual comments about - * itemOpt and arenaOpt} [0,valueCount) - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXAttributeValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -nssPKIXAttribute_GetValue -( - NSSPKIXAttribute *attribute, - PRInt32 i, - NSSPKIXAttributeValue *itemOpt, - NSSArena *arenaOpt -) -{ - NSSItem tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( 0 == attribute->valuesCount ) { - nss_pkix_Attribute_Count(attribute); - } - - if( (i < 0) || (i >= attribute->valuesCount) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXAttributeValue *)NULL; - } - - tmp.size = attribute->asn1values[i]->size; - tmp.data = attribute->asn1values[i]->data; - - return nssItem_Duplicate(&tmp, arenaOpt, itemOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PGetValueCount.c b/mozilla/security/nss/lib/pkix/src/Attribute/PGetValueCount.c deleted file mode 100644 index cdba7cc31c8..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PGetValueCount.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PGetValueCount.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:06 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_GetValueCount - * - * This routine returns the number of attribute values present in - * the specified NSSPKIXAttribute. This routine returns a PRInt32. - * Upon error, this routine returns -1. This routine indicates an - * error if the number of values cannot be expressed as a PRInt32. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * Nonnegative integer upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -nssPKIXAttribute_GetValueCount -( - NSSPKIXAttribute *attribute -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return -1; - } -#endif /* NSSDEBUG */ - - if( 0 == attribute->valuesCount ) { - nss_pkix_Attribute_Count(attribute); - } - -#ifdef PEDANTIC - if( 0 == attribute->valuesCount ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } -#endif /* PEDANTIC */ - - if( attribute->valuesCount > 0x7fffffff ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } - - return (PRInt32)(attribute->valuesCount); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PGetValues.c b/mozilla/security/nss/lib/pkix/src/Attribute/PGetValues.c deleted file mode 100644 index 3162aa58fb5..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PGetValues.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PGetValues.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:11 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_GetValues - * - * This routine returns all of the attribute values in the specified - * NSSPKIXAttribute. If the optional pointer to an array of NSSItems - * is non-null, then that array will be used and returned; otherwise, - * an array will be allocated and returned. If the limit is nonzero - * (which is must be if the specified array is nonnull), then an - * error is indicated if it is smaller than the value count. - * {arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * A valid pointer to an array of NSSItem's upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -nssPKIXAttribute_GetValues -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue rvOpt[], - PRInt32 limit, - NSSArena *arenaOpt -) -{ - NSSPKIXAttributeValue *rv = (NSSPKIXAttributeValue *)NULL; - PRUint32 i; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( 0 == attribute->valuesCount ) { - nss_pkix_Attribute_Count(attribute); - } - -#ifdef PEDANTIC - if( 0 == attribute->valuesCount ) { - if( 0 == limit ) { - nss_SetError(NSS_ERROR_NO_MEMORY); - } else { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - } - return (NSSPKIXAttributeValue *)NULL; - } -#endif /* PEDANTIC */ - - if( (limit < attribute->valuesCount) && - !((0 == limit) && ((NSSPKIXAttributeValue *)NULL == rvOpt)) ) { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - return (NSSPKIXAttributeValue *)NULL; - } - - limit = attribute->valuesCount; - if( (NSSPKIXAttributeValue *)NULL == rvOpt ) { - rv = nss_ZNEWARRAY(arenaOpt, NSSPKIXAttributeValue, limit); - if( (NSSPKIXAttributeValue *)NULL == rv ) { - return (NSSPKIXAttributeValue *)NULL; - } - } else { - rv = rvOpt; - } - - for( i = 0; i < limit; i++ ) { - NSSAttributeValue tmp; - nssASN1Item *p = attribute->asn1values[i]; - NSSAttributeValue *r = &rv[i]; - - tmp.size = p->size; - tmp.data = p->data; - - if( (NSSItem *)NULL == nssItem_Duplicate(&tmp, arenaOpt, r) ) { - goto loser; - } - } - - return rv; - - loser: - for( i = 0; i < limit; i++ ) { - NSSAttributeValue *r = &rv[i]; - nss_ZFreeIf(r->data); - } - - if( rv != rvOpt ) { - nss_ZFreeIf(rv); - } - - return (NSSAttributeValue *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PRemoveValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/PRemoveValue.c deleted file mode 100644 index 92807bbbf50..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PRemoveValue.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PRemoveValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:17 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_RemoveValue - * - * This routine removes the i'th attribute value of the set in the - * specified NSSPKIXAttribute. An attempt to remove the last value - * will fail. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_AT_MINIMUM - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -PR_IMPLEMENET(PRStatus) -nssPKIXAttribute_RemoveValue -( - NSSPKIXAttribute *a, - PRInt32 i -) -{ - nssASN1Item **ip; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( 0 == a->valuesCount ) { - nss_pkix_Attribute_Count(a); - } - - if( i < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - if( 1 == a->valuesCount ) { - nss_SetError(NSS_ERROR_AT_MINIMUM); - return PR_FAILURE; - } - -#ifdef PEDANTIC - if( 0 == a->valuesCount ) { - /* Too big.. but we can still remove one */ - nss_ZFreeIf(a->asn1values[i].data); - for( ip = &a->asn1values[i]; *ip; ip++ ) { - ip[0] = ip[1]; - } - } else -#endif /* PEDANTIC */ - - { - nssASN1Item *si; - PRUint32 end; - - if( i >= a->valueCount ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - end = a->valuesCount - 1; - - si = a->asn1values[i]; - a->asn1values[i] = a->asn1values[ end ]; - a->asn1values[ end ] = (nssASN1Item *)NULL; - - nss_ZFreeIf(si->data); - nss_ZFreeIf(si); - - /* We could realloc down, but we know it's a no-op */ - a->valuesCount = end; - } - - return nss_pkix_Attribute_Clear(a); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PSetType.c b/mozilla/security/nss/lib/pkix/src/Attribute/PSetType.c deleted file mode 100644 index c89c4fadffb..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PSetType.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PSetType.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:19 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_SetType - * - * This routine sets the attribute type oid of the indicated - * NSSPKIXAttribute to the specified value. Since attributes - * may be application-defined, no checking can be done on - * either the correctness of the attribute type oid value nor - * the suitability of the set of attribute values. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_OID - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_SetType -( - NSSPKIXAttribute *a, - NSSPKIXAttributeType *attributeType -) -{ - NSSDER tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssOID_verifyPointer(attributeType) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - a->type = attributeType; - - nss_ZFreeIf(a->asn1type.data); - if( (NSSDER *)NULL == nssOID_GetDEREncoding(a->type, &tmp, a->arena) ) { - return PR_FAILURE; - } - - a->asn1type.size = tmp.size; - a->asn1type.data = tmp.data; - - return nss_pkix_Attribute_Clear(a); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PSetValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/PSetValue.c deleted file mode 100644 index 1989d25f124..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PSetValue.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PSetValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:25 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_SetValue - * - * This routine sets the i'th attribute value {blah blah; copies - * memory contents over..} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_SetValue -( - NSSPKIXAttribute *a, - PRInt32 i, - NSSPKIXAttributeValue *value -) -{ - NSSItem tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( i < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - if( 0 == a->valuesCount ) { - nss_pkix_Attribute_Count(a); - } - - if( (0 != a->valuesCount) && (i > a->valuesCount) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(value, a->arena, &tmp) ) { - return PR_FAILURE; - } - - nss_ZFreeIf(a->asn1values[i]->data); - a->asn1values[i]->size = tmp.size; - a->asn1values[i]->data = tmp.data; - - return nss_pkix_Attribute_Clear(a); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/PSetValues.c b/mozilla/security/nss/lib/pkix/src/Attribute/PSetValues.c deleted file mode 100644 index 40c9a732b74..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/PSetValues.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/PSetValues.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:32 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_SetValues - * - * This routine sets all of the values of the specified - * NSSPKIXAttribute to the values in the specified NSSItem array. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_POINTER - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_SetValues -( - NSSPKIXAttribute *a, - NSSPKIXAttributeValue values[], - PRInt32 count -) -{ - nssASN1Item **ip; - nssASN1Item *newarray; - PRUint32 i; - nssArenaMark *mark; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( (NSSPKIXAttributeValue *)NULL == values ) { - nss_SetError(NSS_ERROR_INVALID_POINTER); - return PR_FAILURE; - } - - if( count < 1 ) { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((nssASN1Item **)NULL != a->asn1values); - if( (nssASN1Item **)NULL == a->asn1values ) { - nss_SetError(NSS_ERROR_ASSERTION_FAILED); - return PR_FAILURE; - } - - mark = nssArena_Mark(a->arena); - if( (nssArenaMark *)NULL == mark ) { - return PR_FAILURE; - } - - newarray = nss_ZNEWARRAY(a->arena, nssASN1Item *, count); - if( (nssASN1Item *)NULL == newarray ) { - return PR_FAILURE; - } - - for( i = 0; i < count; i++ ) { - NSSItem tmp; - - newarray[i] = nss_ZNEW(a->arena, nssASN1Item); - if( (nssASN1Item *)NULL == newarray[i] ) { - goto loser; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(&values[i], a->arena, &tmp) ) { - goto loser; - } - - newarray[i]->size = tmp.size; - newarray[i]->data = tmp.data; - } - - for( ip = &a->asn1values[0]; *ip; ip++ ) { - nss_ZFreeIf((*ip)->data); - nss_ZFreeIf(*ip); - } - - nss_ZFreeIf(a->asn1values); - - a->asn1values = newarray; - a->valuesCount = count; - - (void)nss_pkix_Attribute_Clear(a); - return nssArena_Unmark(a->arena, mark); - - loser: - (void)nssArena_Release(a->arena, mark); - return PR_FAILURE; -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/RemoveValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/RemoveValue.c deleted file mode 100644 index b4027cbeda5..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/RemoveValue.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/RemoveValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:36 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_RemoveValue - * - * This routine removes the i'th attribute value of the set in the - * specified NSSPKIXAttribute. An attempt to remove the last value - * will fail. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_AT_MINIMUM - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_RemoveValue -( - NSSPKIXAttribute *attribute, - PRInt32 i -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_RemoveValue(attribute, i); -} - diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/SetType.c b/mozilla/security/nss/lib/pkix/src/Attribute/SetType.c deleted file mode 100644 index 1e30fc97369..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/SetType.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/SetType.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:42 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_SetType - * - * This routine sets the attribute type oid of the indicated - * NSSPKIXAttribute to the specified value. Since attributes - * may be application-defined, no checking can be done on - * either the correctness of the attribute type oid value nor - * the suitability of the set of attribute values. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_OID - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_SetType -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeType *attributeType -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssOID_verifyPointer(attributeType) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_SetType(attribute, attributeType); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/SetValue.c b/mozilla/security/nss/lib/pkix/src/Attribute/SetValue.c deleted file mode 100644 index 24875ab76e4..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/SetValue.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/SetValue.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:47 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_SetValue - * - * This routine sets the i'th attribute value {blah blah; copies - * memory contents over..} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_SetValue -( - NSSPKIXAttribute *attribute, - PRInt32 i, - NSSPKIXAttributeValue *value -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_SetValue(attribute, i, value); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/SetValues.c b/mozilla/security/nss/lib/pkix/src/Attribute/SetValues.c deleted file mode 100644 index 5c353b156aa..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/SetValues.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/SetValues.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:51 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_SetValues - * - * This routine sets all of the values of the specified - * NSSPKIXAttribute to the values in the specified NSSItem array. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_POINTER - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_SetValues -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue values[], - PRInt32 count -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( (NSSPKIXAttributeValue *)NULL == values ) { - nss_SetError(NSS_ERROR_INVALID_POINTER); - return PR_FAILURE; - } - - if( count < 1 ) { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKXIAttribute_SetValues(attribute, values, count); -} diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/template.c b/mozilla/security/nss/lib/pkix/src/Attribute/template.c deleted file mode 100644 index a46c388f319..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/template.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/template.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:53 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttribute_template - * - * - */ - -const nssASN1Template nssPKIXAttribute_template[] = { - { nssASN1_SEQUENCE, 0, NULL, sizeof(NSSPKIXAttribute) }, - { nssASN1_OBJECT_ID, offsetof(NSSPKIXAttribute, asn1type) }, - { nssASN1_SET_OF, offsetof(NSSPKIXAttribute, asn1values), - nssASN1Template_Any }, - { 0 } -}; diff --git a/mozilla/security/nss/lib/pkix/src/Attribute/verifyPointer.c b/mozilla/security/nss/lib/pkix/src/Attribute/verifyPointer.c deleted file mode 100644 index 5f97771b5fc..00000000000 --- a/mozilla/security/nss/lib/pkix/src/Attribute/verifyPointer.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/Attribute/Attic/verifyPointer.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:12:56 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -#ifdef DEBUG - -extern const NSSError NSS_ERROR_INTERNAL_ERROR; - -static nssPointerTracker pkix_attribute_pointer_tracker; - -/* - * nss_pkix_Attribute_add_pointer - * - * This method is only present in debug builds. - * - * This module-private routine adds an NSSPKIXAttribute pointer to - * the internal pointer-tracker. This routine should only be used - * by the NSSPKIX module. This routine returns a PRStatus value; - * upon error it will place an error on the error stack and return - * PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INTERNAL_ERROR - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_Attribute_add_pointer -( - const NSSPKIXAttribute *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_attribute_pointer_tracker); - if( PR_SUCCESS != rv ) { - return rv; - } - - rv = nssPointerTracker_add(&pkix_attribute_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - NSSError e = NSS_GetError(); - if( NSS_ERROR_NO_MEMORY != e ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - return rv; - } - - return PR_SUCCESS; -} - -/* - * nss_pkix_Attribute_remove_pointer - * - * This method is only present in debug builds. - * - * This module-private routine removes a valid NSSPKIXAttribute - * pointer from the internal pointer-tracker. This routine should - * only be used by the NSSPKIX module. This routine returns a - * PRStatus value; upon error it will place an error on the error - * stack and return PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_INTERNAL_ERROR - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_Attribute_remove_pointer -( - const NSSPKIXAttribute *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_remove(&pkix_attribute_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - return rv; -} - -/* - * nssPKIXAttribute_verifyPointer - * - * This method is only present in debug builds. - * - * If the specified pointer is a valid pointer to an NSSPKIXAttribute - * object, this routine will return PR_SUCCESS. Otherwise, it will - * put an error on the error stack and return PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_SUCCESS if the pointer is valid - * PR_FAILURE if it isn't - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_verifyPointer -( - NSSPKIXAttribute *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_attribute_pointer_tracker); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - rv = nssPointerTracker_verify(&pkix_attribute_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - return PR_SUCCESS; -} - -#endif /* DEBUG */ - diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/CreateFromUTF8.c b/mozilla/security/nss/lib/pkix/src/X520Name/CreateFromUTF8.c deleted file mode 100644 index 4bfae6e7c4b..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/CreateFromUTF8.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/CreateFromUTF8.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:37 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXX520Name_CreateFromUTF8 - * - * { basically just enforces the length limit } - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_STRING - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXX520Name upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXX520Name * -NSSPKIXX520Name_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *utf8 -) -{ - PRStatus status = PR_SUCCESS; - PRUint32 length; - nss_ClearErrorStack(); - - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXX520Name *)NULL; - } - } - - if( (NSSUTF8 *)NULL == utf8 ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXX520Name *)NULL; - } -#endif /* DEBUG */ - - length = nssUTF8_Length(utf8, &status); - if( PR_SUCCESS != status ) { - if( NSS_ERROR_VALUE_TOO_LARGE == NSS_GetError() ) { - nss_SetError(NSS_ERROR_STRING_TOO_LONG); - } - return (NSSPKIXX520Name *)NULL; - } - - if( (length < 1 ) || (length > NSSPKIXX520Name_MAXIMUM_LENGTH) ) { - nss_SetError(NSS_ERROR_STRING_TOO_LONG); - } - - return nssPKIXX520Name_CreateFromUTF8(arenaOpt, utf8); -} - -/* - * NSSPKIXX520Name_MAXIMUM_LENGTH - * - * From RFC 2459: - * - * ub-name INTEGER ::= 32768 - */ - -const PRUint32 NSSPKIXX520Name_MAXIMUM_LENGTH = 32768; diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/Decode.c b/mozilla/security/nss/lib/pkix/src/X520Name/Decode.c deleted file mode 100644 index 25fbe349fbc..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/Decode.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/Decode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:37 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXX520Name_Decode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXX520Name upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXX520Name * -NSSPKIXX520Name_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAttribute *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXX520Name_Decode(arenaOpt, ber); -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/Destroy.c b/mozilla/security/nss/lib/pkix/src/X520Name/Destroy.c deleted file mode 100644 index bf600ab823c..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/Destroy.c +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/Destroy.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:37 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXX520Name_Destroy - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT NSSDER * -NSSPKIXX520Name_Destroy -( - NSSPKIXX520Name *name -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return (NSSDER *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXX520Name_Destroy(name); -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/Duplicate.c b/mozilla/security/nss/lib/pkix/src/X520Name/Duplicate.c deleted file mode 100644 index 49a9c997879..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/Duplicate.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/Duplicate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:37 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXX520Name_Duplicate - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXX520Name upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXX520Name * -NSSPKIXX520Name_Duplicate -( - NSSPKIXX520Name *name, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return (NSSPKIXAttribute *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXX520Name_Duplicate(name, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/Encode.c b/mozilla/security/nss/lib/pkix/src/X520Name/Encode.c deleted file mode 100644 index 3595d24f982..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/Encode.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/Encode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:37 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXX520Name_Encode - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXX520Name_Encode -( - NSSPKIXX520Name *name, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXX520Name_Encode(name, encoding, rvOpt, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/Equal.c b/mozilla/security/nss/lib/pkix/src/X520Name/Equal.c deleted file mode 100644 index 6091b11a847..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/Equal.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/Equal.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:37 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXX520Name_Equal - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -NSSPKIXX520Name_Equal -( - NSSPKIXX520Name *name1, - NSSPKIXX520Name *name2, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name1) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name2) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIXX520Name_Equal(name1, name2, statusOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/GetUTF8Encoding.c b/mozilla/security/nss/lib/pkix/src/X520Name/GetUTF8Encoding.c deleted file mode 100644 index 945a65b49c3..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/GetUTF8Encoding.c +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/GetUTF8Encoding.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:38 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXX520Name_GetUTF8Encoding - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSDER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -NSSPKIXX520Name_GetUTF8Encoding -( - NSSPKIXX520Name *name, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXX520Name_GetUTF8Encoding(name, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/MDoUTF8.c b/mozilla/security/nss/lib/pkix/src/X520Name/MDoUTF8.c deleted file mode 100644 index 8dbd6cec309..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/MDoUTF8.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/MDoUTF8.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:38 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_X520Name_DoUTF8 - * - */ - -NSS_IMPLEMENT PR_STATUS -nss_pkix_X520Name_DoUTF8 -( - NSSPKIXX520Name *name -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSUTF8 *)NULL == name->utf8 ) { - PRUint8 tag = (*(PRUint8 *)name->string.data) & nssASN1_TAG_MASK; - nssStringType type; - void *data = (void *)&((PRUint8 *)name->string.data)[1]; - PRUint32 size = name->string.size-1; - - switch( tag ) { - case nssASN1_TELETEX_STRING: - type = nssStringType_TeletexString; - break; - case nssASN1_PRINTABLE_STRING: - type = nssStringType_PrintableString; - break; - case nssASN1_UNIVERSAL_STRING: - type = nssStringType_UniversalString; - break; - case nssASN1_BMP_STRING: - type = nssStringType_BMPString; - break; - case nssASN1_UTF8_STRING: - type = nssStringType_UTF8String; - break; - default: - nss_SetError(NSS_ERROR_INVALID_BER); - return PR_FAILURE; - } - - name->utf8 = nssUTF8_Create(arenaOpt, type, data, size); - if( (NSSUTF8 *)NULL == name->utf8 ) { - return PR_FAILURE; - } - - if( nssASN1_PRINTABLE_STRING == tag ) { - name->wasPrintable = PR_TRUE; - } - } - - return PR_SUCCESS; -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/PCreate.c b/mozilla/security/nss/lib/pkix/src/X520Name/PCreate.c deleted file mode 100644 index ceaa827d4e8..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/PCreate.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/PCreate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:38 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXX520Name_Create - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_STRING_TYPE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXX520Name upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXX520Name * -nssPKIXX520Name_Create -( - NSSArena *arenaOpt, - nssStringType type, - NSSItem *data -) -{ - NSSPKIXX520Name *rv = (NSSPKIXX520Name *)NULL; - nssArenaMark *mark = (nssArenaMark *)NULL; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXX520Name *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(data) ) { - return (NSSPKIXX520Name *)NULL; - } -#endif /* NSSDEBUG */ - - switch( type ) { - case nssStringType_TeletexString: - case nssStringType_PrintableString: - case nssStringType_UniversalString: - case nssStringType_UTF8String: - case nssStringType_BMPString: - break; - default: - nss_SetError(NSS_ERROR_INVALID_STRING_TYPE); - goto loser; - } - - if( (NSSArena *)NULL != arenaOpt ) { - mark = nssArena_Mark(arenaOpt); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arenaOpt, NSSPKIXX520Name); - if( (NSSPKIXX520Name *)NULL == rv ) { - goto loser; - } - - rv->utf8 = nssUTF8_Create(arenaOpt, type, data->data, data->size); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - - if( nssStringType_PrintableString == type ) { - rv->wasPrintable = PR_TRUE; - } - - rv->der = nssUTF8_GetDEREncoding(arenaOpt, type, rv->utf8); - if( (NSSDER *)NULL == rv->der ) { - goto loser; - } - - rv->string.size = rv->der->size; - rv->string.data = nss_ZAlloc(arenaOpt, rv->string.size); - if( (void *)NULL == rv->string.data ) { - goto loser; - } - - (void)nsslibc_memcpy(rv->string.data, rv->der->data, rv->string.size); - - if( (NSSArena *)NULL != arenaOpt ) { - rv->inArena = PR_TRUE; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arenaOpt, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_X520Name_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_X520Name_remove_pointer, rv) ) { - (void)nss_pkix_X520Name_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arenaOpt, mark); - } - - if( (NSSArena *)NULL == arenaOpt ) { - if( (NSSPKIXX520Name *)NULL != rv ) { - if( (NSSDER *)NULL != rv->der ) { - nss_ZFreeIf(rv->der->data); - nss_ZFreeIf(rv->der); - } - - nss_ZFreeIf(rv->string.data); - nss_ZFreeIf(rv->utf8); - nss_ZFreeIf(rv); - } - } - - return (NSSPKIXX520Name *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/PCreateFromUTF8.c b/mozilla/security/nss/lib/pkix/src/X520Name/PCreateFromUTF8.c deleted file mode 100644 index 3f3008ee4c1..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/PCreateFromUTF8.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/PCreateFromUTF8.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:38 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXX520Name_CreateFromUTF8 - * - * { basically just enforces the length limit } - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXX520Name upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXX520Name * -nssPKIXX520Name_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *utf8 -) -{ - NSSPKIXX520Name *rv = (NSSPKIXX520Name *)NULL; - nssArenaMark *mark = (nssArenaMark *)NULL; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXX520Name *)NULL; - } - } - - if( (NSSUTF8 *)NULL == utf8 ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXX520Name *)NULL; - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL != arenaOpt ) { - mark = nssArena_Mark(arenaOpt); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arenaOpt, NSSPKIXX520Name); - if( (NSSPKIXX520Name *)NULL == rv ) { - goto loser; - } - - rv->utf8 = nssUTF8_Duplicate(utf8, arenaOpt); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - - /* - * RFC 2459 states (s. 4.1.2.4) that certificates issued after - * 2003-12-31 MUST encode strings as UTF8Strings, and until - * then they may be encoded as PrintableStrings, BMPStrings, - * or UTF8Strings (when the character sets allow). However, it - * specifically notes that even before 2003-12-31, strings may - * be encoded as UTF8Strings. So unless something important - * breaks, I'll do UTF8Strings. - */ - - rv->der = nssUTF8_GetDEREncoding(arenaOpt, nssStringType_UTF8String, - utf8); - if( (NSSDER *)NULL == rv->der ) { - goto loser; - } - - rv->string.size = rv->der->size; - rv->string.data = nss_ZAlloc(arenaOpt, rv->string.size); - if( (void *)NULL == rv->string.data ) { - goto loser; - } - - (void)nsslibc_memcpy(rv->string.data, rv->der->size, rv->string.size); - - if( (NSSArena *)NULL != arenaOpt ) { - rv->inArena = PR_TRUE; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arenaOpt, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_X520Name_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_X520Name_remove_pointer, rv) ) { - (void)nss_pkix_X520Name_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arenaOpt, mark); - } - - if( (NSSArena *)NULL == arenaOpt ) { - if( (NSSPKIXX520Name *)NULL != rv ) { - if( (NSSDER *)NULL != rv->der ) { - nss_ZFreeIf(rv->der->data); - nss_ZFreeIf(rv->der); - } - - nss_ZFreeIf(rv->string.data); - nss_ZFreeIf(rv->utf8); - nss_ZFreeIf(rv); - } - } - - return (NSSPKIXX520Name *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/PDecode.c b/mozilla/security/nss/lib/pkix/src/X520Name/PDecode.c deleted file mode 100644 index f312213b0be..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/PDecode.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/PDecode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:39 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXX520Name_Decode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXX520Name upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXX520Name * -nssPKIXX520Name_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSPKIXX520Name *rv = (NSSPKIXX520Name *)NULL; - nssArenaMark *mark = (nssArenaMark *)NULL; - PRStatus status; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAttribute *)NULL; - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL != arenaOpt ) { - mark = nssArena_Mark(arenaOpt); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arenaOpt, NSSPKIXX520Name); - if( (NSSPKIXX520Name *)NULL == rv ) { - goto loser; - } - - status = nssASN1_DecodeBER(arenaOpt, rv, nssPKIXX520_template, ber); - if( PR_SUCCESS != status ) { - goto loser; - } - - if( (NSSArena *)NULL != arenaOpt ) { - rv->inArena = PR_TRUE; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arenaOpt, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_X520Name_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_X520Name_remove_pointer, rv) ) { - (void)nss_pkix_X520Name_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arenaOpt, mark); - } - - if( (NSSArena *)NULL == arenaOpt ) { - if( (NSSPKIXX520Name *)NULL != rv ) { - nss_ZFreeIf(rv->string.data); - nss_ZFreeIf(rv->utf8); - nss_ZFreeIf(rv); - } - } - - return (NSSPKIXX520Name *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/PDestroy.c b/mozilla/security/nss/lib/pkix/src/X520Name/PDestroy.c deleted file mode 100644 index 96c7b3e36e9..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/PDestroy.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/PDestroy.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:39 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXX520Name_Destroy - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_EXTERN NSSDER * -nssPKIXX520Name_Destroy -( - NSSPKIXX520Name *name -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( PR_TRUE != name->inArena ) { - /* - * Note that inArena is merely a hint. If this object was - * created passively, this flag will be NULL no matter if - * it was in an arena or not. However, you may safely - * (try to) free memory in an NSSArena, so this isn't a - * problem. - */ - - if( (NSSDER *)NULL != name->der ) { - nss_ZFreeIf(name->der->data); - nss_ZFreeIf(name->der); - } - - nss_ZFreeIf(name->utf8); - nss_ZFreeIf(name->string.data); - nss_ZFreeIf(name); - } - - return PR_SUCCESS; -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/PDuplicate.c b/mozilla/security/nss/lib/pkix/src/X520Name/PDuplicate.c deleted file mode 100644 index 2958eb0538d..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/PDuplicate.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/PDuplicate.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:39 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXX520Name_Duplicate - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXX520Name upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXX520Name * -nssPKIXX520Name_Duplicate -( - NSSPKIXX520Name *name, - NSSArena *arenaOpt -) -{ - NSSPKIXX520Name *rv = (NSSPKIXX520Name *)NULL; - nssArenaMark *mark = (nssArenaMark *)NULL; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return (NSSPKIXAttribute *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL != arenaOpt ) { - mark = nssArena_Mark(arenaOpt); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arenaOpt, NSSPKIXX520Name); - if( (NSSPKIXX520Name *)NULL == rv ) { - goto loser; - } - - rv->string.size = name->string.size; - rv->string.data = nss_ZAlloc(arenaOpt, name->string.size); - if( (void *)NULL == rv->string.data ) { - goto loser; - } - - (void)nsslibc_memcpy(rv->string.data, name->string.data, name->string.size); - - if( (NSSUTF8 *)NULL != name->utf8 ) { - rv->utf8 = nssUTF8_Duplicate(name->utf8, arenaOpt); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - } - - if( (NSSDER *)NULL != name->der ) { - rv->der = nssItem_Duplicate(name->der, arenaOpt, (NSSItem *)NULL); - if( (NSSDER *)NULL == rv->der ) { - goto loser; - } - } - - rv->wasPrintable = name->wasPrintable; - - if( (NSSArena *)NULL != arenaOpt ) { - rv->inArena = PR_TRUE; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arenaOpt, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_X520Name_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_X520Name_remove_pointer, rv) ) { - (void)nss_pkix_X520Name_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arenaOpt, mark); - } - - if( (NSSArena *)NULL == arenaOpt ) { - if( (NSSPKIXX520Name *)NULL != rv ) { - if( (NSSDER *)NULL != rv->der ) { - nss_ZFreeIf(rv->der->data); - nss_ZFreeIf(rv->der); - } - - nss_ZFreeIf(rv->string.data); - nss_ZFreeIf(rv->utf8); - nss_ZFreeIf(rv); - } - } - - return (NSSPKIXX520Name *)NULL; -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/PEncode.c b/mozilla/security/nss/lib/pkix/src/X520Name/PEncode.c deleted file mode 100644 index 03cd777a34e..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/PEncode.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/PEncode.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:39 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXX520Name_Encode - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -nssPKIXX520Name_Encode -( - NSSPKIXX520Name *name, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSDER *)NULL == name->der ) { - /* XXX fgmr */ - if( (NSSUTF8 *)NULL == name->utf8 ) { - if( PR_SUCCESS != nss_pkix_X520Name_DoUTF8(name) ) { - return (NSSBER *)NULL; - } - } - - rv->der = nssUTF8_GetDEREncoding(arenaOpt, type, rv->utf8); - if( (NSSDER *)NULL == rv->der ) { - return (NSSBER *)NULL; - } - } - - return nssItem_Duplicate(name->der, arenaOpt, rvOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/PEqual.c b/mozilla/security/nss/lib/pkix/src/X520Name/PEqual.c deleted file mode 100644 index 781cd39300a..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/PEqual.c +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/PEqual.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:40 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXX520Name_Equal - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -nssPKIXX520Name_Equal -( - NSSPKIXX520Name *name1, - NSSPKIXX520Name *name2, - PRStatus *statusOpt -) -{ - PRBool rv; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name1) ) { - goto loser; - } - - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name2) ) { - goto loser; - } -#endif /* NSSDEBUG */ - - if( (NSSUTF8 *)NULL == name1->utf8 ) { - if( PR_SUCCESS != nss_pkix_X520Name_DoUTF8(name1) ) { - goto loser; - } - } - - if( (NSSUTF8 *)NULL == name2->utf8 ) { - if( PR_SUCCESS != nss_pkix_X520Name_DoUTF8(name2) ) { - goto loser; - } - } - - if( (PR_TRUE == name1->wasPrintable) && (PR_TRUE == name2->wasPrintable) ) { - return nssUTF8_PrintableMatch(name1->utf8, name2->utf8, statusOpt); - } - - return nssUTF8_Equal(name1->utf8, name2->utf8, statusOpt); - - loser: - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/PGetUTF8Encoding.c b/mozilla/security/nss/lib/pkix/src/X520Name/PGetUTF8Encoding.c deleted file mode 100644 index f151c216e73..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/PGetUTF8Encoding.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/PGetUTF8Encoding.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:40 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXX520Name_GetUTF8Encoding - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_X520_NAME - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSDER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -nssPKIXX520Name_GetUTF8Encoding -( - NSSPKIXX520Name *name, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXX520Name_verifyPointer(name) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSUTF8 *)NULL == name->utf8 ) { - if( PR_SUCCESS != nss_pkix_X520Name_DoUTF8(name) ) { - return (NSSUTF8 *)NULL; - } - } - - return nssUTF8_Duplicate(rv->utf8, arenaOpt); -} diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/template.c b/mozilla/security/nss/lib/pkix/src/X520Name/template.c deleted file mode 100644 index 72129a32a2b..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/template.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/template.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:40 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXX520Name_template - * - * - */ - -const nssASN1Template nssPKIXX520Name_template[] = { - { nssASN1_ANY, offsetof(NSSPKIXX520Name, string), NULL, - sizeof(NSSPKIXX520Name) }, - { 0 } -}; diff --git a/mozilla/security/nss/lib/pkix/src/X520Name/verifyPointer.c b/mozilla/security/nss/lib/pkix/src/X520Name/verifyPointer.c deleted file mode 100644 index ac1b50ba46f..00000000000 --- a/mozilla/security/nss/lib/pkix/src/X520Name/verifyPointer.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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 Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source: /home/befator/cvs/jail/cvsroot/mozilla/security/nss/lib/pkix/src/X520Name/Attic/verifyPointer.c,v $ $Revision: 1.1 $ $Date: 2000-03-31 19:14:40 $ $Name: not supported by cvs2svn $"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -#ifdef DEBUG - -extern const NSSError NSS_ERROR_INTERNAL_ERROR; - -static nssPointerTracker pkix_x520_name_pointer_tracker; - -/* - * nss_pkix_X520Name_add_pointer - * - * This method is only present in debug builds. - * - * This module-private routine adds an NSSPKIXX520Name pointer to - * the internal pointer-tracker. This routine should only be used - * by the NSSPKIX module. This routine returns a PRStatus value; - * upon error it will place an error on the error stack and return - * PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INTERNAL_ERROR - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_X520Name_add_pointer -( - const NSSPKIXX520Name *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_x520_name_pointer_tracker); - if( PR_SUCCESS != rv ) { - return rv; - } - - rv = nssPointerTracker_add(&pkix_x520_name_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - NSSError e = NSS_GetError(); - if( NSS_ERROR_NO_MEMORY != e ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - return rv; - } - - return PR_SUCCESS; -} - -/* - * nss_pkix_X520Name_remove_pointer - * - * This method is only present in debug builds. - * - * This module-private routine removes a valid NSSPKIXX520Name - * pointer from the internal pointer-tracker. This routine should - * only be used by the NSSPKIX module. This routine returns a - * PRStatus value; upon error it will place an error on the error - * stack and return PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_INTERNAL_ERROR - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_X520Name_remove_pointer -( - const NSSPKIXX520Name *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_remove(&pkix_x520_name_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - return rv; -} - -/* - * nssPKIXX520Name_verifyPointer - * - * This method is only present in debug builds. - * - * If the specified pointer is a valid pointer to an NSSPKIXX520Name - * object, this routine will return PR_SUCCESS. Otherwise, it will - * put an error on the error stack and return PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_X520_NAME - * - * Return value: - * PR_SUCCESS if the pointer is valid - * PR_FAILURE if it isn't - */ - -NSS_IMPLEMENT PRStatus -nssPKIXX520Name_verifyPointer -( - NSSPKIXX520Name *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_x520_name_pointer_tracker); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_X520_NAME); - return PR_FAILURE; - } - - rv = nssPointerTracker_verify(&pkix_x520_name_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_X520_NAME); - return PR_FAILURE; - } - - return PR_SUCCESS; -} - -#endif /* DEBUG */