diff options
Diffstat (limited to 'security/nss/lib/pkix/src/Name')
28 files changed, 0 insertions, 2778 deletions
diff --git a/security/nss/lib/pkix/src/Name/Create.c b/security/nss/lib/pkix/src/Name/Create.c deleted file mode 100644 index dc9059f0b..000000000 --- a/security/nss/lib/pkix/src/Name/Create.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_Create - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_CHOICE - * NSS_ERROR_INVALID_ARGUMENT - * - * Return value: - * A valid pointer to an NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -NSSPKIXName_Create -( - NSSArena *arenaOpt, - NSSPKIXNameChoice choice, - void *arg -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - switch( choice ) { - case NSSPKIXNameChoice_rdnSequence: - { - NSSPKIXRDNSequence *r = (NSSPKIXRDNSequence *)arg; - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(r) ) { - return (NSSPKIXName *)NULL; - } - } - - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - nss_SetError(NSS_ERROR_INVALID_CHOICE); - return (NSSPKIXName *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXName_Create(arenaOpt, choice, arg); -} diff --git a/security/nss/lib/pkix/src/Name/CreateFromRDNSequence.c b/security/nss/lib/pkix/src/Name/CreateFromRDNSequence.c deleted file mode 100644 index da07742cc..000000000 --- a/security/nss/lib/pkix/src/Name/CreateFromRDNSequence.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_CreateFromRDNSequence - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * - * Return value: - * A valid pointer to an NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -NSSPKIXName_CreateFromRDNSequence -( - NSSArena *arenaOpt, - NSSPKIXRDNSequence *rdnSequence -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnSequence) ) { - return (NSSPKIXName *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXName_CreateFromRDNSequence(arenaOpt, rdnSequence); -} diff --git a/security/nss/lib/pkix/src/Name/CreateFromUTF8.c b/security/nss/lib/pkix/src/Name/CreateFromUTF8.c deleted file mode 100644 index f2111ea75..000000000 --- a/security/nss/lib/pkix/src/Name/CreateFromUTF8.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_CreateFromUTF8 - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_STRING - * NSS_ERROR_UNKNOWN_ATTRIBUTE - * - * Return value: - * A valid pointer to an NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -NSSPKIXName_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *string -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - if( (NSSUTF8 *)NULL == string ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXName_CreateFromUTF8(arenaOpt, string); -} diff --git a/security/nss/lib/pkix/src/Name/Decode.c b/security/nss/lib/pkix/src/Name/Decode.c deleted file mode 100644 index b30fac01e..000000000 --- a/security/nss/lib/pkix/src/Name/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_CreateFromBER - * - * -- 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 NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -NSSPKIXName_CreateFromBER -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXName *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXName_CreateFromBER(arenaOpt, ber); -} diff --git a/security/nss/lib/pkix/src/Name/Destroy.c b/security/nss/lib/pkix/src/Name/Destroy.c deleted file mode 100644 index c8c2bc9f2..000000000 --- a/security/nss/lib/pkix/src/Name/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_Destroy - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXName_Destroy -( - NSSPKIXName *name -) -{ -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXName_Destroy(name); -} diff --git a/security/nss/lib/pkix/src/Name/Duplicate.c b/security/nss/lib/pkix/src/Name/Duplicate.c deleted file mode 100644 index 6c8831729..000000000 --- a/security/nss/lib/pkix/src/Name/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_Duplicate - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -NSSPKIXName_Duplicate -( - NSSPKIXName *name, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return (NSSDER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSDER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXName_Duplicate(name, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Name/Encode.c b/security/nss/lib/pkix/src/Name/Encode.c deleted file mode 100644 index 344a53724..000000000 --- a/security/nss/lib/pkix/src/Name/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_Encode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXName_Encode -( - NSSPKIXName *name, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXName_Encode(name, rvOpt, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Name/Equal.c b/security/nss/lib/pkix/src/Name/Equal.c deleted file mode 100644 index 9a74eef94..000000000 --- a/security/nss/lib/pkix/src/Name/Equal.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_Equal - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -NSSPKIXName_Equal -( - NSSPKIXName *name1, - NSSPKIXName *name2, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(name1) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(name2) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIX_Equal(name1, name2, statusOpt); -} diff --git a/security/nss/lib/pkix/src/Name/GetChoice.c b/security/nss/lib/pkix/src/Name/GetChoice.c deleted file mode 100644 index 8a36ada00..000000000 --- a/security/nss/lib/pkix/src/Name/GetChoice.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_GetChoice - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * - * Return value: - * A valid element of the NSSPKIXNameChoice enumeration upon success - * The value NSSPKIXNameChoice_NSSinvalid (-1) upon error - */ - -NSS_IMPLEMENT NSSPKIXNameChoice -NSSPKIXName_GetChoice -( - NSSPKIXName *name -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return NSSPKIXNameChoice_NSSinvalid; - } -#endif /* DEBUG */ - - return nssPKIXName_GetChoice(name); -} diff --git a/security/nss/lib/pkix/src/Name/GetRDNSequence.c b/security/nss/lib/pkix/src/Name/GetRDNSequence.c deleted file mode 100644 index 94562ae3c..000000000 --- a/security/nss/lib/pkix/src/Name/GetRDNSequence.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_GetRDNSequence - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_WRONG_CHOICE - * - * Return value: - * A pointer to a valid NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -NSSPKIXName_GetRDNSequence -( - NSSPKIXName *name, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSPKIXRDNSequence *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXName_GetRDNSequence(name, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Name/GetSpecifiedChoice.c b/security/nss/lib/pkix/src/Name/GetSpecifiedChoice.c deleted file mode 100644 index 3de2d5b84..000000000 --- a/security/nss/lib/pkix/src/Name/GetSpecifiedChoice.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_GetSpecifiedChoice - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_WRONG_CHOICE - * - * Return value: - * A valid pointer ... - * NULL upon failure - */ - -NSS_IMPLEMENT void * -NSSPKIXName_GetSpecifiedChoice -( - NSSPKIXName *name, - NSSPKIXNameChoice choice, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(name) ) { - return (void *)NULL; - } - - switch( choice ) { - case NSSPKIXNameChoice_rdnSequence: - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - nss_SetError(NSS_ERROR_INVALID_CHOICE); - return (void *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (void *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXName_GetSpecifiedChoice(name, choice, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Name/GetUTF8Encoding.c b/security/nss/lib/pkix/src/Name/GetUTF8Encoding.c deleted file mode 100644 index c86dd94b2..000000000 --- a/security/nss/lib/pkix/src/Name/GetUTF8Encoding.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXName_GetUTF8Encoding - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSUTF8 pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -NSSPKIXName_GetUTF8Encoding -( - NSSPKIXName *name, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXName_GetUTF8Encoding(name, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Name/MClear.c b/security/nss/lib/pkix/src/Name/MClear.c deleted file mode 100644 index e8d6b1961..000000000 --- a/security/nss/lib/pkix/src/Name/MClear.c +++ /dev/null @@ -1,73 +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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nss_pkix_Name_Clear - * - * Wipes out cached data. - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_Name_Clear -( - NSSPKIXName *name -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSBER *)NULL != name->ber ) { - nss_ZFreeIf(name->ber->data); - nss_ZFreeIf(name->ber); - } - - if( (NSSDER *)NULL != name->der ) { - nss_ZFreeIf(name->der->data); - nss_ZFreeIf(name->der); - } - - nss_ZFreeIf(name->utf8); - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/Name/Mregister.c b/security/nss/lib/pkix/src/Name/Mregister.c deleted file mode 100644 index 09ddb9d99..000000000 --- a/security/nss/lib/pkix/src/Name/Mregister.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifdef NSSDEBUG -/* - * nss_pkix_Name_register - * - * Registers whatever sub-component exists within this Name. - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_Name_register -( - NSSPKIXName *name -) -{ - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return PR_FAILURE; - } - - switch( name->choice ) { - case NSSPKIXNameChoice_rdnSequence: - /* add pointer */ - /* (sub-)register pointer */ - /* add destructor to arena */ - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - return PR_FAILURE; - } - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/Name/PCreate.c b/security/nss/lib/pkix/src/Name/PCreate.c deleted file mode 100644 index e93737599..000000000 --- a/security/nss/lib/pkix/src/Name/PCreate.c +++ /dev/null @@ -1,173 +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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_Create - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_CHOICE - * NSS_ERROR_INVALID_ARGUMENT - * - * Return value: - * A valid pointer to an NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -nssPKIXName_Create -( - NSSArena *arenaOpt, - NSSPKIXNameChoice choice, - void *arg -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXName *rv = (NSSPKIXName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - switch( choice ) { - case NSSPKIXNameChoice_rdnSequence: - if( (PR_SUCCESS != nssPKIXRDNSequence_verifyPointer((NSSPKIXRDNSequence *)arg) ) ) { - nss_SetError(NSS_ERROR_INVALID_ARGUMENT); - return (NSSPKIXName *)NULL; - } - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - nss_SetError(NSS_ERROR_INVALID_CHOICE); - return (NSSPKIXName *)NULL; - } -#endif /* NSSDEBUG */ - - switch( choice ) { - case NSSPKIXNameChoice_rdnSequence: - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - nss_SetError(NSS_ERROR_INVALID_CHOICE); - goto loser; - } - - 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, NSSPKIXName); - if( (NSSPKIXName *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->utf8 = nssUTF8_Duplicate(string, arena); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - - rv->choice = choice; - switch( choice ) { - case NSSPKIXNameChoice_rdnSequence: - rv->u.rdnSequence = nssPKIXRDNSequence_Duplicate((NSSPKIXRDNSequence *)arg, arena); - if( (NSSPKIXRDNSequence *)NULL == rv->u.rdnSequence ) { - goto loser; - } - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - nss_SetError(NSS_ERROR_INVALID_CHOICE); - goto loser; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Name_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_Name_remove_pointer, rv) ) { - (void)nss_pkix_Name_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 (NSSPKIXName *)NULL; -} diff --git a/security/nss/lib/pkix/src/Name/PCreateFromRDNSequence.c b/security/nss/lib/pkix/src/Name/PCreateFromRDNSequence.c deleted file mode 100644 index 169e409a3..000000000 --- a/security/nss/lib/pkix/src/Name/PCreateFromRDNSequence.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_CreateFromRDNSequence - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * - * Return value: - * A valid pointer to an NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -nssPKIXName_CreateFromRDNSequence -( - NSSArena *arenaOpt, - NSSPKIXRDNSequence *rdnSequence -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXName *rv = (NSSPKIXName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - if( (PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnSequence) ) ) { - return (NSSPKIXName *)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, NSSPKIXName); - if( (NSSPKIXName *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->utf8 = nssUTF8_Duplicate(string, arena); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - - rv->choice = NSSPKIXNameChoice_rdnSequence; - rv->u.rdnSequence = nssPKIXRDNSequence_Duplicate(rdnSequence, arena); - if( (NSSPKIXRDNSequence *)NULL == rv->u.rdnSequence ) { - goto loser; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Name_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_Name_remove_pointer, rv) ) { - (void)nss_pkix_Name_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 (NSSPKIXName *)NULL; -} diff --git a/security/nss/lib/pkix/src/Name/PCreateFromUTF8.c b/security/nss/lib/pkix/src/Name/PCreateFromUTF8.c deleted file mode 100644 index 0939a19e3..000000000 --- a/security/nss/lib/pkix/src/Name/PCreateFromUTF8.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_CreateFromUTF8 - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_STRING - * NSS_ERROR_UNKNOWN_ATTRIBUTE - * - * Return value: - * A valid pointer to an NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -nssPKIXName_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *string -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXName *rv = (NSSPKIXName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - if( (NSSUTF8 *)NULL == string ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXName *)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, NSSPKIXName); - if( (NSSPKIXName *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->utf8 = nssUTF8_Duplicate(string, arena); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - - /* Insert intelligence here -- fgmr */ - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - goto loser; - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Name_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_Name_remove_pointer, rv) ) { - (void)nss_pkix_Name_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 (NSSPKIXName *)NULL; -} diff --git a/security/nss/lib/pkix/src/Name/PDecode.c b/security/nss/lib/pkix/src/Name/PDecode.c deleted file mode 100644 index d3f20d473..000000000 --- a/security/nss/lib/pkix/src/Name/PDecode.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_CreateFromBER - * - * -- 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 NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -nssPKIXName_CreateFromBER -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXName *rv = (NSSPKIXName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXName *)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, NSSPKIXName); - if( (NSSPKIXName *)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, nssPKIXName_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_Name_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 (NSSPKIXName *)NULL; -} diff --git a/security/nss/lib/pkix/src/Name/PDestroy.c b/security/nss/lib/pkix/src/Name/PDestroy.c deleted file mode 100644 index f1fd41721..000000000 --- a/security/nss/lib/pkix/src/Name/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_Destroy - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXName_Destroy -( - NSSPKIXName *name -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - -#ifdef DEBUG - (void)nss_pkix_Name_remove_pointer(name); -#endif /* DEBUG */ - - if( PR_TRUE == name->i_allocated_arena ) { - return nssArena_Destroy(name->arena); - } - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/Name/PDuplicate.c b/security/nss/lib/pkix/src/Name/PDuplicate.c deleted file mode 100644 index c5788a0f1..000000000 --- a/security/nss/lib/pkix/src/Name/PDuplicate.c +++ /dev/null @@ -1,172 +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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_Duplicate - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXName * -nssPKIXName_Duplicate -( - NSSPKIXName *name, - NSSArena *arenaOpt -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXName *rv = (NSSPKIXName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXName *)NULL; - } - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)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, NSSPKIXName); - if( (NSSPKIXName *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - if( (NSSBER *)NULL != name->ber ) { - rv->ber = nssItem_Duplicate(name->ber, arena, (NSSItem *)NULL); - if( (NSSBER *)NULL == rv->ber ) { - goto loser; - } - } - - if( (NSSDER *)NULL != name->der ) { - rv->der = nssItem_Duplicate(name->der, arena, (NSSItem *)NULL); - if( (NSSDER *)NULL == rv->der ) { - goto loser; - } - } - - if( (NSSUTF8 *)NULL != name->utf8 ) { - rv->utf8 = nssUTF8_duplicate(name->utf8, arena); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - } - - rv->choice = name->choice; - switch( name->choice ) { - case NSSPKIXNameChoice_rdnSequence: - rv->u.rdnSequence = nssPKIXRDNSequence_Duplicate(name->u.rdnSequence, arena); - if( (NSSPKIXRDNSequence *)NULL == rv->u.rdnSequence ) { - goto loser; - } - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - goto loser; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Name_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_Name_remove_pointer, rv) ) { - (void)nss_pkix_Name_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 (NSSPKIXName *)NULL; -} diff --git a/security/nss/lib/pkix/src/Name/PEncode.c b/security/nss/lib/pkix/src/Name/PEncode.c deleted file mode 100644 index 469b528fb..000000000 --- a/security/nss/lib/pkix/src/Name/PEncode.c +++ /dev/null @@ -1,118 +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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_Encode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -nssPKIXName_Encode -( - NSSPKIXName *name, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - NSSBER *it; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - 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 != name->ber ) { - it = name->ber; - goto done; - } - /*FALLTHROUGH*/ - case NSSASN1DER: - if( (NSSDER *)NULL != name->der ) { - it = name->der; - goto done; - } - break; - default: - nss_SetError(NSS_ERROR_UNSUPPORTED_ENCODING); - return (NSSBER *)NULL; - } - - it = nssASN1_EncodeItem(name->arena, (NSSItem *)NULL, name, - nssPKIXName_template, encoding); - if( (NSSBER *)NULL == it ) { - return (NSSBER *)NULL; - } - - switch( encoding ) { - case NSSASN1BER: - name->ber = it; - break; - case NSSASN1DER: - name->der = it; - break; - default: - PR_ASSERT(0); - break; - } - - done: - return nssItem_Duplicate(it, arenaOpt, rvOpt); -} diff --git a/security/nss/lib/pkix/src/Name/PEqual.c b/security/nss/lib/pkix/src/Name/PEqual.c deleted file mode 100644 index 5ad91dd2a..000000000 --- a/security/nss/lib/pkix/src/Name/PEqual.c +++ /dev/null @@ -1,104 +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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_Equal - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -nssPKIXName_Equal -( - NSSPKIXName *one, - NSSPKIXName *two, - PRStatus *statusOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(one) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXName_verifyPointer(two) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = 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( one->choice != two->choice ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_SUCCESS; - } - return PR_FALSE; - } - - switch( one->choice ) { - case NSSPKIXNameChoice_rdnSequence: - return nssPKIXRDNSequence_Equal(one->u.rdnSequence, two->u.rdnSequence, statusOpt); - case NSSPKIXNameChoice_NSSinvalid: - default: - break; - } - - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; -} diff --git a/security/nss/lib/pkix/src/Name/PGetChoice.c b/security/nss/lib/pkix/src/Name/PGetChoice.c deleted file mode 100644 index f34a93908..000000000 --- a/security/nss/lib/pkix/src/Name/PGetChoice.c +++ /dev/null @@ -1,68 +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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_GetChoice - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * - * Return value: - * A valid element of the NSSPKIXNameChoice enumeration upon success - * The value NSSPKIXNameChoice_NSSinvalid (-1) upon error - */ - -NSS_IMPLEMENT NSSPKIXNameChoice -nssPKIXName_GetChoice -( - NSSPKIXName *name -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return NSSPKIXNameChoice_NSSinvalid; - } -#endif /* NSSDEBUG */ - - return name->choice; -} diff --git a/security/nss/lib/pkix/src/Name/PGetRDNSequence.c b/security/nss/lib/pkix/src/Name/PGetRDNSequence.c deleted file mode 100644 index 0899e550d..000000000 --- a/security/nss/lib/pkix/src/Name/PGetRDNSequence.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_GetRDNSequence - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_WRONG_CHOICE - * - * Return value: - * A pointer to a valid NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -nssPKIXName_GetRDNSequence -( - NSSPKIXName *name, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return (NSSPKIXRDNSequence *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)NULL; - } - } -#endif /* NSSDEBUG */ - - switch( name->choice ) { - case NSSPKIXNameChoice_rdnSequence: - return nssPKIXRDNSequence_Duplicate(name->u.rdnSequence, arenaOpt); - case NSSPKIXNameChoice_NSSinvalid: - default: - break; - } - - nss_SetError(NSS_ERROR_WRONG_CHOICE); - return (NSSPKIXRDNSequence *)NULL; -} diff --git a/security/nss/lib/pkix/src/Name/PGetSpecifiedChoice.c b/security/nss/lib/pkix/src/Name/PGetSpecifiedChoice.c deleted file mode 100644 index a24c8ea86..000000000 --- a/security/nss/lib/pkix/src/Name/PGetSpecifiedChoice.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_GetSpecifiedChoice - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_WRONG_CHOICE - * - * Return value: - * A valid pointer ... - * NULL upon failure - */ - -NSS_IMPLEMENT void * -nssPKIXName_GetSpecifiedChoice -( - NSSPKIXName *name, - NSSPKIXNameChoice choice, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXName_verifyPointer(name) ) { - return (void *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (void *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( choice != name->choice ) { - nss_SetError(NSS_ERROR_WRONG_CHOICE); - return (void *)NULL; - } - - switch( name->choice ) { - case NSSPKIXNameChoice_rdnSequence: - return (void *)nssPKIXRDNSequence_Duplicate(name->u.rdnSequence, arenaOpt); - case NSSPKIXNameChoice_NSSinvalid: - default: - break; - } - - nss_SetError(NSS_ERROR_WRONG_CHOICE); - return (NSSPKIXRDNSequence *)NULL; -} diff --git a/security/nss/lib/pkix/src/Name/PGetUTF8Encoding.c b/security/nss/lib/pkix/src/Name/PGetUTF8Encoding.c deleted file mode 100644 index 164229277..000000000 --- a/security/nss/lib/pkix/src/Name/PGetUTF8Encoding.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXName_GetUTF8Encoding - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_NAME - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSUTF8 pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -nssPKIXName_GetUTF8Encoding -( - NSSPKIXName *name, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXName_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 ) { - /* xxx fgmr fill this in from pki1 implementation */ - } - - return nssUTF8_Duplicate(name->utf8, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Name/template.c b/security/nss/lib/pkix/src/Name/template.c deleted file mode 100644 index 72ac85466..000000000 --- a/security/nss/lib/pkix/src/Name/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXName_template - * - */ - -const nssASN1Template nssPKIXName_template[] = { - { nssASN1_CHOICE, offsetof(NSSPKIXName, choice), 0, sizeof(NSSPKIXName) }, - { nssASN1_POINTER, offsetof(NSSPKIXName, u.rdnSequence), - nssPKIXRDNSequence_template, NSSPKIXNameChoice_rdnSequence }, - { 0 } -}; diff --git a/security/nss/lib/pkix/src/Name/verifyPointer.c b/security/nss/lib/pkix/src/Name/verifyPointer.c deleted file mode 100644 index 6c27e5910..000000000 --- a/security/nss/lib/pkix/src/Name/verifyPointer.c +++ /dev/null @@ -1,210 +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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -#ifdef DEBUG - -extern const NSSError NSS_ERROR_INTERNAL_ERROR; - -static nssPointerTracker pkix_name_pointer_tracker; - -/* - * nss_pkix_Name_add_pointer - * - * This method is only present in debug builds. - * - * This module-private routine adds an NSSPKIXName 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_Name_add_pointer -( - const NSSPKIXName *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_name_pointer_tracker); - if( PR_SUCCESS != rv ) { - return rv; - } - - rv = nssPointerTracker_add(&pkix_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; - } - - rv = nssArena_registerDestructor(p->arena, - nss_pkix_Name_remove_pointer, p); - if( PR_SUCCESS != rv ) { - (void)nss_pkix_Name_remove_pointer(p); - return rv; - } - -#ifdef NSSDEBUG - switch( p->choice ) { - case NSSPKIXNameChoice_rdnSequence: - rv = nss_pkix_RDNSequence_register(p->u.rdnSequence); - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - rv = PR_FAILURE; - break; - } - - if( PR_SUCCESS != rv ) { - (void)nss_pkix_Name_remove_pointer(p); - } -#endif /* NSSDEBUG */ - - return rv; -} - -/* - * nss_pkix_Name_remove_pointer - * - * This method is only present in debug builds. - * - * This module-private routine removes a valid NSSPKIXName - * 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_Name_remove_pointer -( - const NSSPKIXName *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_remove(&pkix_name_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - -#ifdef NSSDEBUG - switch( p->choice ) { - case NSSPKIXNameChoice_rdnSequence: - (void)nss_pkix_RDNSequence_register(p->u.rdnSequence); - break; - case NSSPKIXNameChoice_NSSinvalid: - default: - break; - } -#endif /* NSSDEBUG */ - - /* - * nssArena_deregisterDestructor(p->arena, - * nss_pkix_Name_remove_pointer, p); - */ - - return rv; -} - -/* - * nssPKIXName_verifyPointer - * - * This method is only present in debug builds. - * - * If the specified pointer is a valid pointer to an NSSPKIXName - * 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 -nssPKIXName_verifyPointer -( - NSSPKIXName *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_name_pointer_tracker); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - rv = nssPointerTracker_verify(&pkix_name_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - return PR_SUCCESS; -} - -#endif /* DEBUG */ - |