From c248efbb56e81d97dd959bcb95aeb7835a4979ef Mon Sep 17 00:00:00 2001 From: cvs2hg Date: Mon, 10 Jul 2000 20:38:42 +0000 Subject: fixup commit for tag 'CONRAD_DYN_PROFILE_TAG' --- .../nss/lib/pkix/src/AlgorithmIdentifier/Create.c | 85 --------- .../nss/lib/pkix/src/AlgorithmIdentifier/Decode.c | 79 -------- .../nss/lib/pkix/src/AlgorithmIdentifier/Destroy.c | 71 ------- .../lib/pkix/src/AlgorithmIdentifier/Duplicate.c | 79 -------- .../nss/lib/pkix/src/AlgorithmIdentifier/Encode.c | 81 -------- .../nss/lib/pkix/src/AlgorithmIdentifier/Equal.c | 83 -------- .../pkix/src/AlgorithmIdentifier/GetAlgorithm.c | 71 ------- .../pkix/src/AlgorithmIdentifier/GetParameters.c | 80 -------- .../nss/lib/pkix/src/AlgorithmIdentifier/MClear.c | 71 ------- .../nss/lib/pkix/src/AlgorithmIdentifier/PCreate.c | 138 -------------- .../nss/lib/pkix/src/AlgorithmIdentifier/PDecode.c | 137 -------------- .../lib/pkix/src/AlgorithmIdentifier/PDestroy.c | 76 -------- .../lib/pkix/src/AlgorithmIdentifier/PDuplicate.c | 144 -------------- .../nss/lib/pkix/src/AlgorithmIdentifier/PEncode.c | 117 ------------ .../nss/lib/pkix/src/AlgorithmIdentifier/PEqual.c | 88 --------- .../pkix/src/AlgorithmIdentifier/PGetAlgorithm.c | 69 ------- .../pkix/src/AlgorithmIdentifier/PGetParameters.c | 78 -------- .../pkix/src/AlgorithmIdentifier/PSetAlgorithm.c | 75 -------- .../pkix/src/AlgorithmIdentifier/PSetParameters.c | 86 --------- .../pkix/src/AlgorithmIdentifier/SetAlgorithm.c | 76 -------- .../pkix/src/AlgorithmIdentifier/SetParameters.c | 77 -------- .../pkix/src/AlgorithmIdentifier/verifyPointer.c | 182 ------------------ security/nss/lib/pkix/src/Attribute/AddValue.c | 79 -------- security/nss/lib/pkix/src/Attribute/Create.c | 141 -------------- .../nss/lib/pkix/src/Attribute/CreateFromArray.c | 97 ---------- security/nss/lib/pkix/src/Attribute/Decode.c | 84 --------- security/nss/lib/pkix/src/Attribute/Destroy.c | 74 -------- security/nss/lib/pkix/src/Attribute/Duplicate.c | 79 -------- security/nss/lib/pkix/src/Attribute/Encode.c | 85 --------- security/nss/lib/pkix/src/Attribute/Equal.c | 88 --------- security/nss/lib/pkix/src/Attribute/FindValue.c | 84 --------- security/nss/lib/pkix/src/Attribute/GetType.c | 72 ------- security/nss/lib/pkix/src/Attribute/GetValue.c | 86 --------- .../nss/lib/pkix/src/Attribute/GetValueCount.c | 75 -------- security/nss/lib/pkix/src/Attribute/GetValues.c | 88 --------- security/nss/lib/pkix/src/Attribute/MClear.c | 71 ------- security/nss/lib/pkix/src/Attribute/MCount.c | 87 --------- security/nss/lib/pkix/src/Attribute/MVCreate.c | 165 ---------------- security/nss/lib/pkix/src/Attribute/PAddValue.c | 140 -------------- security/nss/lib/pkix/src/Attribute/PCreate.c | 139 -------------- .../nss/lib/pkix/src/Attribute/PCreateFromArray.c | 191 ------------------- security/nss/lib/pkix/src/Attribute/PDecode.c | 153 --------------- security/nss/lib/pkix/src/Attribute/PDestroy.c | 82 -------- security/nss/lib/pkix/src/Attribute/PDuplicate.c | 189 ------------------- security/nss/lib/pkix/src/Attribute/PEncode.c | 126 ------------- security/nss/lib/pkix/src/Attribute/PEqual.c | 164 ---------------- security/nss/lib/pkix/src/Attribute/PFindValue.c | 107 ----------- security/nss/lib/pkix/src/Attribute/PGetType.c | 79 -------- security/nss/lib/pkix/src/Attribute/PGetValue.c | 98 ---------- .../nss/lib/pkix/src/Attribute/PGetValueCount.c | 88 --------- security/nss/lib/pkix/src/Attribute/PGetValues.c | 145 -------------- security/nss/lib/pkix/src/Attribute/PRemoveValue.c | 121 ------------ security/nss/lib/pkix/src/Attribute/PSetType.c | 90 --------- security/nss/lib/pkix/src/Attribute/PSetValue.c | 102 ---------- security/nss/lib/pkix/src/Attribute/PSetValues.c | 135 ------------- security/nss/lib/pkix/src/Attribute/RemoveValue.c | 76 -------- security/nss/lib/pkix/src/Attribute/SetType.c | 80 -------- security/nss/lib/pkix/src/Attribute/SetValue.c | 80 -------- security/nss/lib/pkix/src/Attribute/SetValues.c | 85 --------- security/nss/lib/pkix/src/Attribute/template.c | 58 ------ .../nss/lib/pkix/src/Attribute/verifyPointer.c | 170 ----------------- .../lib/pkix/src/AttributeTypeAndValue/Create.c | 85 --------- .../src/AttributeTypeAndValue/CreateFromUTF8.c | 81 -------- .../lib/pkix/src/AttributeTypeAndValue/Decode.c | 79 -------- .../lib/pkix/src/AttributeTypeAndValue/Destroy.c | 70 ------- .../lib/pkix/src/AttributeTypeAndValue/Duplicate.c | 79 -------- .../lib/pkix/src/AttributeTypeAndValue/Encode.c | 81 -------- .../nss/lib/pkix/src/AttributeTypeAndValue/Equal.c | 85 --------- .../lib/pkix/src/AttributeTypeAndValue/GetType.c | 71 ------- .../src/AttributeTypeAndValue/GetUTF8Encoding.c | 79 -------- .../lib/pkix/src/AttributeTypeAndValue/GetValue.c | 80 -------- .../lib/pkix/src/AttributeTypeAndValue/MClear.c | 73 ------- .../lib/pkix/src/AttributeTypeAndValue/PCreate.c | 154 --------------- .../src/AttributeTypeAndValue/PCreateFromUTF8.c | 137 -------------- .../lib/pkix/src/AttributeTypeAndValue/PDecode.c | 144 -------------- .../lib/pkix/src/AttributeTypeAndValue/PDestroy.c | 78 -------- .../pkix/src/AttributeTypeAndValue/PDuplicate.c | 165 ---------------- .../lib/pkix/src/AttributeTypeAndValue/PEncode.c | 101 ---------- .../lib/pkix/src/AttributeTypeAndValue/PEqual.c | 95 ---------- .../lib/pkix/src/AttributeTypeAndValue/PGetType.c | 78 -------- .../src/AttributeTypeAndValue/PGetUTF8Encoding.c | 81 -------- .../lib/pkix/src/AttributeTypeAndValue/PGetValue.c | 83 -------- .../lib/pkix/src/AttributeTypeAndValue/PSetType.c | 86 --------- .../lib/pkix/src/AttributeTypeAndValue/PSetValue.c | 85 --------- .../lib/pkix/src/AttributeTypeAndValue/SetType.c | 76 -------- .../lib/pkix/src/AttributeTypeAndValue/SetValue.c | 77 -------- .../lib/pkix/src/AttributeTypeAndValue/template.c | 56 ------ .../pkix/src/AttributeTypeAndValue/verifyPointer.c | 184 ------------------ security/nss/lib/pkix/src/Name/Create.c | 93 --------- .../nss/lib/pkix/src/Name/CreateFromRDNSequence.c | 79 -------- security/nss/lib/pkix/src/Name/CreateFromUTF8.c | 81 -------- security/nss/lib/pkix/src/Name/Decode.c | 79 -------- security/nss/lib/pkix/src/Name/Destroy.c | 71 ------- security/nss/lib/pkix/src/Name/Duplicate.c | 79 -------- security/nss/lib/pkix/src/Name/Encode.c | 81 -------- security/nss/lib/pkix/src/Name/Equal.c | 85 --------- security/nss/lib/pkix/src/Name/GetChoice.c | 70 ------- security/nss/lib/pkix/src/Name/GetRDNSequence.c | 80 -------- .../nss/lib/pkix/src/Name/GetSpecifiedChoice.c | 90 --------- security/nss/lib/pkix/src/Name/GetUTF8Encoding.c | 79 -------- security/nss/lib/pkix/src/Name/MClear.c | 73 ------- security/nss/lib/pkix/src/Name/Mregister.c | 72 ------- security/nss/lib/pkix/src/Name/PCreate.c | 173 ----------------- .../nss/lib/pkix/src/Name/PCreateFromRDNSequence.c | 145 -------------- security/nss/lib/pkix/src/Name/PCreateFromUTF8.c | 145 -------------- security/nss/lib/pkix/src/Name/PDecode.c | 138 -------------- security/nss/lib/pkix/src/Name/PDestroy.c | 76 -------- security/nss/lib/pkix/src/Name/PDuplicate.c | 172 ----------------- security/nss/lib/pkix/src/Name/PEncode.c | 118 ------------ security/nss/lib/pkix/src/Name/PEqual.c | 104 ---------- security/nss/lib/pkix/src/Name/PGetChoice.c | 68 ------- security/nss/lib/pkix/src/Name/PGetRDNSequence.c | 87 --------- .../nss/lib/pkix/src/Name/PGetSpecifiedChoice.c | 93 --------- security/nss/lib/pkix/src/Name/PGetUTF8Encoding.c | 81 -------- security/nss/lib/pkix/src/Name/template.c | 56 ------ security/nss/lib/pkix/src/Name/verifyPointer.c | 210 --------------------- .../RDNSequence/AppendRelativeDistinguishedName.c | 77 -------- security/nss/lib/pkix/src/RDNSequence/Create.c | 125 ------------ .../nss/lib/pkix/src/RDNSequence/CreateFromArray.c | 86 --------- .../nss/lib/pkix/src/RDNSequence/CreateFromUTF8.c | 81 -------- security/nss/lib/pkix/src/RDNSequence/Decode.c | 79 -------- security/nss/lib/pkix/src/RDNSequence/Destroy.c | 70 ------- security/nss/lib/pkix/src/RDNSequence/Duplicate.c | 79 -------- security/nss/lib/pkix/src/RDNSequence/Encode.c | 81 -------- security/nss/lib/pkix/src/RDNSequence/Equal.c | 85 --------- .../RDNSequence/FindRelativeDistinguishedName.c | 78 -------- .../src/RDNSequence/GetRelativeDistinguishedName.c | 81 -------- .../GetRelativeDistinguishedNameCount.c | 71 ------- .../RDNSequence/GetRelativeDistinguishedNames.c | 85 --------- .../nss/lib/pkix/src/RDNSequence/GetUTF8Encoding.c | 79 -------- .../RDNSequence/InsertRelativeDistinguishedName.c | 79 -------- security/nss/lib/pkix/src/RDNSequence/MClear.c | 73 ------- security/nss/lib/pkix/src/RDNSequence/MCount.c | 82 -------- security/nss/lib/pkix/src/RDNSequence/MVCreate.c | 141 -------------- .../RDNSequence/PAppendRelativeDistinguishedName.c | 105 ----------- security/nss/lib/pkix/src/RDNSequence/PCreate.c | 123 ------------ .../lib/pkix/src/RDNSequence/PCreateFromArray.c | 151 --------------- .../nss/lib/pkix/src/RDNSequence/PCreateFromUTF8.c | 139 -------------- security/nss/lib/pkix/src/RDNSequence/PDecode.c | 138 -------------- security/nss/lib/pkix/src/RDNSequence/PDestroy.c | 76 -------- security/nss/lib/pkix/src/RDNSequence/PDuplicate.c | 177 ----------------- security/nss/lib/pkix/src/RDNSequence/PEncode.c | 118 ------------ security/nss/lib/pkix/src/RDNSequence/PEqual.c | 107 ----------- .../RDNSequence/PFindRelativeDistinguishedName.c | 90 --------- .../RDNSequence/PGetRelativeDistinguishedName.c | 96 ---------- .../PGetRelativeDistinguishedNameCount.c | 85 --------- .../RDNSequence/PGetRelativeDistinguishedNames.c | 135 ------------- .../lib/pkix/src/RDNSequence/PGetUTF8Encoding.c | 81 -------- .../RDNSequence/PInsertRelativeDistinguishedName.c | 117 ------------ .../RDNSequence/PRemoveRelativeDistinguishedName.c | 104 ---------- .../RDNSequence/PSetRelativeDistinguishedName.c | 103 ---------- .../RDNSequence/PSetRelativeDistinguishedNames.c | 153 --------------- .../RDNSequence/RemoveRelativeDistinguishedName.c | 72 ------- .../src/RDNSequence/SetRelativeDistinguishedName.c | 79 -------- .../RDNSequence/SetRelativeDistinguishedNames.c | 115 ----------- security/nss/lib/pkix/src/RDNSequence/template.c | 55 ------ .../nss/lib/pkix/src/RDNSequence/verifyPointer.c | 205 -------------------- .../AddAttributeTypeAndValue.c | 77 -------- .../pkix/src/RelativeDistinguishedName/Create.c | 125 ------------ .../RelativeDistinguishedName/CreateFromArray.c | 86 --------- .../src/RelativeDistinguishedName/CreateFromUTF8.c | 81 -------- .../pkix/src/RelativeDistinguishedName/Decode.c | 79 -------- .../pkix/src/RelativeDistinguishedName/Destroy.c | 70 ------- .../pkix/src/RelativeDistinguishedName/Duplicate.c | 80 -------- .../pkix/src/RelativeDistinguishedName/Encode.c | 81 -------- .../lib/pkix/src/RelativeDistinguishedName/Equal.c | 85 --------- .../FindAttributeTypeAndValue.c | 78 -------- .../GetAttributeTypeAndValue.c | 81 -------- .../GetAttributeTypeAndValueCount.c | 72 ------- .../GetAttributeTypeAndValues.c | 83 -------- .../RelativeDistinguishedName/GetUTF8Encoding.c | 79 -------- .../pkix/src/RelativeDistinguishedName/MClear.c | 73 ------- .../pkix/src/RelativeDistinguishedName/MCount.c | 82 -------- .../pkix/src/RelativeDistinguishedName/MVCreate.c | 158 ---------------- .../PAddAttributeTypeAndValue.c | 107 ----------- .../pkix/src/RelativeDistinguishedName/PCreate.c | 123 ------------ .../RelativeDistinguishedName/PCreateFromArray.c | 151 --------------- .../RelativeDistinguishedName/PCreateFromUTF8.c | 139 -------------- .../pkix/src/RelativeDistinguishedName/PDecode.c | 142 -------------- .../pkix/src/RelativeDistinguishedName/PDestroy.c | 76 -------- .../src/RelativeDistinguishedName/PDuplicate.c | 177 ----------------- .../pkix/src/RelativeDistinguishedName/PEncode.c | 123 ------------ .../pkix/src/RelativeDistinguishedName/PEqual.c | 101 ---------- .../PFindAttributeTypeAndValue.c | 96 ---------- .../PGetAttributeTypeAndValue.c | 89 --------- .../PGetAttributeTypeAndValueCount.c | 85 --------- .../PGetAttributeTypeAndValues.c | 133 ------------- .../RelativeDistinguishedName/PGetUTF8Encoding.c | 81 -------- .../PRemoveAttributeTypeAndValue.c | 121 ------------ .../PSetAttributeTypeAndValue.c | 102 ---------- .../PSetAttributeTypeAndValues.c | 166 ---------------- .../RemoveAttributeTypeAndValue.c | 73 ------- .../SetAttributeTypeAndValue.c | 79 -------- .../SetAttributeTypeAndValues.c | 113 ----------- .../pkix/src/RelativeDistinguishedName/template.c | 55 ------ .../src/RelativeDistinguishedName/verifyPointer.c | 205 -------------------- security/nss/lib/pkix/src/Time/Compare.c | 75 -------- security/nss/lib/pkix/src/Time/CreateFromPRTime.c | 65 ------- security/nss/lib/pkix/src/Time/CreateFromUTF8.c | 70 ------- security/nss/lib/pkix/src/Time/Decode.c | 79 -------- security/nss/lib/pkix/src/Time/Destroy.c | 62 ------ security/nss/lib/pkix/src/Time/Duplicate.c | 69 ------- security/nss/lib/pkix/src/Time/Encode.c | 71 ------- security/nss/lib/pkix/src/Time/Equal.c | 74 -------- security/nss/lib/pkix/src/Time/GetPRTime.c | 64 ------- security/nss/lib/pkix/src/Time/GetUTF8Encoding.c | 69 ------- security/nss/lib/pkix/src/Time/PCreateFromPRTime.c | 117 ------------ security/nss/lib/pkix/src/Time/PCreateFromUTF8.c | 121 ------------ security/nss/lib/pkix/src/Time/PDecode.c | 137 -------------- security/nss/lib/pkix/src/Time/PDestroy.c | 68 ------- security/nss/lib/pkix/src/Time/PEncode.c | 66 ------- security/nss/lib/pkix/src/Time/template.c | 54 ------ .../nss/lib/pkix/src/X520Name/CreateFromUTF8.c | 105 ----------- security/nss/lib/pkix/src/X520Name/Decode.c | 79 -------- security/nss/lib/pkix/src/X520Name/Destroy.c | 70 ------- security/nss/lib/pkix/src/X520Name/Duplicate.c | 79 -------- security/nss/lib/pkix/src/X520Name/Encode.c | 80 -------- security/nss/lib/pkix/src/X520Name/Equal.c | 83 -------- .../nss/lib/pkix/src/X520Name/GetUTF8Encoding.c | 78 -------- security/nss/lib/pkix/src/X520Name/MDoUTF8.c | 97 ---------- security/nss/lib/pkix/src/X520Name/PCreate.c | 169 ----------------- .../nss/lib/pkix/src/X520Name/PCreateFromUTF8.c | 164 ---------------- security/nss/lib/pkix/src/X520Name/PDecode.c | 135 ------------- security/nss/lib/pkix/src/X520Name/PDestroy.c | 87 --------- security/nss/lib/pkix/src/X520Name/PDuplicate.c | 158 ---------------- security/nss/lib/pkix/src/X520Name/PEncode.c | 93 --------- security/nss/lib/pkix/src/X520Name/PEqual.c | 100 ---------- .../nss/lib/pkix/src/X520Name/PGetUTF8Encoding.c | 82 -------- security/nss/lib/pkix/src/X520Name/template.c | 56 ------ security/nss/lib/pkix/src/X520Name/verifyPointer.c | 169 ----------------- 230 files changed, 22825 deletions(-) delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/Create.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/Decode.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/Destroy.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/Duplicate.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/Encode.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/Equal.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/GetAlgorithm.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/GetParameters.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/MClear.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PCreate.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PDecode.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PDestroy.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PDuplicate.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PEncode.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PEqual.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PGetAlgorithm.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PGetParameters.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PSetAlgorithm.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/PSetParameters.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/SetAlgorithm.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/SetParameters.c delete mode 100644 security/nss/lib/pkix/src/AlgorithmIdentifier/verifyPointer.c delete mode 100644 security/nss/lib/pkix/src/Attribute/AddValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/Create.c delete mode 100644 security/nss/lib/pkix/src/Attribute/CreateFromArray.c delete mode 100644 security/nss/lib/pkix/src/Attribute/Decode.c delete mode 100644 security/nss/lib/pkix/src/Attribute/Destroy.c delete mode 100644 security/nss/lib/pkix/src/Attribute/Duplicate.c delete mode 100644 security/nss/lib/pkix/src/Attribute/Encode.c delete mode 100644 security/nss/lib/pkix/src/Attribute/Equal.c delete mode 100644 security/nss/lib/pkix/src/Attribute/FindValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/GetType.c delete mode 100644 security/nss/lib/pkix/src/Attribute/GetValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/GetValueCount.c delete mode 100644 security/nss/lib/pkix/src/Attribute/GetValues.c delete mode 100644 security/nss/lib/pkix/src/Attribute/MClear.c delete mode 100644 security/nss/lib/pkix/src/Attribute/MCount.c delete mode 100644 security/nss/lib/pkix/src/Attribute/MVCreate.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PAddValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PCreate.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PCreateFromArray.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PDecode.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PDestroy.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PDuplicate.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PEncode.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PEqual.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PFindValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PGetType.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PGetValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PGetValueCount.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PGetValues.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PRemoveValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PSetType.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PSetValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/PSetValues.c delete mode 100644 security/nss/lib/pkix/src/Attribute/RemoveValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/SetType.c delete mode 100644 security/nss/lib/pkix/src/Attribute/SetValue.c delete mode 100644 security/nss/lib/pkix/src/Attribute/SetValues.c delete mode 100644 security/nss/lib/pkix/src/Attribute/template.c delete mode 100644 security/nss/lib/pkix/src/Attribute/verifyPointer.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/Create.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/CreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/Decode.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/Destroy.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/Duplicate.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/Encode.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/Equal.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/GetType.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/GetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/GetValue.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/MClear.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PCreate.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PCreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PDecode.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PDestroy.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PDuplicate.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PEncode.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PEqual.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PGetType.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PGetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PGetValue.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PSetType.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/PSetValue.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/SetType.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/SetValue.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/template.c delete mode 100644 security/nss/lib/pkix/src/AttributeTypeAndValue/verifyPointer.c delete mode 100644 security/nss/lib/pkix/src/Name/Create.c delete mode 100644 security/nss/lib/pkix/src/Name/CreateFromRDNSequence.c delete mode 100644 security/nss/lib/pkix/src/Name/CreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/Name/Decode.c delete mode 100644 security/nss/lib/pkix/src/Name/Destroy.c delete mode 100644 security/nss/lib/pkix/src/Name/Duplicate.c delete mode 100644 security/nss/lib/pkix/src/Name/Encode.c delete mode 100644 security/nss/lib/pkix/src/Name/Equal.c delete mode 100644 security/nss/lib/pkix/src/Name/GetChoice.c delete mode 100644 security/nss/lib/pkix/src/Name/GetRDNSequence.c delete mode 100644 security/nss/lib/pkix/src/Name/GetSpecifiedChoice.c delete mode 100644 security/nss/lib/pkix/src/Name/GetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/Name/MClear.c delete mode 100644 security/nss/lib/pkix/src/Name/Mregister.c delete mode 100644 security/nss/lib/pkix/src/Name/PCreate.c delete mode 100644 security/nss/lib/pkix/src/Name/PCreateFromRDNSequence.c delete mode 100644 security/nss/lib/pkix/src/Name/PCreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/Name/PDecode.c delete mode 100644 security/nss/lib/pkix/src/Name/PDestroy.c delete mode 100644 security/nss/lib/pkix/src/Name/PDuplicate.c delete mode 100644 security/nss/lib/pkix/src/Name/PEncode.c delete mode 100644 security/nss/lib/pkix/src/Name/PEqual.c delete mode 100644 security/nss/lib/pkix/src/Name/PGetChoice.c delete mode 100644 security/nss/lib/pkix/src/Name/PGetRDNSequence.c delete mode 100644 security/nss/lib/pkix/src/Name/PGetSpecifiedChoice.c delete mode 100644 security/nss/lib/pkix/src/Name/PGetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/Name/template.c delete mode 100644 security/nss/lib/pkix/src/Name/verifyPointer.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/AppendRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/Create.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/CreateFromArray.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/CreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/Decode.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/Destroy.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/Duplicate.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/Encode.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/Equal.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/FindRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedNameCount.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedNames.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/GetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/InsertRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/MClear.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/MCount.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/MVCreate.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PAppendRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PCreate.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PCreateFromArray.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PCreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PDecode.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PDestroy.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PDuplicate.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PEncode.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PEqual.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PFindRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedNameCount.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedNames.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PGetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PInsertRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PRemoveRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PSetRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/PSetRelativeDistinguishedNames.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/RemoveRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/SetRelativeDistinguishedName.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/SetRelativeDistinguishedNames.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/template.c delete mode 100644 security/nss/lib/pkix/src/RDNSequence/verifyPointer.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/AddAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/Create.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/CreateFromArray.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/CreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/Decode.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/Destroy.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/Duplicate.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/Encode.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/Equal.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/FindAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValueCount.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValues.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/GetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/MClear.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/MCount.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/MVCreate.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PAddAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PCreate.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PCreateFromArray.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PCreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PDecode.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PDestroy.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PDuplicate.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PEncode.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PEqual.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PFindAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValueCount.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValues.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PGetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PRemoveAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PSetAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/PSetAttributeTypeAndValues.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/RemoveAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/SetAttributeTypeAndValue.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/SetAttributeTypeAndValues.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/template.c delete mode 100644 security/nss/lib/pkix/src/RelativeDistinguishedName/verifyPointer.c delete mode 100644 security/nss/lib/pkix/src/Time/Compare.c delete mode 100644 security/nss/lib/pkix/src/Time/CreateFromPRTime.c delete mode 100644 security/nss/lib/pkix/src/Time/CreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/Time/Decode.c delete mode 100644 security/nss/lib/pkix/src/Time/Destroy.c delete mode 100644 security/nss/lib/pkix/src/Time/Duplicate.c delete mode 100644 security/nss/lib/pkix/src/Time/Encode.c delete mode 100644 security/nss/lib/pkix/src/Time/Equal.c delete mode 100644 security/nss/lib/pkix/src/Time/GetPRTime.c delete mode 100644 security/nss/lib/pkix/src/Time/GetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/Time/PCreateFromPRTime.c delete mode 100644 security/nss/lib/pkix/src/Time/PCreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/Time/PDecode.c delete mode 100644 security/nss/lib/pkix/src/Time/PDestroy.c delete mode 100644 security/nss/lib/pkix/src/Time/PEncode.c delete mode 100644 security/nss/lib/pkix/src/Time/template.c delete mode 100644 security/nss/lib/pkix/src/X520Name/CreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/X520Name/Decode.c delete mode 100644 security/nss/lib/pkix/src/X520Name/Destroy.c delete mode 100644 security/nss/lib/pkix/src/X520Name/Duplicate.c delete mode 100644 security/nss/lib/pkix/src/X520Name/Encode.c delete mode 100644 security/nss/lib/pkix/src/X520Name/Equal.c delete mode 100644 security/nss/lib/pkix/src/X520Name/GetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/X520Name/MDoUTF8.c delete mode 100644 security/nss/lib/pkix/src/X520Name/PCreate.c delete mode 100644 security/nss/lib/pkix/src/X520Name/PCreateFromUTF8.c delete mode 100644 security/nss/lib/pkix/src/X520Name/PDecode.c delete mode 100644 security/nss/lib/pkix/src/X520Name/PDestroy.c delete mode 100644 security/nss/lib/pkix/src/X520Name/PDuplicate.c delete mode 100644 security/nss/lib/pkix/src/X520Name/PEncode.c delete mode 100644 security/nss/lib/pkix/src/X520Name/PEqual.c delete mode 100644 security/nss/lib/pkix/src/X520Name/PGetUTF8Encoding.c delete mode 100644 security/nss/lib/pkix/src/X520Name/template.c delete mode 100644 security/nss/lib/pkix/src/X520Name/verifyPointer.c (limited to 'security/nss/lib/pkix/src') diff --git a/security/nss/lib/pkix/src/AlgorithmIdentifier/Create.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/Create.c deleted file mode 100644 index cf95b4e26..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/Decode.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/Decode.c deleted file mode 100644 index 1e4e47b03..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/Destroy.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/Destroy.c deleted file mode 100644 index f2a901151..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/Duplicate.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/Duplicate.c deleted file mode 100644 index 186ab49bc..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/Encode.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/Encode.c deleted file mode 100644 index d390b3595..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/Equal.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/Equal.c deleted file mode 100644 index 65c52a2ba..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/GetAlgorithm.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/GetAlgorithm.c deleted file mode 100644 index be7493a66..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/GetParameters.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/GetParameters.c deleted file mode 100644 index e94622e23..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/MClear.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/MClear.c deleted file mode 100644 index 0797fbd49..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PCreate.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PCreate.c deleted file mode 100644 index c527a6a56..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PDecode.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PDecode.c deleted file mode 100644 index 9713d34db..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PDestroy.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PDestroy.c deleted file mode 100644 index 7ef4d1fe1..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PDuplicate.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PDuplicate.c deleted file mode 100644 index ae3cf72b2..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PEncode.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PEncode.c deleted file mode 100644 index c9939350a..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PEqual.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PEqual.c deleted file mode 100644 index 423dfdb74..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetAlgorithm.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetAlgorithm.c deleted file mode 100644 index 4c7c37b6e..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetParameters.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PGetParameters.c deleted file mode 100644 index 5d6f1decb..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetAlgorithm.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetAlgorithm.c deleted file mode 100644 index ccf9f23e2..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetParameters.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/PSetParameters.c deleted file mode 100644 index d5a7e8424..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/SetAlgorithm.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/SetAlgorithm.c deleted file mode 100644 index d829643e0..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/SetParameters.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/SetParameters.c deleted file mode 100644 index d751fb689..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/AlgorithmIdentifier/verifyPointer.c b/security/nss/lib/pkix/src/AlgorithmIdentifier/verifyPointer.c deleted file mode 100644 index c9a9f8072..000000000 --- a/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$ $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_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/security/nss/lib/pkix/src/Attribute/AddValue.c b/security/nss/lib/pkix/src/Attribute/AddValue.c deleted file mode 100644 index aad082c50..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/Create.c b/security/nss/lib/pkix/src/Attribute/Create.c deleted file mode 100644 index 9fe406b2d..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/CreateFromArray.c b/security/nss/lib/pkix/src/Attribute/CreateFromArray.c deleted file mode 100644 index 2928c3bcc..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/Decode.c b/security/nss/lib/pkix/src/Attribute/Decode.c deleted file mode 100644 index a16f195cd..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/Destroy.c b/security/nss/lib/pkix/src/Attribute/Destroy.c deleted file mode 100644 index bd9454fca..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/Duplicate.c b/security/nss/lib/pkix/src/Attribute/Duplicate.c deleted file mode 100644 index 146a49610..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/Encode.c b/security/nss/lib/pkix/src/Attribute/Encode.c deleted file mode 100644 index 179bd3d68..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/Equal.c b/security/nss/lib/pkix/src/Attribute/Equal.c deleted file mode 100644 index d91782aea..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/FindValue.c b/security/nss/lib/pkix/src/Attribute/FindValue.c deleted file mode 100644 index ba725051f..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/GetType.c b/security/nss/lib/pkix/src/Attribute/GetType.c deleted file mode 100644 index 0bae2b988..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/GetValue.c b/security/nss/lib/pkix/src/Attribute/GetValue.c deleted file mode 100644 index afce8d135..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/GetValueCount.c b/security/nss/lib/pkix/src/Attribute/GetValueCount.c deleted file mode 100644 index 0cdc36b60..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/GetValues.c b/security/nss/lib/pkix/src/Attribute/GetValues.c deleted file mode 100644 index 986af03d1..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/MClear.c b/security/nss/lib/pkix/src/Attribute/MClear.c deleted file mode 100644 index 6fb77ba7d..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/MCount.c b/security/nss/lib/pkix/src/Attribute/MCount.c deleted file mode 100644 index abb0831cb..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/MVCreate.c b/security/nss/lib/pkix/src/Attribute/MVCreate.c deleted file mode 100644 index 1a54026d4..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PAddValue.c b/security/nss/lib/pkix/src/Attribute/PAddValue.c deleted file mode 100644 index 732845490..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PCreate.c b/security/nss/lib/pkix/src/Attribute/PCreate.c deleted file mode 100644 index 40dc5c07c..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c b/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c deleted file mode 100644 index c2d301d12..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PDecode.c b/security/nss/lib/pkix/src/Attribute/PDecode.c deleted file mode 100644 index 49a059404..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PDestroy.c b/security/nss/lib/pkix/src/Attribute/PDestroy.c deleted file mode 100644 index 5f2b5a135..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PDuplicate.c b/security/nss/lib/pkix/src/Attribute/PDuplicate.c deleted file mode 100644 index 765510e59..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PEncode.c b/security/nss/lib/pkix/src/Attribute/PEncode.c deleted file mode 100644 index 7fc647ed2..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PEqual.c b/security/nss/lib/pkix/src/Attribute/PEqual.c deleted file mode 100644 index 247bfd575..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PFindValue.c b/security/nss/lib/pkix/src/Attribute/PFindValue.c deleted file mode 100644 index 0f1095f0c..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PGetType.c b/security/nss/lib/pkix/src/Attribute/PGetType.c deleted file mode 100644 index 4b61431b8..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PGetValue.c b/security/nss/lib/pkix/src/Attribute/PGetValue.c deleted file mode 100644 index bbf12ca67..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PGetValueCount.c b/security/nss/lib/pkix/src/Attribute/PGetValueCount.c deleted file mode 100644 index ada1d403d..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PGetValues.c b/security/nss/lib/pkix/src/Attribute/PGetValues.c deleted file mode 100644 index ccc11dbe0..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PRemoveValue.c b/security/nss/lib/pkix/src/Attribute/PRemoveValue.c deleted file mode 100644 index 6da2ebc07..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PSetType.c b/security/nss/lib/pkix/src/Attribute/PSetType.c deleted file mode 100644 index 8f430aab3..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PSetValue.c b/security/nss/lib/pkix/src/Attribute/PSetValue.c deleted file mode 100644 index 4fd490a6a..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/PSetValues.c b/security/nss/lib/pkix/src/Attribute/PSetValues.c deleted file mode 100644 index 64df8eb55..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/RemoveValue.c b/security/nss/lib/pkix/src/Attribute/RemoveValue.c deleted file mode 100644 index e869fd96a..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/SetType.c b/security/nss/lib/pkix/src/Attribute/SetType.c deleted file mode 100644 index 4975c8f8a..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/SetValue.c b/security/nss/lib/pkix/src/Attribute/SetValue.c deleted file mode 100644 index 43f74ad26..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/SetValues.c b/security/nss/lib/pkix/src/Attribute/SetValues.c deleted file mode 100644 index 7c3645cf7..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/template.c b/security/nss/lib/pkix/src/Attribute/template.c deleted file mode 100644 index 850b6a9b0..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/Attribute/verifyPointer.c b/security/nss/lib/pkix/src/Attribute/verifyPointer.c deleted file mode 100644 index c0ae3ed84..000000000 --- a/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$ $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_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/security/nss/lib/pkix/src/AttributeTypeAndValue/Create.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/Create.c deleted file mode 100644 index 84e721f80..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttributeTypeAndValue_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 - * - * Return value: - * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -NSSPKIXAttributeTypeAndValue_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - NSSPKIXAttributeValue *value -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue(arenaOpt, typeOid, value); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/CreateFromUTF8.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/CreateFromUTF8.c deleted file mode 100644 index 72e0a3114..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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 */ - -/* - * NSSPKIXAttributeTypeAndValue_CreateFromUTF8 - * - * - * - * 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 NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -NSSPKIXAttributeTypeAndValue_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *string -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } - - if( (NSSUTF8 *)NULL == string ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXAttributeTypeAndValue *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_CreateFromUTF8(arenaOpt, string); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/Decode.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/Decode.c deleted file mode 100644 index 33b657303..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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 */ - -/* - * NSSPKIXAttributeTypeAndValue_Decode - * - * - * - * 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 NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -NSSPKIXAttributeTypeAndValue_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_Decode(arenaOpt, ber); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/Destroy.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/Destroy.c deleted file mode 100644 index b3c28a03f..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttributeTypeAndValue_Destroy - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttributeTypeAndValue_Destroy -( - NSSPKIXAttributeTypeAndValue *atav -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_Destroy(atav); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/Duplicate.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/Duplicate.c deleted file mode 100644 index 09d1f27c3..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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 */ - -/* - * NSSPKIXAttributeTypeAndValue_Duplicate - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -NSSPKIXAttributeTypeAndValue_Duplicate -( - NSSPKIXAttributeTypeAndValue *atav, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_Duplicate(atav, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/Encode.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/Encode.c deleted file mode 100644 index 1b67be84d..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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 */ - -/* - * NSSPKIXAttributeTypeAndValue_Encode - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXAttributeTypeAndValue_Encode -( - NSSPKIXAttributeTypeAndValue *atav, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_Encode(atav, encoding, rvOpt, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/Equal.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/Equal.c deleted file mode 100644 index 0cbf06eca..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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 */ - -/* - * NSSPKIXAttributeTypeAndValue_Equal - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -NSSPKIXAttributeTypeAndValue_Equal -( - NSSPKIXAttributeTypeAndValue *atav1, - NSSPKIXAttributeTypeAndValue *atav2, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav1) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav2) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_Equal(atav1, atav2, statusOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/GetType.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/GetType.c deleted file mode 100644 index 68e2f48f6..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/GetType.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 */ - -/* - * NSSPKIXAttributeTypeAndValue_GetType - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSPKIXAttributeType pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeType * -NSSPKIXAttributeTypeAndValue_GetType -( - NSSPKIXAttributeTypeAndValue *atav -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return (NSSPKIXAttributeType *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_GetType(atav); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/GetUTF8Encoding.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/GetUTF8Encoding.c deleted file mode 100644 index 611e4bcb9..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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 */ - -/* - * NSSPKIXAttributeTypeAndValue_GetUTF8Encoding - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSUTF8 pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -NSSPKIXAttributeTypeAndValue_GetUTF8Encoding -( - NSSPKIXAttributeTypeAndValue *atav, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_GetUTF8Encoding(atav, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/GetValue.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/GetValue.c deleted file mode 100644 index 5516c63ea..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/GetValue.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 */ - -/* - * NSSPKIXAttributeTypeAndValue_GetValue - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSAttributeValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -NSSPKIXAttributeTypeAndValue_GetValue -( - NSSPKIXAttributeTypeAndValue *atav, - NSSPKIXAttributeValue *itemOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_GetValue(atav, itemOpt, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/MClear.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/MClear.c deleted file mode 100644 index eeae7db86..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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_AttributeTypeAndValue_Clear - * - * Wipes out cached data. - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_AttributeTypeAndValue_Clear -( - NSSPKIXAttributeTypeAndValue *atav -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSBER *)NULL != atav->ber ) { - nss_ZFreeIf(atav->ber->data); - nss_ZFreeIf(atav->ber); - } - - if( (NSSDER *)NULL != atav->der ) { - nss_ZFreeIf(atav->der->data); - nss_ZFreeIf(atav->der); - } - - nss_ZFreeIf(atav->utf8); - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PCreate.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PCreate.c deleted file mode 100644 index 2dc6d8ac5..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PCreate.c +++ /dev/null @@ -1,154 +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 */ - -/* - * nssPKIXAttributeTypeAndValue_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 - * - * Return value: - * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -nssPKIXAttributeTypeAndValue_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - NSSPKIXAttributeValue *value -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttributeTypeAndValue *rv = (NSSPKIXAttributeTypeAndValue *)NULL; - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } -#endif /* DEBUG */ - - 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, NSSPKIXAttributeTypeAndValue); - if( (NSSPKIXAttributeTypeAndValue *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->type = typeOid; - - { - NSSItem tmp; - if( (NSSItem *)NULL == nssOID_GetDEREncoding(typeOid, arena, &tmp) ) { - goto loser; - } - - rv->asn1type.size = tmp.size; - rv->asn1type.data = tmp.data; - } - - { - NSSItem tmp; - if( (NSSItem *)NULL == nssItem_Duplicate(value, arena, &tmp) ) { - goto loser; - } - - rv->asn1value.size = tmp.size; - rv->asn1value.data = tmp.data; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_AttributeTypeAndValue_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 (NSSPKIXAttributeTypeAndValue *)NULL; -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PCreateFromUTF8.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PCreateFromUTF8.c deleted file mode 100644 index a2fa289ea..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PCreateFromUTF8.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttributeTypeAndValue_CreateFromUTF8 - * - * - * - * 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 NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -nssPKIXAttributeTypeAndValue_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *string -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttributeTypeAndValue *rv = (NSSPKIXAttributeTypeAndValue *)NULL; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } - - if( (NSSUTF8 *)NULL == string ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXAttributeTypeAndValue *)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, NSSPKIXAttributeTypeAndValue); - if( (NSSPKIXAttributeTypeAndValue *)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; - } - - /* Fill this in later from ../pki1/atav.c implementation */ - 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_AttributeTypeAndValue_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 (NSSPKIXAttributeTypeAndValue *)NULL; -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PDecode.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PDecode.c deleted file mode 100644 index 9e017526c..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PDecode.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttributeTypeAndValue_Decode - * - * - * - * 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 NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -nssPKIXAttributeTypeAndValue_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttributeTypeAndValue *rv = (NSSPKIXAttributeTypeAndValue *)NULL; - PRStatus status; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAttributeTypeAndValue *)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, NSSPKIXAttributeTypeAndValue); - if( (NSSPKIXAttributeTypeAndValue *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - /* For this object, BER is DER */ - rv->der = nssItem_Duplicate(ber, arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == rv->ber ) { - goto loser; - } - - status = nssASN1_DecodeBER(arena, rv, - nssPKIXAttributeTypeAndValue_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_AttributeTypeAndValue_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 (NSSPKIXAttributeTypeAndValue *)NULL; -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PDestroy.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PDestroy.c deleted file mode 100644 index 47242f545..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PDestroy.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttributeTypeAndValue_Destroy - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttributeTypeAndValue_Destroy -( - NSSPKIXAttributeTypeAndValue *atav -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - -#ifdef DEBUG - (void)nss_pkix_AttributeTypeAndValue_remove_pointer(atav); - (void)nssArena_RemoveDestructor(arena, - nss_pkix_AttributeTypeAndValue_remove_pointer, atav); -#endif /* DEBUG */ - - if( PR_TRUE == atav->i_allocated_arena ) { - return nssArena_Destroy(atav->arena); - } - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PDuplicate.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PDuplicate.c deleted file mode 100644 index 53fc85171..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PDuplicate.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttributeTypeAndValue_Duplicate - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -nssPKIXAttributeTypeAndValue_Duplicate -( - NSSPKIXAttributeTypeAndValue *atav, - NSSArena *arenaOpt -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttributeTypeAndValue *rv = (NSSPKIXAttributeTypeAndValue *)NULL; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)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, NSSPKIXAttributeTypeAndValue); - if( (NSSPKIXAttributeTypeAndValue *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - if( (NSSDER *)NULL != atav->der ) { - rv->der = nssItem_Duplicate(atav->der, arena, (NSSItem *)NULL); - if( (NSSDER *)NULL == rv->der ) { - goto loser; /* actually, this isn't fatal */ - } - } - - { - NSSItem src, dst; - src.size = atav->asn1type.size; - src.data = atav->asn1type.data; - if( (NSSItem *)NULL == nssItem_Duplicate(&src, arena, &dst) ) { - goto loser; - } - rv->asn1type.size = dst.size; - rv->asn1type.data = dst.data; - } - - { - NSSItem src, dst; - src.size = atav->asn1value.size; - src.data = atav->asn1value.data; - if( (NSSItem *)NULL == nssItem_Duplicate(&src, arena, &dst) ) { - goto loser; - } - rv->asn1value.size = dst.size; - rv->asn1value.data = dst.data; - } - - rv->type = atav->type; - - if( (NSSUTF8 *)NULL != atav->utf8 ) { - rv->utf8 = nssUTF8_Duplicate(atav->utf8, arena); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; /* actually, this isn't fatal */ - } - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_AttributeTypeAndValue_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 (NSSPKIXAttributeTypeAndValue *)NULL; -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PEncode.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PEncode.c deleted file mode 100644 index 64a77e590..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PEncode.c +++ /dev/null @@ -1,101 +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 */ - -/* - * nssPKIXAttributeTypeAndValue_Encode - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_EXTERN NSSBER * -nssPKIXAttributeTypeAndValue_Encode -( - NSSPKIXAttributeTypeAndValue *atav, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* NSSDEBUG */ - - switch( encoding ) { - case NSSASN1BER: - case NSSASN1DER: - break; - case NSSASN1CER: - case NSSASN1LWER: - case NSSASN1PER: - default: - nss_SetError(NSS_ERROR_UNSUPPORTED_ENCODING); - return (NSSBER *)NULL; - } - - /* For this item its DER is BER */ - - if( (NSSDER *)NULL == atav->der ) { - atav->der = nssASN1_EncodeDER(atav->arena, (NSSItem *)NULL, a, - nssPKIXAtributeTypeAndValue_template, NSSASN1DER); - if( (NSSDER *)NULL == atav->der ) { - return (NSSBER *)NULL; - } - } - - return nssItem_Duplicate(a->der, arenaOpt, rvOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PEqual.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PEqual.c deleted file mode 100644 index 67dc970f1..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PEqual.c +++ /dev/null @@ -1,95 +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 */ - -/* - * nssPKIXAttributeTypeAndValue_Equal - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -nssPKIXAttributeTypeAndValue_Equal -( - NSSPKIXAttributeTypeAndValue *atav1, - NSSPKIXAttributeTypeAndValue *atav2, - PRStatus *statusOpt -) -{ - NSSItem one, two; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav1) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav2) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_SUCCESS; - } - - one.size = atav1->asn1type.size; - one.data = atav1->asn1type.data; - two.size = atav2->asn1type.size; - two.data = atav2->asn1type.data; - - if( PR_FALSE == nssItem_Equal(&one, &two, statusOpt) ) { - return PR_FALSE; - } - - one.size = atav1->asn1value.size; - one.data = atav1->asn1value.data; - two.size = atav2->asn1value.size; - two.data = atav2->asn1value.data; - - return nssItem_Equal(&one, &two, statusOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PGetType.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PGetType.c deleted file mode 100644 index 20411e8ee..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PGetType.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttributeTypeAndValue_GetType - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSPKIXAttributeType pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeType * -nssPKIXAttributeTypeAndValue_GetType -( - NSSPKIXAttributeTypeAndValue *atav -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSPKIXAttributeType *)NULL == atav->type ) { - NSSItem ber; - - ber.size = atav->asn1type.size; - ber.data = atav->asn1type.data; - - atav->type = (NSSPKIXAttributeType *)NSSOID_CreateFromBER(&ber); - } - - return atav->type; -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PGetUTF8Encoding.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PGetUTF8Encoding.c deleted file mode 100644 index 41145b3cf..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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 */ - -/* - * nssPKIXAttributeTypeAndValue_GetUTF8Encoding - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSUTF8 pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -nssPKIXAttributeTypeAndValue_GetUTF8Encoding -( - NSSPKIXAttributeTypeAndValue *atav, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSUTF8 *)NULL == atav->utf8 ) { - /* xxx fgmr fill this in from the ../pki1/atav.c implementation */ - } - - return nssUTF8_Duplicate(atav->utf8, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PGetValue.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PGetValue.c deleted file mode 100644 index 33f9e5b2b..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PGetValue.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttributeTypeAndValue_GetValue - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSAttributeValue upon success - * NULL upon failure - */ - -NSS_EXTERN NSSPKIXAttributeValue * -nssPKIXAttributeTypeAndValue_GetValue -( - NSSPKIXAttributeTypeAndValue *atav, - NSSPKIXAttributeValue *rvOpt, - NSSArena *arenaOpt -) -{ - NSSItem tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSDER *)NULL; - } - } -#endif /* NSSDEBUG */ - - tmp.size = atav->asn1value.size; - tmp.data = atav->asn1value.data; - - return nssItem_Duplicate(&tmp, arenaOpt, rvOpt); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PSetType.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PSetType.c deleted file mode 100644 index 4e25b88cc..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PSetType.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttributeTypeAndValue_SetType - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_OID - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_EXTERN PRStatus -nssPKIXAttributeTypeAndValue_SetType -( - NSSPKIXAttributeTypeAndValue *atav, - NSSPKIXAttributeType *attributeType -) -{ - NSSDER tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssOID_verifyPointer(attributeType) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - atav->type = attributeType; - - nss_ZFreeIf(atav->asn1type.data); - if( (NSSDER *)NULL == nssOID_GetDEREncoding(atav->type, &tmp, atav->arena) ) { - return PR_FAILURE; - } - - atav->asn1type.size = tmp.size; - atav->asn1type.data = tmp.data; - - return nss_pkix_AttributeTypeAndValue_Clear(atav); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/PSetValue.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/PSetValue.c deleted file mode 100644 index 82de4db00..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/PSetValue.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 */ - -/* - * nssPKIXAttributeTypeAndValue_SetValue - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttributeTypeAndValue_SetValue -( - NSSPKIXAttributeTypeAndValue *atav, - NSSPKIXAttributeValue *value -) -{ - NSSItem tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSItem *)NULL == nssItem_Duplicate(value, atav->arena, &tmp) ) { - return PR_FAILURE; - } - - nss_ZFreeIf(atav->asn1value.data); - atav->asn1value.size = tmp.size; - atav->asn1value.data = tmp.data; - - return nss_pkix_AttributeTypeAndValue_Clear(atav); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/SetType.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/SetType.c deleted file mode 100644 index 672b7b738..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/SetType.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 */ - -/* - * NSSPKIXAttributeTypeAndValue_SetType - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_OID - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttributeTypeAndValue_SetType -( - NSSPKIXAttributeTypeAndValue *atav, - NSSPKIXAttributeType *attributeType -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssOID_verifyPointer(attributeType) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_SetType(atav, attributeType); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/SetValue.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/SetValue.c deleted file mode 100644 index fafc54d6c..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/SetValue.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttributeTypeAndValue_SetValue - * - * - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttributeTypeAndValue_SetValue -( - NSSPKIXAttributeTypeAndValue *atav, - NSSPKIXAttributeValue *value -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttributeTypeAndValue_SetValue(atav, value); -} diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/template.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/template.c deleted file mode 100644 index 548a4fac9..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/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 */ - -/* - * nssPKIXAttributeTypeAndValue_template - * - */ - -const nssASN1Template nssPKIXAttributeTypeAndValue_template[] = { - { nssASN1_SEQUENCE, 0, NULL, sizeof(NSSPKIXAttributeTypeAndValue) }, - { nssASN1_OBJECT_ID, offsetof(NSSPKIXAttributeTypeAndValue, asn1type) }, - { nssASN1_ANY, offsetof(NSSPKIXAttributeTypeAndValue, asn1value) }, - { 0 } -}; diff --git a/security/nss/lib/pkix/src/AttributeTypeAndValue/verifyPointer.c b/security/nss/lib/pkix/src/AttributeTypeAndValue/verifyPointer.c deleted file mode 100644 index 340e19c1b..000000000 --- a/security/nss/lib/pkix/src/AttributeTypeAndValue/verifyPointer.c +++ /dev/null @@ -1,184 +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_atav_pointer_tracker; - -/* - * nss_pkix_AttributeTypeAndValue_add_pointer - * - * This method is only present in debug builds. - * - * This module-private routine adds an NSSPKIXAttributeTypeAndValue - * 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_AttributeTypeAndValue_add_pointer -( - const NSSPKIXAttributeTypeAndValue *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_atav_pointer_tracker); - if( PR_SUCCESS != rv ) { - return rv; - } - - rv = nssPointerTracker_add(&pkix_atav_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(arena, - nss_pkix_AttributeTypeAndValue_remove_pointer, p); - if( PR_SUCCESS != rv ) { - (void)nss_pkix_AttributeTypeAndValue_remove_pointer(p); - return rv; - } - - return PR_SUCCESS; -} - -/* - * nss_pkix_AttributeTypeAndValue_remove_pointer - * - * This method is only present in debug builds. - * - * This module-private routine removes a valid - * NSSPKIXAttributeTypeAndValue 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_AttributeTypeAndValue_remove_pointer -( - const NSSPKIXAttributeTypeAndValue *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_remove(&pkix_atav_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - /* - * nssArena_deregisterDestructor(p->arena, - * nss_pkix_AttributeTypeAndValue_remove_pointer, p); - */ - - return rv; -} - -/* - * nssPKIXAttributeTypeAndValue_verifyPointer - * - * This method is only present in debug builds. - * - * If the specified pointer is a valid pointer to an - * NSSPKIXAttributeTypeAndValue 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 -nssPKIXAttributeTypeAndValue_verifyPointer -( - NSSPKIXAttributeTypeAndValue *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_atav_pointer_tracker); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - rv = nssPointerTracker_verify(&pkix_atav_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/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 */ - diff --git a/security/nss/lib/pkix/src/RDNSequence/AppendRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/AppendRelativeDistinguishedName.c deleted file mode 100644 index 4e0d0d018..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/AppendRelativeDistinguishedName.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRDNSequence_AppendRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRDNSequence_AppendRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - NSSPKIXRelativeDistinguishedName *rdn -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_AppendRelativeDistinguishedName(rdnseq, rdn); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/Create.c b/security/nss/lib/pkix/src/RDNSequence/Create.c deleted file mode 100644 index 52b8a851c..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/Create.c +++ /dev/null @@ -1,125 +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 */ - -/* - * NSSPKIXRDNSequence_Create - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * A valid pointer to an NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -NSSPKIXRDNSequence_Create -( - NSSArena *arenaOpt, - NSSPKIXRelativeDistinguishedName *rdn1, - ... -) -{ - va_list ap; - NSSPKIXRDNSequence *rv; - PRUint32 count; - - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)NULL; - } - } - - /* Is there a nonzero minimum number of RDNs required? */ - - { - va_start(ap, arenaOpt); - - while( 1 ) { - NSSPKIXRelativeDistinguishedName *rdn; - rdn = (NSSPKIXRelativeDistinguishedName *)va_arg(ap, NSSPKIXRelativeDistinguishedName *); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rdn ) { - break; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - va_end(ap); - return (NSSPKIXRDNSequence *)NULL; - } - } - - va_end(ap); - } -#endif /* DEBUG */ - - va_start(ap, arenaOpt); - - for( count = 0; ; count++ ) { - NSSPKIXRelativeDistinguishedName *rdn; - rdn = (NSSPKIXRelativeDistinguishedName *)va_arg(ap, NSSPKIXRelativeDistinguishedName *); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rdn ) { - break; - } - -#ifdef PEDANTIC - if( count == 0xFFFFFFFF ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - va_end(ap); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* PEDANTIC */ - } - - va_end(ap); - - va_start(ap, arenaOpt); - rv = nss_pkix_RDNSequence_V_Create(arenaOpt, count, ap); - va_end(ap); - - return rv; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/CreateFromArray.c b/security/nss/lib/pkix/src/RDNSequence/CreateFromArray.c deleted file mode 100644 index b6412187c..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/CreateFromArray.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRDNSequence_CreateFromArray - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * A valid pointer to an NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -NSSPKIXRDNSequence_Create -( - NSSArena *arenaOpt, - PRUint32 count, - NSSPKIXRelativeDistinguishedName *rdns[] -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - { - PRUint32 i; - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(&rdns[i]) ) { - return (NSSPKIXAttribute *)NULL; - } - } - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_CreateFromArray(arenaOpt, count, rnds); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/CreateFromUTF8.c b/security/nss/lib/pkix/src/RDNSequence/CreateFromUTF8.c deleted file mode 100644 index dcdbc54a2..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * NSSPKIXRDNSequence_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 NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -NSSPKIXRDNSequence_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *string -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)NULL; - } - } - - if( (NSSUTF8 *)NULL == string ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXRDNSequence *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_CreateFromUTF8(arenaOpt, string); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/Decode.c b/security/nss/lib/pkix/src/RDNSequence/Decode.c deleted file mode 100644 index ebbad116a..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * NSSPKIXRDNSequence_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 NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -NSSPKIXRDNSequence_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXRDNSequence *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_Decode(arenaOpt, ber); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/Destroy.c b/security/nss/lib/pkix/src/RDNSequence/Destroy.c deleted file mode 100644 index 5962364e5..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRDNSequence_Destroy - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRDNSequence_Destroy -( - NSSPKIXRDNSequence *rdnseq -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_Destroy(rdnseq); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/Duplicate.c b/security/nss/lib/pkix/src/RDNSequence/Duplicate.c deleted file mode 100644 index 2bf53ba59..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * NSSPKIXRDNSequence_Duplicate - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -NSSPKIXRDNSequence_Duplicate -( - NSSPKIXRDNSequence *rdnseq, - 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 nssPKIXRDNSequence_Duplicate(rdnseq, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/Encode.c b/security/nss/lib/pkix/src/RDNSequence/Encode.c deleted file mode 100644 index 84ab4db67..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * NSSPKIXRDNSequence_Encode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXRDNSequence_Encode -( - NSSPKIXRDNSequence *rdnseq, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_Encode(rdnseq, encoding, rvOpt, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/Equal.c b/security/nss/lib/pkix/src/RDNSequence/Equal.c deleted file mode 100644 index fe0fa0f07..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * NSSPKIXRDNSequence_Equal - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -NSSPKIXRDNSequence_Equal -( - NSSPKIXRDNSequence *one, - NSSPKIXRDNSequence *two, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(one) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(two) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_Equal(one, two, statusOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/FindRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/FindRelativeDistinguishedName.c deleted file mode 100644 index cb04286d3..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/FindRelativeDistinguishedName.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRDNSequence_FindRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_PKIX_RDN - * 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 -NSSPKIXRDNSequence_FindRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - NSSPKIXRelativeDistinguishedName *rdn -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_FindRelativeDistinguishedName(rdnseq, rdn); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedName.c deleted file mode 100644 index 9b152f4da..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedName.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 */ - -/* - * NSSPKIXRDNSequence_GetRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -NSSPKIXRDNSequence_GetRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - PRInt32 i, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_GetRelativeDistinguishedName(rdnseq, i, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedNameCount.c b/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedNameCount.c deleted file mode 100644 index 05b5e89b4..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedNameCount.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 */ - -/* - * NSSPKIXRDNSequence_GetRelativeDistinguishedNameCount - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * Nonnegative integer upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -NSSPKIXRDNSequence_GetRelativeDistinguishedNameCount -( - NSSPKIXRDNSequence *rdnseq -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return -1; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_GetRelativeDistinguishedNameCount(rdnseq); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedNames.c b/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedNames.c deleted file mode 100644 index 06d419bed..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/GetRelativeDistinguishedNames.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 */ - -/* - * NSSPKIXRDNSequence_GetRelativeDistinguishedNames - * - * This routine returns all of the relative distinguished names in the - * specified RDN Sequence. {...} If the array is allocated, or if the - * specified one has extra space, the array will be null-terminated. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * A valid pointer to an array of NSSPKIXRelativeDistinguishedName - * pointers upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName ** -NSSPKIXRDNSequence_GetRelativeDistinguishedNames -( - NSSPKIXRDNSequence *rdnseq, - NSSPKIXRelativeDistinguishedName *rvOpt[], - PRInt32 limit, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSPKIXRelativeDistinguishedName **)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXRelativeDistinguishedName **)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_GetRelativeDistinguishedNames(rdnseq, rvOpt, limit, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/GetUTF8Encoding.c b/security/nss/lib/pkix/src/RDNSequence/GetUTF8Encoding.c deleted file mode 100644 index 4519a5ba4..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * NSSPKIXRDNSequence_GetUTF8Encoding - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSUTF8 pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -NSSPKIXRDNSequence_GetUTF8Encoding -( - NSSPKIXRDNSequence *rdnseq, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_GetUTF8Encoding(rdnseq, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/InsertRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/InsertRelativeDistinguishedName.c deleted file mode 100644 index 433c2a315..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/InsertRelativeDistinguishedName.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 */ - -/* - * NSSPKIXRDNSequence_InsertRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRDNSequence_InsertRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - PRInt32 i, - NSSPKIXRelativeDistinguishedName *rdn -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_InsertRelativeDistinguishedName(rdnseq, i, rdn); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/MClear.c b/security/nss/lib/pkix/src/RDNSequence/MClear.c deleted file mode 100644 index 7df7eb099..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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_RDNSequence_Clear - * - * Wipes out cached data. - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_RDNSequence_Clear -( - NSSPKIXRDNSequence *rdnseq -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSBER *)NULL != rdnseq->ber ) { - nss_ZFreeIf(rdnseq->ber->data); - nss_ZFreeIf(rdnseq->ber); - } - - if( (NSSDER *)NULL != rdnseq->der ) { - nss_ZFreeIf(rdnseq->der->data); - nss_ZFreeIf(rdnseq->der); - } - - nss_ZFreeIf(rdnseq->utf8); - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/MCount.c b/security/nss/lib/pkix/src/RDNSequence/MCount.c deleted file mode 100644 index 649721c9f..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/MCount.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_RDNSequence_Count - */ - -NSS_IMPLEMENT void -nss_pkix_RDNSequence_Count -( - NSSPKIXRDNSequence *rdnseq -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((NSSPKIXRelativeDistinguishedName **)NULL != rdnseq->rdns); - if( (NSSPKIXRelativeDistinguishedName **)NULL == rdnseq->rdns ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - return PR_FAILURE; - } - - if( 0 == rdnseq->count ) { - PRUint32 i; - for( i = 0; i < 0xFFFFFFFF; i++ ) { - if( (NSSPKIXRelativeDistinguishedName *)NULL == rdnseq->rdns[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0xFFFFFFFF == i ) { - return; - } -#endif /* PEDANTIC */ - - rdnseq->count = i; - } - - return; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/MVCreate.c b/security/nss/lib/pkix/src/RDNSequence/MVCreate.c deleted file mode 100644 index caeb1995f..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/MVCreate.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nss_pkix_RDNSequence_v_create - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -nss_pkix_RDNSequence_v_create -( - NSSArena *arenaOpt, - PRUint32 count, - va_list ap -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRDNSequence *rv = (NSSPKIXRDNSequence *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)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, NSSPKIXRDNSequence); - if( (NSSPKIXRDNSequence *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->count = count; - - rv->rdns = nss_ZNEWARRAY(arena, NSSPKIXRelativeDistinguishedName *, count); - if( (NSSPKIXRelativeDistinguishedName **)NULL == rv->rdns ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSPKIXRelativeDistinguishedName *v = (NSSPKIXRelativeDistinguishedName *) - va_arg(ap, NSSPKIXRelativeDistinguishedName *); - -#ifdef NSSDEBUG - /* - * It's okay to test this down here, since - * supposedly these have already been checked. - */ - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(v) ) { - goto loser; - } -#endif /* NSSDEBUG */ - - rv->rdns[i] = nssPKIXRelativeDistinguishedName_Duplicate(v, arena); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rv->rdns[i] ) { - goto loser; - } - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_RDNSequence_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 (NSSPKIXRDNSequence *)NULL; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PAppendRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/PAppendRelativeDistinguishedName.c deleted file mode 100644 index 9d1ea4875..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PAppendRelativeDistinguishedName.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRDNSequence_AppendRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRDNSequence_AppendRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - NSSPKIXRelativeDistinguishedName *rdn -) -{ - NSSPKIXRelativeDistinguishedName **na; - NSSPKIXRelativeDistinguishedName *dup; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( 0 == rdnseq->count ) { - nss_pkix_RDNSequence_Count(rdnseq); - } - -#ifdef PEDANTIC - if( 0 == rdnseq->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* PEDANTIC */ - - na = (NSSPKIXRelativeDistinguishedName **) - nss_ZRealloc(rdnseq->rdns, ((rdnseq->count+2) * - sizeof(NSSPKIXRelativeDistinguishedName *))); - if( (NSSPKIXRelativeDistinguishedName **)NULL == na ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - rdnseq->rdns = na; - - dup = nssPKIXRelativeDistinguishedName_Duplicate(rdn, rdnseq->arena); - if( (NSSPKIXRelativeDistinguishedName *)NULL == dup ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - na[ rdnseq->count++ ] = dup; - - return nss_pkix_RDNSequence_Clear(rdnseq); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PCreate.c b/security/nss/lib/pkix/src/RDNSequence/PCreate.c deleted file mode 100644 index 0fdc6848f..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PCreate.c +++ /dev/null @@ -1,123 +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 */ - -/* - * nssPKIXRDNSequence_Create - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * A valid pointer to an NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -nssPKIXRDNSequence_Create -( - NSSArena *arenaOpt, - NSSPKIXRelativeDistinguishedName *rdn1, - ... -) -{ - va_list ap; - NSSPKIXRDNSequence *rv; - PRUint32 count; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)NULL; - } - } - - /* Is there a nonzero minimum number of RDNs required? */ - - { - va_start(ap, arenaOpt); - - while( 1 ) { - NSSPKIXRelativeDistinguishedName *rdn; - rdn = (NSSPKIXRelativeDistinguishedName *)va_arg(ap, NSSPKIXRelativeDistinguishedName *); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rdn ) { - break; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - va_end(ap); - return (NSSPKIXRDNSequence *)NULL; - } - } - - va_end(ap); - } -#endif /* NSSDEBUG */ - - va_start(ap, arenaOpt); - - for( count = 0; ; count++ ) { - NSSPKIXRelativeDistinguishedName *rdn; - rdn = (NSSPKIXRelativeDistinguishedName *)va_arg(ap, NSSPKIXRelativeDistinguishedName *); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rdn ) { - break; - } - -#ifdef PEDANTIC - if( count == 0xFFFFFFFF ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - va_end(ap); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* PEDANTIC */ - } - - va_end(ap); - - va_start(ap, arenaOpt); - rv = nss_pkix_RDNSequence_V_Create(arenaOpt, count, ap); - va_end(ap); - - return rv; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PCreateFromArray.c b/security/nss/lib/pkix/src/RDNSequence/PCreateFromArray.c deleted file mode 100644 index 0e244cb73..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PCreateFromArray.c +++ /dev/null @@ -1,151 +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 */ - -/* - * nssPKIXRDNSequence_CreateFromArray - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * A valid pointer to an NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -nssPKIXRDNSequence_CreateFromArray -( - NSSArena *arenaOpt, - PRUint32 count, - NSSPKIXRelativeDistinguishedName *rdns[] -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRDNSequence *rv = (NSSPKIXRDNSequence *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - { - PRUint32 i; - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(&rdns[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, NSSPKIXRDNSequence); - if( (NSSPKIXRDNSequence *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->count = count; - - rv->rdns = nss_ZNEWARRAY(arena, NSSPKIXRelativeDistinguishedName *, (count+1)); - if( (NSSPKIXRelativeDistinguishedName **)NULL == rv->rdns ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSPKIXRelativeDistinguishedName *v = rdns[i]; - - rv->rdns[i] = nssPKIXRelativeDistinguishedName_Duplicate(v, arena); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rv->rdns[i] ) { - goto loser; - } - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_RDNSequence_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 (NSSPKIXRDNSequence *)NULL; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PCreateFromUTF8.c b/security/nss/lib/pkix/src/RDNSequence/PCreateFromUTF8.c deleted file mode 100644 index 196332665..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PCreateFromUTF8.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRDNSequence_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 NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -nssPKIXRDNSequence_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *string -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRDNSequence *rv = (NSSPKIXRDNSequence *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)NULL; - } - } - - if( (NSSUTF8 *)NULL == string ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXRDNSequence *)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, NSSPKIXRDNSequence); - if( (NSSPKIXRDNSequence *)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_RDNSequence_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 (NSSPKIXRDNSequence *)NULL; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PDecode.c b/security/nss/lib/pkix/src/RDNSequence/PDecode.c deleted file mode 100644 index 557f5bc32..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * nssPKIXRDNSequence_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 NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -nssPKIXRDNSequence_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRDNSequence *rv = (NSSPKIXRDNSequence *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRDNSequence *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXRDNSequence *)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, NSSPKIXRDNSequence); - if( (NSSPKIXRDNSequence *)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, nssPKIXRDNSequence_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_RDNSequence_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 (NSSPKIXRDNSequence *)NULL; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PDestroy.c b/security/nss/lib/pkix/src/RDNSequence/PDestroy.c deleted file mode 100644 index 17cc846cf..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * nssPKIXRDNSequence_Destroy - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRDNSequence_Destroy -( - NSSPKIXRDNSequence *rdnseq -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - -#ifdef DEBUG - (void)nss_pkix_RDNSequence_remove_pointer(rdnseq); -#endif /* DEBUG */ - - if( PR_TRUE == rdnseq->i_allocated_arena ) { - return nssArena_Destroy(rdnseq->arena); - } - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PDuplicate.c b/security/nss/lib/pkix/src/RDNSequence/PDuplicate.c deleted file mode 100644 index a57828692..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PDuplicate.c +++ /dev/null @@ -1,177 +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 */ - -/* - * nssPKIXRDNSequence_Duplicate - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXRDNSequence upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRDNSequence * -nssPKIXRDNSequence_Duplicate -( - NSSPKIXRDNSequence *rdnseq, - NSSArena *arenaOpt -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRDNSequence *rv = (NSSPKIXRDNSequence *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXRelativeDistinguishedName *)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, NSSPKIXRDNSequence); - if( (NSSPKIXRDNSequence *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - if( (NSSBER *)NULL != rdnseq->ber ) { - rv->ber = nssItem_Duplicate(rdnseq->ber, arena, (NSSItem *)NULL); - if( (NSSBER *)NULL == rv->ber ) { - goto loser; - } - } - - if( (NSSDER *)NULL != rdnseq->der ) { - rv->der = nssItem_Duplicate(rdnseq->der, arena, (NSSItem *)NULL); - if( (NSSDER *)NULL == rv->der ) { - goto loser; - } - } - - if( (NSSUTF8 *)NULL != rdnseq->utf8 ) { - rv->utf8 = nssUTF8_duplicate(rdnseq->utf8, arena); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - } - - if( 0 == rdnseq->count ) { - nss_pkix_RDNSequence_Count(rdnseq); - } - -#ifdef PEDANTIC - if( 0 == rdnseq->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* PEDANTIC */ - - rv->count = rdnseq->count; - - rv->rdns = nss_ZNEWARRAY(arena, NSSPKIXRelativeDistinguishedName *, (rv->count+1)); - if( (NSSPKIXRelativeDistinguishedName **)NULL == rv->rdns ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSPKIXRelativeDistinguishedName *v = rdnseq->rdns[i]; - - rv->rdns[i] = nssPKIXRelativeDistinguishedName_Duplicate(v, arena); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rv->rdns[i] ) { - goto loser; - } - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_RDNSequence_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 (NSSPKIXRDNSequence *)NULL; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PEncode.c b/security/nss/lib/pkix/src/RDNSequence/PEncode.c deleted file mode 100644 index 5700fa099..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * nssPKIXRDNSequence_Encode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -nssPKIXRDNSequence_Encode -( - NSSPKIXRDNSequence *rdnseq, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - NSSBER *it; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - 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 != rdnseq->ber ) { - it = rdnseq->ber; - goto done; - } - /*FALLTHROUGH*/ - case NSSASN1DER: - if( (NSSDER *)NULL != rdnseq->der ) { - it = rdnseq->der; - goto done; - } - break; - default: - nss_SetError(NSS_ERROR_UNSUPPORTED_ENCODING); - return (NSSBER *)NULL; - } - - it = nssASN1_EncodeItem(rdnseq->arena, (NSSItem *)NULL, rdnseq, - nssPKIXRDNSequence_template, encoding); - if( (NSSBER *)NULL == it ) { - return (NSSBER *)NULL; - } - - switch( encoding ) { - case NSSASN1BER: - rdnseq->ber = it; - break; - case NSSASN1DER: - rdnseq->der = it; - break; - default: - PR_ASSERT(0); - break; - } - - done: - return nssItem_Duplicate(it, arenaOpt, rvOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PEqual.c b/security/nss/lib/pkix/src/RDNSequence/PEqual.c deleted file mode 100644 index a1dd5af53..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PEqual.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRDNSequence_Equal - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -nssPKIXRDNSequence_Equal -( - NSSPKIXRDNSequence *one, - NSSPKIXRDNSequence *two, - PRStatus *statusOpt -) -{ - NSSPKIXRelativeDistinguishedName **a; - NSSPKIXRelativeDistinguishedName **b; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(one) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXRDNSequence_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); - } - - /* - * Since this is a sequence, the order is significant. - * So we just walk down both lists, comparing. - */ - - for( a = one->rdns, b = two->rdns; *a && *b; a++, b++ ) { - if( PR_FALSE == nssPKIXRelativeDistinguishedName_Equal(*a, *b, statusOpt) ) { - return PR_FALSE; - } - } - - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_SUCCESS; - } - - if( *a || *b ) { - return PR_FALSE; - } - - return PR_TRUE; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PFindRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/PFindRelativeDistinguishedName.c deleted file mode 100644 index 8064b9636..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PFindRelativeDistinguishedName.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 */ - -/* - * nssPKIXRDNSequence_FindRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_PKIX_RDN - * 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 -nssPKIXRDNSequence_FindRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - NSSPKIXRelativeDistinguishedName *rdn -) -{ - PRUint32 i; - NSSPKIXRelativeDistinguishedName **a; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - for( i = 0, a = rdnseq->rdns; *a; a++, (i > 0x7fffffff) || i++ ) { - if( PR_TRUE == nssPKIXRelativeDistinguishedName_Equal(*a, rdn) ) { - 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/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedName.c deleted file mode 100644 index 7ea20d259..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedName.c +++ /dev/null @@ -1,96 +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 */ - -/* - * nssPKIXRDNSequence_GetRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -nssPKIXRDNSequence_GetRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - PRInt32 i, - NSSArena *arenaOpt -) -{ - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( 0 == rdnseq->count ) { - nss_pkix_RDNSequence_Count(rdnseq); - } - -#ifdef PEDANTIC - if( 0 == rdnseq->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* PEDANTIC */ - - if( (i < 0) || (i >= rdnseq->count) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - return nssPKIXRelativeDistinguishedName_Duplicate(rdnseq->rdns[i], arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedNameCount.c b/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedNameCount.c deleted file mode 100644 index a01077db1..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedNameCount.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 */ - -/* - * nssPKIXRDNSequence_GetRelativeDistinguishedNameCount - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * Nonnegative integer upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -nssPKIXRDNSequence_GetRelativeDistinguishedNameCount -( - NSSPKIXRDNSequence *rdnseq -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return -1; - } -#endif /* NSSDEBUG */ - - if( 0 == rdnseq->count ) { - nss_pkix_RDNSequence_Count(rdnseq); - } - -#ifdef PEDANTIC - if( 0 == rdnseq->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } -#endif /* PEDANTIC */ - - if( rdnseq->count > 0x7fffffff ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } - - return (PRInt32)(rdnseq->count); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedNames.c b/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedNames.c deleted file mode 100644 index 115480dfd..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PGetRelativeDistinguishedNames.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRDNSequence_GetRelativeDistinguishedNames - * - * This routine returns all of the relative distinguished names in the - * specified RDN Sequence. {...} If the array is allocated, or if the - * specified one has extra space, the array will be null-terminated. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * A valid pointer to an array of NSSPKIXRelativeDistinguishedName - * pointers upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName ** -nssPKIXRDNSequence_GetRelativeDistinguishedNames -( - NSSPKIXRDNSequence *rdnseq, - NSSPKIXRelativeDistinguishedName *rvOpt[], - PRInt32 limit, - NSSArena *arenaOpt -) -{ - NSSPKIXRelativeDistinguishedName **rv = (NSSPKIXRelativeDistinguishedName **)NULL; - PRUint32 i; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSPKIXRelativeDistinguishedName **)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXRelativeDistinguishedName **)NULL; - } - } -#endif /* NSSDEBUG */ - - if( 0 == rdnseq->count ) { - nss_pkix_RDNSequence_Count(rdnseq); - } - -#ifdef PEDANTIC - if( 0 == rdnseq->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName **)NULL; - } -#endif /* PEDANTIC */ - - if( (limit < rdnseq->count) && - !((0 == limit) && ((NSSPKIXRelativeDistinguishedName **)NULL == rvOpt)) ) { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - return (NSSPKIXRelativeDistinguishedName **)NULL; - } - - limit = rdnseq->count; - if( (NSSPKIXRelativeDistinguishedName **)NULL == rvOpt ) { - rv = nss_ZNEWARRAY(arenaOpt, NSSPKIXRelativeDistinguishedName *, limit); - if( (NSSPKIXRelativeDistinguishedName **)NULL == rv ) { - return (NSSPKIXRelativeDistinguishedName **)NULL; - } - } else { - rv = rvOpt; - } - - for( i = 0; i < limit; i++ ) { - rv[i] = nssPKIXRelativedistinguishedName_Duplicate(rdnseq->rdns[i], arenaOpt); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rv[i] ) { - goto loser; - } - } - - return rv; - - loser: - for( i = 0; i < limit; i++ ) { - NSSPKIXRelativeDistinguishedName *x = rv[i]; - if( (NSSPKIXRelativeDistinguishedName *)NULL == x ) { - break; - } - (void)nssPKIXRelativeDistinguishedName_Destroy(x); - } - - if( rv != rvOpt ) { - nss_ZFreeIf(rv); - } - - return (NSSPKIXRelativeDistinguishedName **)NULL; -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PGetUTF8Encoding.c b/security/nss/lib/pkix/src/RDNSequence/PGetUTF8Encoding.c deleted file mode 100644 index 2250bf960..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/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 */ - -/* - * nssPKIXRDNSequence_GetUTF8Encoding - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSUTF8 pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -nssPKIXRDNSequence_GetUTF8Encoding -( - NSSPKIXRDNSequence *rdnseq, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSUTF8 *)NULL == rdnseq->utf8 ) { - /* xxx fgmr fill this in from pki1 implementation */ - } - - return nssUTF8_Duplicate(rdnseq->utf8, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PInsertRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/PInsertRelativeDistinguishedName.c deleted file mode 100644 index 213866694..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PInsertRelativeDistinguishedName.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRDNSequence_InsertRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRDNSequence_InsertRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - PRInt32 i, - NSSPKIXRelativeDistinguishedName *rdn -) -{ - NSSPKIXRelativeDistinguishedName **na; - NSSPKIXRelativeDistinguishedName *dup; - PRInt32 c; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( 0 == rdnseq->count ) { - nss_pkix_RDNSequence_Count(rdnseq); - } - -#ifdef PEDANTIC - if( 0 == rdnseq->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* PEDANTIC */ - - if( (i < 0) || (i >= rdnseq->count) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - na = (NSSPKIXRelativeDistinguishedName **) - nss_ZRealloc(rdnseq->rdns, ((rdnseq->count+2) * - sizeof(NSSPKIXRelativeDistinguishedName *))); - if( (NSSPKIXRelativeDistinguishedName **)NULL == na ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - rdnseq->rdns = na; - - dup = nssPKIXRelativeDistinguishedName_Duplicate(rdn, rdnseq->arena); - if( (NSSPKIXRelativeDistinguishedName *)NULL == dup ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - for( c = rdnseq->count; c > i; c-- ) { - na[ c ] = na[ c-1 ]; - } - - na[ i ] = dup; - rdnseq->count++; - - return nss_pkix_RDNSequence_Clear(rdnseq); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PRemoveRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/PRemoveRelativeDistinguishedName.c deleted file mode 100644 index 447620c77..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PRemoveRelativeDistinguishedName.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 */ - -/* - * nssPKIXRDNSequence_RemoveRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRDNSequence_RemoveRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - PRInt32 i -) -{ - NSSPKIXRelativeDistinguishedName **na; - PRInt32 c; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( 0 == rdnseq->count ) { - nss_pkix_RDNSequence_Count(rdnseq); - } - -#ifdef PEDANTIC - if( 0 == rdnseq->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* PEDANTIC */ - - if( (i < 0) || (i >= rdnseq->count) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - nssPKIXRelativeDistinguishedName_Destroy(rdnseq->rdns[i]); - - rdnseq->rdns[i] = rdnseq->rdns[ rdnseq->count ]; - rdnseq->rdns[ rdnseq->count ] = (NSSPKIXRelativeDistinguishedName *)NULL; - rdnseq->count--; - - na = (NSSPKIXRelativeDistinguishedName **) - nss_ZRealloc(rdnseq->rdns, ((rdnseq->count) * - sizeof(NSSPKIXRelativeDistinguishedName *))); - if( (NSSPKIXRelativeDistinguishedName **)NULL == na ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - rdnseq->rdns = na; - - return nss_pkix_RDNSequence_Clear(rdnseq); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PSetRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/PSetRelativeDistinguishedName.c deleted file mode 100644 index 5c8123266..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PSetRelativeDistinguishedName.c +++ /dev/null @@ -1,103 +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 */ - -/* - * nssPKIXRDNSequence_SetRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRDNSequence_SetRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - PRInt32 i, - NSSPKIXRelativeDistinguishedName *rdn -) -{ - NSSPKIXRelativeDistinguishedName *dup; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( 0 == rdnseq->count ) { - nss_pkix_RDNSequence_Count(rdnseq); - } - -#ifdef PEDANTIC - if( 0 == rdnseq->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* PEDANTIC */ - - if( (i < 0) || (i >= rdnseq->count) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - dup = nssPKIXRelativeDistinguishedName_Duplicate(rdn, rdnseq->arena); - if( (NSSPKIXRelativeDistinguishedName *)NULL == dup ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - nssPKIXRelativeDistinguishedName_Destroy(rdnseq->rdns[i]); - rdnseq->rdns[i] = dup; - - return nss_pkix_RDNSequence_Clear(rdnseq); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/PSetRelativeDistinguishedNames.c b/security/nss/lib/pkix/src/RDNSequence/PSetRelativeDistinguishedNames.c deleted file mode 100644 index b0320a4b7..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/PSetRelativeDistinguishedNames.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRDNSequence_SetRelativeDistinguishedNames - * - * -- fgmr comments -- - * If the array pointer itself is null, the set is considered empty. - * If the count is zero but the pointer nonnull, the array will be - * assumed to be null-terminated. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRDNSequence_SetRelativeDistinguishedNames -( - NSSPKIXRDNSequence *rdnseq, - NSSPKIXRelativeDistinguishedName *rdns[], - PRInt32 countOpt -) -{ - NSSPKIXRelativeDistinguishedName **ip; - NSSPKIXRelativeDistinguishedName **newarray; - PRUint32 i; - nssArenaMark *mark; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( (NSSPKIXRelativeDistinguishedName **)NULL == rdns ) { - nss_SetError(NSS_ERROR_INVALID_POINTER); - return PR_FAILURE; - } - - { - PRUint32 i, count; - - if( 0 == countOpt ) { - for( i = 0; i < 0x80000000; i++ ) { - if( (NSSPKIXRelativeDistinguishedName *)NULL == rdns[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0x80000000 == i ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } -#endif /* PEDANTIC */ - - count = (PRUint32)i; - } else { - if( countOpt < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - count = (PRUint32)countOpt; - } - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdns[i]) ) { - return PR_FAILURE; - } - } - } -#endif /* NSSDEBUG */ - - mark = nssArena_Mark(rdnseq->mark); - if( (nssArenaMark *)NULL == mark ) { - return PR_FAILURE; - } - - newarray = nss_ZNEWARRAY(rdnseq->arena, NSSPKIXRelativeDistinguishedName *, countOpt); - if( (NSSPKIXRelativeDistinguishedName **)NULL == newarray ) { - goto loser; - } - - for( i = 0; i < countOpt; i++ ) { - newarray[i] = nssPKIXRelativeDistinguishedName_Duplicate(rdns[i], rdnseq->arena); - if( (NSSPKIXRelativeDistinguishedName *)NULL == newarray[i] ) { - goto loser; - } - } - - for( i = 0; i < rdnseq->count; i++ ) { - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_Destroy(rdnseq->rdns[i]) ) { - goto loser; - } - } - - nss_ZFreeIf(rdnseq->rdns); - - rdnseq->count = countOpt; - rdnseq->rdns = newarray; - - (void)nss_pkix_RDNSequence_Clear(rdnseq); - - return nssArena_Unmark(rdnseq->arena, mark); - - loser: - (void)nssArena_Release(a->arena, mark); - return PR_FAILURE; -} - diff --git a/security/nss/lib/pkix/src/RDNSequence/RemoveRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/RemoveRelativeDistinguishedName.c deleted file mode 100644 index 141ab7f37..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/RemoveRelativeDistinguishedName.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 */ - -/* - * NSSPKIXRDNSequence_RemoveRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRDNSequence_RemoveRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - PRInt32 i -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_RemoveRelativeDistinguishedName(rdnseq, i); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/SetRelativeDistinguishedName.c b/security/nss/lib/pkix/src/RDNSequence/SetRelativeDistinguishedName.c deleted file mode 100644 index 7484eb55d..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/SetRelativeDistinguishedName.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 */ - -/* - * NSSPKIXRDNSequence_SetRelativeDistinguishedName - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRDNSequence_SetRelativeDistinguishedName -( - NSSPKIXRDNSequence *rdnseq, - PRInt32 i, - NSSPKIXRelativeDistinguishedName *rdn -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_SetRelativeDistinguishedName(rdnseq, i, rdn); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/SetRelativeDistinguishedNames.c b/security/nss/lib/pkix/src/RDNSequence/SetRelativeDistinguishedNames.c deleted file mode 100644 index 40e7c8247..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/SetRelativeDistinguishedNames.c +++ /dev/null @@ -1,115 +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 */ - -/* - * NSSPKIXRDNSequence_SetRelativeDistinguishedNames - * - * -- fgmr comments -- - * If the array pointer itself is null, the set is considered empty. - * If the count is zero but the pointer nonnull, the array will be - * assumed to be null-terminated. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN_SEQUENCE - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRDNSequence_SetRelativeDistinguishedNames -( - NSSPKIXRDNSequence *rdnseq, - NSSPKIXRelativeDistinguishedName *rdns[], - PRInt32 countOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRDNSequence_verifyPointer(rdnseq) ) { - return PR_FAILURE; - } - - if( (NSSPKIXRelativeDistinguishedName **)NULL == rdns ) { - nss_SetError(NSS_ERROR_INVALID_POINTER); - return PR_FAILURE; - } - - { - PRUint32 i, count; - - if( 0 == countOpt ) { - for( i = 0; i < 0x80000000; i++ ) { - if( (NSSPKIXRelativeDistinguishedName *)NULL == rdns[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0x80000000 == i ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } -#endif /* PEDANTIC */ - - count = (PRUint32)i; - } else { - if( countOpt < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - count = (PRUint32)countOpt; - } - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdns[i]) ) { - return PR_FAILURE; - } - } - } -#endif /* DEBUG */ - - return nssPKIXRDNSequence_SetRelativeDistinguishedNames(rdnseq, rdns, countOpt); -} diff --git a/security/nss/lib/pkix/src/RDNSequence/template.c b/security/nss/lib/pkix/src/RDNSequence/template.c deleted file mode 100644 index ff5bbc0ba..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/template.c +++ /dev/null @@ -1,55 +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 */ - -/* - * nssPKIXRDNSequence_template - * - */ - -const nssASN1Template nssPKIXRDNSequence_template[] = { - { nssASN1_SEQUENCE_OF, offsetof(NSSPKIXRDNSequence, rdns), - nssPKIXRelativeDistinguishedName_template }, - { 0 } -}; diff --git a/security/nss/lib/pkix/src/RDNSequence/verifyPointer.c b/security/nss/lib/pkix/src/RDNSequence/verifyPointer.c deleted file mode 100644 index 47a53a5c4..000000000 --- a/security/nss/lib/pkix/src/RDNSequence/verifyPointer.c +++ /dev/null @@ -1,205 +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_rdnseq_pointer_tracker; - -/* - * nss_pkix_RDNSequence_add_pointer - * - * This method is only present in debug builds. - * - * This module-private routine adds an NSSPKIXRDNSequence 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_RDNSequence_add_pointer -( - const NSSPKIXRDNSequence *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_rdnseq_pointer_tracker); - if( PR_SUCCESS != rv ) { - return rv; - } - - rv = nssPointerTracker_add(&pkix_rdnseq_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(arena, - nss_pkix_RDNSequence_remove_pointer, p); - if( PR_SUCCESS != rv ) { - (void)nss_pkix_RDNSequence_remove_pointer(p); - return rv; - } - -#ifdef NSSDEBUG - { - NSSPKIXRelativeDistinguishedName *r; - - for( r = p->rdns; *r; r++ ) { - if( PR_SUCCESS != nss_pkix_RelativeDistinguishedName_add_pointer(*r) ) { - (void)nss_pkix_RDNSequence_remove_pointer(p); - return PR_FAILURE; - } - } - } -#endif /* NSSDEBUG */ - - return PR_SUCCESS; -} - -/* - * nss_pkix_RDNSequence_remove_pointer - * - * This method is only present in debug builds. - * - * This module-private routine removes a valid NSSPKIXRDNSequence - * 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_RDNSequence_remove_pointer -( - const NSSPKIXRDNSequence *p -) -{ - PRStatus rv; - -#ifdef NSSDEBUG - { - NSSPKIXRelativeDistinguishedName *r; - - for( r = p->rdns; *r; r++ ) { - (void)nss_pkix_RelativeDistinguishedName_remove_pointer(*r); - } - } -#endif /* NSSDEBUG */ - - rv = nssPointerTracker_remove(&pkix_rdnseq_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - /* - * nssArena_deregisterDestructor(p->arena, - * nss_pkix_RDNSequence_remove_pointer, p); - */ - - return rv; -} - -/* - * nssPKIXRDNSequence_verifyPointer - * - * This method is only present in debug builds. - * - * If the specified pointer is a valid pointer to an NSSPKIXRDNSequence - * 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 -nssPKIXRDNSequence_verifyPointer -( - NSSPKIXRDNSequence *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_rdnseq_pointer_tracker); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - rv = nssPointerTracker_verify(&pkix_rdnseq_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/security/nss/lib/pkix/src/RelativeDistinguishedName/AddAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/AddAttributeTypeAndValue.c deleted file mode 100644 index efb142396..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/AddAttributeTypeAndValue.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRelativeDistinguishedName_AddAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRelativeDistinguishedName_AddAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSPKIXAttributeTypeAndValue *atav -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_AddAttributeTypeAndValue(rdn, atav); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/Create.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/Create.c deleted file mode 100644 index 52e139c69..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/Create.c +++ /dev/null @@ -1,125 +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 */ - -/* - * NSSPKIXRelativeDistinguishedName_Create - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_ATAV - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_EXTERN NSSPKIXRelativeDistinguishedName * -NSSPKIXRelativeDistinguishedName_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeTypeAndValue *atav1, - ... -) -{ - va_list ap; - NSSPKIXRelativeDistinguishedName *rv; - PRUint32 count; - - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - /* Is there a nonzero minimum number of ATAVs required? */ - - { - va_start(ap, arenaOpt); - - while( 1 ) { - NSSPKIXAttributeTypeAndValue *atav; - atav = (NSSPKIXAttributeTypeAndValue *)va_arg(ap, NSSPKIXAttributeTypeAndValue *); - if( (NSSPKIXAttributeTypeAndValue *)NULL == atav ) { - break; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - va_end(ap); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - va_end(ap); - } -#endif /* DEBUG */ - - va_start(ap, arenaOpt); - - for( count = 0; ; count++ ) { - NSSPKIXAttributeTypeAndValue *atav; - atav = (NSSPKIXAttributeTypeAndValue *)va_arg(ap, NSSPKIXAttributeTypeAndValue *); - if( (NSSPKIXAttributeTypeAndValue *)NULL == atav ) { - break; - } - -#ifdef PEDANTIC - if( count == 0xFFFFFFFF ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - va_end(ap); - return (NSSPKIXAttributeTypeAndValue *)NULL; - } -#endif /* PEDANTIC */ - } - - va_end(ap); - - va_start(ap, arenaOpt); - rv = nss_pkix_RelativeDistinguishedName_V_Create(arenaOpt, count, ap); - va_end(ap); - - return rv; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/CreateFromArray.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/CreateFromArray.c deleted file mode 100644 index 0c01be4da..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/CreateFromArray.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRelativeDistinguishedName_CreateFromArray - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_ATAV - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -NSSPKIXRelativeDistinguishedName_CreateFromArray -( - NSSArena *arenaOpt, - PRUint32 count, - NSSPKIXAttributeTypeAndValue *atavs[] -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - { - PRUint32 i; - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssAttributeTypeAndValue_verifyPointer(&atavs[i]) ) { - return (NSSPKIXAttribute *)NULL; - } - } - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_CreateFromArray(arenaOpt, count, atavs); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/CreateFromUTF8.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/CreateFromUTF8.c deleted file mode 100644 index 990b7acd2..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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 */ - -/* - * NSSPKIXRelativeDistinguishedName_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 NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -NSSPKIXRelativeDistinguishedName_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *string -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - if( (NSSUTF8 *)NULL == string ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_CreateFromUTF8(arenaOpt, string); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/Decode.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/Decode.c deleted file mode 100644 index b8d0b243a..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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 */ - -/* - * NSSPKIXRelativeDistinguishedName_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 NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -NSSPKIXRelativeDistinguishedName_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_Decode(arenaOpt, ber); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/Destroy.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/Destroy.c deleted file mode 100644 index ca8b1e85f..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRelativeDistinguishedName_Destroy - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRelativeDistinguishedName_Destroy -( - NSSPKIXRelativeDistinguishedName *rdn -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_Destroy(rdn); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/Duplicate.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/Duplicate.c deleted file mode 100644 index 416b405e8..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/Duplicate.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 */ - -/* - * NSSPKIXRelativeDistinguishedName_Duplicate - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -NSSPKIXRelativeDistinguishedName_Duplicate -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_Duplicate(rdn, arenaOpt); -} - diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/Encode.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/Encode.c deleted file mode 100644 index ea6b82a55..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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 */ - -/* - * NSSPKIXRelativeDistinguishedName_Encode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXRelativeDistinguishedName_Encode -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_Encode(rdn, encoding, rvOpt, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/Equal.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/Equal.c deleted file mode 100644 index 3e4a3fc3e..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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 */ - -/* - * NSSPKIXRelativeDistinguishedName_Equal - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_EXTERN PRBool -NSSPKIXRelativeDistinguishedName_Equal -( - NSSPKIXRelativeDistinguishedName *one, - NSSPKIXRelativeDistinguishedName *two, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(one) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(two) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_Equal(one, two, statusOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/FindAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/FindAttributeTypeAndValue.c deleted file mode 100644 index 65032b1c1..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/FindAttributeTypeAndValue.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRelativeDistinguishedName_FindAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_PKIX_ATAV - * 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_EXTERN PRInt32 -NSSPKIXRelativeDistinguishedName_FindAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSPKIXAttributeTypeAndValue *atav -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_FindAttributeTypeAndValue(rdn, atav); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValue.c deleted file mode 100644 index 1a58bd132..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValue.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 */ - -/* - * NSSPKIXRelativeDistinguishedName_GetAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -NSSPKIXRelativeDistinguishedName_GetAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - PRInt32 i, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValue(rdn, i, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValueCount.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValueCount.c deleted file mode 100644 index 1209e726c..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValueCount.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 */ - -/* - * NSSPKIXRelativeDistinguishedName_GetAttributeTypeAndValueCount - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * Nonnegative integer upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -NSSPKIXRelativeDistinguishedName_GetAttributeTypeAndValueCount -( - NSSPKIXRelativeDistinguishedName *rdn -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return -1; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValueCount(rdn); -} - diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValues.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValues.c deleted file mode 100644 index 7efc30173..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/GetAttributeTypeAndValues.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXRelativeDistinguishedName_GetAttributeTypeAndValues - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * A valid pointer to an array of NSSPKIXAttributeTypeAndValue - * pointers upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue ** -NSSPKIXRelativeDistinguishedName_GetAttributeTypeAndValues -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSPKIXAttributeTypeAndValue *rvOpt[], - PRInt32 limit, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSPKIXAttributeTypeAndValue **)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXAttributeTypeAndValue **)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValues(rdn, rvOpt, limit, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/GetUTF8Encoding.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/GetUTF8Encoding.c deleted file mode 100644 index 9c428ae40..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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 */ - -/* - * NSSPKIXRelativeDistinguishedName_GetUTF8Encoding - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSUTF8 pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -NSSPKIXRelativeDistinguishedName_GetUTF8Encoding -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_GetUTF8Encoding(rdn, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/MClear.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/MClear.c deleted file mode 100644 index 2b1a93820..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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_RelativeDistinguishedName_Clear - * - * Wipes out cached data. - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_RelativeDistinguishedName_Clear -( - NSSPKIXRelativeDistinguishedName *rdn -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSBER *)NULL != rdn->ber ) { - nss_ZFreeIf(rdn->ber->data); - nss_ZFreeIf(rdn->ber); - } - - if( (NSSDER *)NULL != rdn->der ) { - nss_ZFreeIf(rdn->der->data); - nss_ZFreeIf(rdn->der); - } - - nss_ZFreeIf(rdn->utf8); - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/MCount.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/MCount.c deleted file mode 100644 index 23d976160..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/MCount.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_RelativeDistinguishedName_Count - */ - -NSS_IMPLEMENT void -nss_pkix_RelativeDistinguishedName_Count -( - NSSPKIXRelativeDistinguishedName *rdn -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((NSSPKIXAttributeTypeAndValue **)NULL != rdn->atavs); - if( (NSSPKIXAttributeTypeAndValue **)NULL == rdn->atavs ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - return PR_FAILURE; - } - - if( 0 == rdn->count ) { - PRUint32 i; - for( i = 0; i < 0xFFFFFFFF; i++ ) { - if( (NSSPKIXAttributeTypeAndValue *)NULL == rdn->atavs[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0xFFFFFFFF == i ) { - return; - } -#endif /* PEDANTIC */ - - rdn->count = i; - } - - return; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/MVCreate.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/MVCreate.c deleted file mode 100644 index c40a4b6e7..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/MVCreate.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_RelativeDistinguishedName_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 - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure. - */ - -NSS_EXTERN NSSPKIXRelativeDistinguishedName * -nss_pkix_RelativeDistinguishedName_V_Create -( - NSSArena *arenaOpt, - PRUint32 count, - va_list ap -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRelativeDistinguishedName *rv = (NSSPKIXRelativeDistinguishedName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)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, NSSPKIXRelativeDistinguishedName); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->count = count; - - rv->atav = nss_ZNEWARRAY(arena, NSSPKIXAttributeTypeAndValue *, count); - if( (NSSPKIXAttributeTypeAndValue **)NULL == rv->atav ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSPKIXAttributeTypeAndValue *v = (NSSPKIXAttributeTypeAndValue *) - va_arg(ap, NSSPKIXAttributeTypeAndValue *); - -#ifdef NSSDEBUG - /* - * It's okay to test this down here, since - * supposedly these have already been checked. - */ - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(v) ) { - goto loser; - } -#endif /* NSSDEBUG */ - - rv->atav[i] = nssPKIXAttributeTypeAndValue_Duplicate(v, arena); - if( (NSSPKIXAttributeTypeAndValue *)NULL == rv->atav[i] ) { - goto loser; - } - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_RelativeDistinguishedName_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_RelativeDistinguishedName_remove_pointer, rv) ) { - (void)nss_pkix_RelativeDistinguishedName_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 (NSSPKIXRelativeDistinguishedName *)NULL; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PAddAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PAddAttributeTypeAndValue.c deleted file mode 100644 index 68541d17e..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PAddAttributeTypeAndValue.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRelativeDistinguishedName_AddAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRelativeDistinguishedName_AddAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSPKIXAttributeTypeAndValue *atav -) -{ - PRUint32 newcount; - NSSPKIXAttributeTypeAndValue **newarray; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((NSSPKIXAttributeTypeAndValue **)NULL != rdn->atavs); - if( (NSSPKIXAttributeTypeAndValue **)NULL == rdn->atavs ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - return PR_FAILURE; - } - - if( 0 == rdn->count ) { - nss_pkix_RelativeDistinguishedName_Count(rdn); - } - - newcount = rdn->count+1; - /* Check newcount for a rollover. */ - - /* Remember that our atavs array is NULL-terminated */ - newarray = (NSSPKIXAttributeTypeAndValue **)nss_ZRealloc(rdn->atavs, - ((newcount+1) * sizeof(NSSPKIXAttributeTypeAndValue *))); - if( (NSSPKIXAttributeTypeAndValue **)NULL == newarray ) { - return PR_FAILURE; - } - - rdn->atavs = newarray; - - rdn->atavs[ rdn->count ] = nssPKIXAttributeTypeAndValue_Duplicate(atav, rdn->arena); - if( (NSSPKIXAttributeTypeAndValue *)NULL == rdn->atavs[ rdn->count ] ) { - return PR_FAILURE; /* array is "too big" but whatever */ - } - - rdn->count = newcount; - - return nss_pkix_RelativeDistinguishedName_Clear(rdn); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreate.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreate.c deleted file mode 100644 index a3a1f7315..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreate.c +++ /dev/null @@ -1,123 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_Create - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_ATAV - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -nssPKIXRelativeDistinguishedName_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeTypeAndValue *atav1, - ... -) -{ - va_list ap; - NSSPKIXRelativeDistinguishedName *rv; - PRUint32 count; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - /* Is there a nonzero minimum number of ATAVs required? */ - - { - va_start(ap, arenaOpt); - - while( 1 ) { - NSSPKIXAttributeTypeAndValue *atav; - atav = (NSSPKIXAttributeTypeAndValue *)va_arg(ap, NSSPKIXAttributeTypeAndValue *); - if( (NSSPKIXAttributeTypeAndValue *)NULL == atav ) { - break; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - va_end(ap); - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - va_end(ap); - } -#endif /* NSSDEBUG */ - - va_start(ap, arenaOpt); - - for( count = 0; ; count++ ) { - NSSPKIXAttributeTypeAndValue *atav; - atav = (NSSPKIXAttributeTypeAndValue *)va_arg(ap, NSSPKIXAttributeTypeAndValue *); - if( (NSSPKIXAttributeTypeAndValue *)NULL == atav ) { - break; - } - -#ifdef PEDANTIC - if( count == 0xFFFFFFFF ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - va_end(ap); - return (NSSPKIXAttributeTypeAndValue *)NULL; - } -#endif /* PEDANTIC */ - } - - va_end(ap); - - va_start(ap, arenaOpt); - rv = nss_pkix_RelativeDistinguishedName_V_Create(arenaOpt, count, ap); - va_end(ap); - - return rv; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreateFromArray.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreateFromArray.c deleted file mode 100644 index fa7e27eed..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreateFromArray.c +++ /dev/null @@ -1,151 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_CreateFromArray - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_ATAV - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -nssPKIXRelativeDistinguishedName_CreateFromArray -( - NSSArena *arenaOpt, - PRUint32 count, - NSSPKIXAttributeTypeAndValue *atavs -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRelativeDistinguishedName *rv = (NSSPKIXRelativeDistinguishedName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - { - PRUint32 i; - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssAttributeTypeAndValue_verifyPointer(&atavs[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, NSSPKIXRelativeDistinguishedName); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->count = count; - - rv->atav = nss_ZNEWARRAY(arena, NSSPKIXAttributeTypeAndValue *, count); - if( (NSSPKIXAttributeTypeAndValue **)NULL == rv->atav ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSPKIXAttributeTypeAndValue *v = atavs[i]; - - rv->atav[i] = nssPKIXAttributeTypeAndValue_Duplicate(v, arena); - if( (NSSPKIXAttributeTypeAndValue *)NULL == rv->atav[i] ) { - goto loser; - } - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_RelativeDistinguishedName_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 (NSSPKIXRelativeDistinguishedName *)NULL; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreateFromUTF8.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreateFromUTF8.c deleted file mode 100644 index 2f2f995be..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PCreateFromUTF8.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRelativeDistinguishedName_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 NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -nssPKIXRelativeDistinguishedName_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *string -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRelativeDistinguishedName *rv = (NSSPKIXRelativeDistinguishedName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - if( (NSSUTF8 *)NULL == string ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXRelativeDistinguishedName *)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, NSSPKIXRelativeDistinguishedName); - if( (NSSPKIXRelativeDistinguishedName *)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_RelativeDistinguishedName_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 (NSSPKIXRelativeDistinguishedName *)NULL; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PDecode.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PDecode.c deleted file mode 100644 index ad1766280..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PDecode.c +++ /dev/null @@ -1,142 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_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 NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -nssPKIXRelativeDistinguishedName_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRelativeDistinguishedName *rv = (NSSPKIXRelativeDistinguishedName *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXRelativeDistinguishedName *)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, NSSPKIXRelativeDistinguishedName); - if( (NSSPKIXRelativeDistinguishedName *)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, nssPKIXRelativeDistinguishedName_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_RelativeDistinguishedName_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 (NSSPKIXRelativeDistinguishedName *)NULL; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PDestroy.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PDestroy.c deleted file mode 100644 index 94b8fcf00..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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 */ - -/* - * nssPKIXRelativeDistinguishedName_Destroy - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRelativeDistinguishedName_Destroy -( - NSSPKIXRelativeDistinguishedName *rdn -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - -#ifdef DEBUG - (void)nss_pkix_RelativeDistinguishedName_remove_pointer(rdn); -#endif /* DEBUG */ - - if( PR_TRUE == rdn->i_allocated_arena ) { - return nssArena_Destroy(rdn->arena); - } - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PDuplicate.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PDuplicate.c deleted file mode 100644 index 0277b7b01..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PDuplicate.c +++ /dev/null @@ -1,177 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_Duplicate - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXRelativeDistinguishedName upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXRelativeDistinguishedName * -nssPKIXRelativeDistinguishedName_Duplicate -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSArena *arenaOpt -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXRelativeDistinguishedName *rv = (NSSPKIXRelativeDistinguishedName *)NULL; - PRStatus status; - PRUint32 i; - NSSPKIXAttributeTypeAndValue **from, **to; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSPKIXRelativeDistinguishedName *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXRelativeDistinguishedName *)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, NSSPKIXRelativeDistinguishedName); - if( (NSSPKIXRelativeDistinguishedName *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - if( (NSSDER *)NULL != rdn->der ) { - rv->der = nssItem_Duplicate(rdn->der, arena, (NSSItem *)NULL); - if( (NSSDER *)NULL == rv->der ) { - goto loser; - } - } - - if( (NSSBER *)NULL != rdn->ber ) { - rv->ber = nssItem_Duplicate(rdn->ber, arena, (NSSItem *)NULL); - if( (NSSBER *)NULL == rv->ber ) { - goto loser; - } - } - - if( (NSSUTF8 *)NULL != rdn->utf8 ) { - rv->utf8 = nssUTF8_Duplicate(rdn->utf8, arena); - if( (NSSUTF8 *)NULL == rv->utf8 ) { - goto loser; - } - } - - rv->count = rdn->count; - - { - if( 0 == rdn->count ) { - nss_pkix_RelativeDistinguishedName_Count(rdn); - if( 0 == rdn->count ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - goto loser; - } - - rv->count = rdn->count; /* might as well save it */ - } - - rv->atavs = nss_ZNEWARRAY(arena, NSSPKIXAttributeTypeAndValue *, rdn->count + 1); - if( (NSSPKIXAttributeTypeAndValue *)NULL == rv->atavs ) { - goto loser; - } - } - - for( from = &rdn->atavs[0], to = &rv->atavs[0]; *from; from++, to++ ) { - *to = nssPKIXAttributeTypeAndValue_Duplicate(*from, arena); - if( (NSSPKIXAttributeTypeAndValue *)NULL == *to ) { - goto loser; - } - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_RelativeDistinguishedName_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 (NSSPKIXRelativeDistinguishedName *)NULL; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PEncode.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PEncode.c deleted file mode 100644 index d2af9470b..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PEncode.c +++ /dev/null @@ -1,123 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_Encode - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -nssPKIXRelativeDistinguishedName_Encode -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - NSSBER *it; - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - 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 != rdn->ber ) { - it = rdn->ber; - goto done; - } - /*FALLTHROUGH*/ - case NSSASN1DER: - if( (NSSDER *)NULL != rdn->der ) { - it = rdn->der; - goto done; - } - break; - default: - nss_SetError(NSS_ERROR_UNSUPPORTED_ENCODING); - return (NSSBER *)NULL; - } - - it = nssASN1_EncodeItem(rdn->arena, (NSSItem *)NULL, rdn, - nssPKIXRelativeDistinguishedName_template, - encoding); - if( (NSSBER *)NULL == it ) { - return (NSSBER *)NULL; - } - - switch( encoding ) { - case NSSASN1BER: - rdn->ber = it; - break; - case NSSASN1DER: - rdn->der = it; - break; - default: - PR_ASSERT(0); - break; - } - - done: - return nssItem_Duplicate(it, arenaOpt, rvOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PEqual.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PEqual.c deleted file mode 100644 index 2ac566a8b..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PEqual.c +++ /dev/null @@ -1,101 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_Equal - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -nssPKIXRelativeDistinguishedName_Equal -( - NSSPKIXRelativeDistinguishedName *one, - NSSPKIXRelativeDistinguishedName *two, - PRStatus *statusOpt -) -{ - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(one) ) { - goto loser; - } - - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(two) ) { - goto loser; - } -#endif /* NSSDEBUG */ - - if( (NSSDER *)NULL == one->der ) { - one->der = nssASN1_EncodeItem(one->arena, (NSSItem *)NULL, one, - nssPKIXRelativeDistinguishedName_template, - NSSASN1DER); - if( (NSSDER *)NULL == one->der ) { - goto loser; - } - } - - if( (NSSDER *)NULL == two->der ) { - two->der = nssASN1_EncodeItem(two->arena, (NSSItem *)NULL, two, - nssPKIXRelativeDistinguishedName_template, - NSSASN1DER); - if( (NSSDER *)NULL == two->der ) { - goto loser; - } - } - - return nssItem_Equal(one->der, two->der, statusOpt); - - loser: - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PFindAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PFindAttributeTypeAndValue.c deleted file mode 100644 index ee7c55e10..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PFindAttributeTypeAndValue.c +++ /dev/null @@ -1,96 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_FindAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_PKIX_ATAV - * 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 -nssPKIXRelativeDistinguishedName_FindAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSPKIXAttributeTypeAndValue *atav -) -{ - PRUint32 i; - NSSPKIXAttributeTypeAndValue **a; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return -1; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return -1; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((NSSPKIXAttributeTypeAndValue **)NULL != rdn->atavs); - if( (NSSPKIXAttributeTypeAndValue **)NULL == rdn->atavs ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - return -1; - } - - for( i = 0, a = rdn->atavs; *a; a++, (i > 0x7fffffff) || i++ ) { - if( PR_TRUE == nssPKIXAttributeTypeAndValue_Equal(*a, atav) ) { - 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/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValue.c deleted file mode 100644 index 22c3abac6..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValue.c +++ /dev/null @@ -1,89 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXAttributeTypeAndValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue * -nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - PRInt32 i, - NSSArena *arenaOpt -) -{ - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( 0 == rdn->count ) { - nss_pkix_RelativeDistinguishedName_Count(rdn); - } - - if( (i < 0) || (i >= rdn->count) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXAttributeTypeAndValue *)NULL; - } - - return nssPKIXAttributeTypeAndValue_Duplicate(rdn->atavs[i], arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValueCount.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValueCount.c deleted file mode 100644 index df8e1b48e..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValueCount.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 */ - -/* - * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValueCount - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * Nonnegative integer upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValueCount -( - NSSPKIXRelativeDistinguishedName *rdn -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return -1; - } -#endif /* NSSDEBUG */ - - if( 0 == rdn->count ) { - nss_pkix_RelativeDistinguishedName_Count(rdn); - } - -#ifdef PEDANTIC - if( 0 == rdn->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } -#endif /* PEDANTIC */ - - if( rdn->count > 0x7fffffff ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } - - return (PRInt32)(rdn->count); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValues.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValues.c deleted file mode 100644 index 7675d5ad3..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetAttributeTypeAndValues.c +++ /dev/null @@ -1,133 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValues - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * A valid pointer to an array of NSSPKIXAttributeTypeAndValue - * pointers upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeTypeAndValue ** -nssPKIXRelativeDistinguishedName_GetAttributeTypeAndValues -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSPKIXAttributeTypeAndValue *rvOpt[], - PRInt32 limit, - NSSArena *arenaOpt -) -{ - NSSPKIXAttributeTypeAndValue **rv = (NSSPKIXAttributeTypeAndValue **)NULL; - PRUint32 i; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSPKIXAttributeTypeAndValue **)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXAttributeTypeAndValue **)NULL; - } - } -#endif /* NSSDEBUG */ - - if( 0 == rdn->count ) { - nss_pkix_RelativeDistinguishedName_Count(rdn); - } - -#ifdef PEDANTIC - if( 0 == rdn->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXAttributeTypeAndValue **)NULL; - } -#endif /* PEDANTIC */ - - if( (limit < rdn->count) && - !((0 == limit) && ((NSSPKIXAttributeTypeAndValue **)NULL == rvOpt)) ) { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - return (NSSPKIXAttributeTypeAndValue **)NULL; - } - - limit = rdn->count; - if( (NSSPKIXAttributeTypeAndValue **)NULL == rvOpt ) { - rv = nss_ZNEWARRAY(arenaOpt, NSSPKIXAttributeTypeAndValue *, limit); - if( (NSSPKIXAttributeTypeAndValue **)NULL == rv ) { - return (NSSPKIXAttributeTypeAndValue **)NULL; - } - } else { - rv = rvOpt; - } - - for( i = 0; i < limit; i++ ) { - rv[i] = nssPKIXAttributeTypeAndValue_Duplicate(rdn->atav[i], arenaOpt); - if( (NSSPKIXAttributeTypeAndValue *)NULL == rv[i] ) { - goto loser; - } - } - - return rv; - - loser: - for( i = 0; i < limit; i++ ) { - NSSPKIXAttributeTypeAndValue *x = rv[i]; - if( (NSSPKIXAttributeTypeAndValue *)NULL == x ) { - break; - } - (void)nssPKIXAttributeTypeAndValue_Destroy(x); - } - - if( rv != rvOpt ) { - nss_ZFreeIf(rv); - } - - return (NSSPKIXAttributeTypeAndValue **)NULL; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetUTF8Encoding.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PGetUTF8Encoding.c deleted file mode 100644 index 01abf228c..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/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 */ - -/* - * nssPKIXRelativeDistinguishedName_GetUTF8Encoding - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSUTF8 pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSUTF8 * -nssPKIXRelativeDistinguishedName_GetUTF8Encoding -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSUTF8 *)NULL == rdn->utf8 ) { - /* xxx fgmr fill this in from pki1 implementation */ - } - - return nssUTF8_Duplicate(rdn->utf8, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PRemoveAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PRemoveAttributeTypeAndValue.c deleted file mode 100644 index 84b5cc819..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PRemoveAttributeTypeAndValue.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRelativeDistinguishedName_RemoveAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_AT_MINIMUM - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRelativeDistinguishedName_RemoveAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - PRInt32 i -) -{ - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( 0 == rdn->count ) { - nss_pkix_RelativeDistinguishedName_Count(rdn); - } - - if( i < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - /* Is there a technical minimum? */ - /* - * if( 1 == rdn->count ) { - * nss_SetError(NSS_ERROR_AT_MINIMUM); - * return PR_FAILURE; - * } - */ - -#ifdef PEDANTIC - if( 0 == rdn->count ) { - NSSPKIXAttributeTypeAndValue **ip; - /* Too big.. but we can still remove one */ - nssPKIXAttributeTypeAndValue_Destroy(rdn->atavs[i]); - for( ip = &rdn->atavs[i]; *ip; ip++ ) { - ip[0] = ip[1]; - } - } else -#endif /* PEDANTIC */ - - { - NSSPKIXAttributeTypeAndValue *si; - PRUint32 end; - - if( i >= rdn->count ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - end = rdn->count - 1; - - si = rdn->atavs[i]; - rdn->atavs[i] = rdn->atavs[end]; - rdn->atavs[end] = (NSSPKIXAttributeTypeAndValue *)NULL; - - nssPKIXAttributeTypeAndValue_Destroy(si); - - /* We could realloc down, but we know it's a no-op */ - rdn->count = end; - } - - return nss_pkix_RelativeDistinguishedName_Clear(rdn); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PSetAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PSetAttributeTypeAndValue.c deleted file mode 100644 index 01439e2e7..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PSetAttributeTypeAndValue.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - PRInt32 i, - NSSPKIXAttributeTypeAndValue *atav -) -{ - NSSPKIXAttributeTypeAndValue *dup; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((NSSPKIXAttributeTypeAndValue **)NULL != rdn->atavs); - if( (NSSPKIXAttributeTypeAndValue **)NULL == rdn->atavs ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - return PR_FAILURE; - } - - if( 0 == rdn->count ) { - nss_pkix_RelativeDistinguishedName_Count(rdn); - } - - if( (i < 0) || (i >= rdn->count) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - dup = nssPKIXAttributeTypeAndValue_Duplicate(atav, rdn->arena); - if( (NSSPKIXAttributeTypeAndValue *)NULL == dup ) { - return PR_FAILURE; - } - - nssPKIXAttributeTypeAndValue_Destroy(rdn->atavs[i]); - rdn->atavs[i] = dup; - - return nss_pkix_RelativeDistinguishedName_Clear(rdn); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/PSetAttributeTypeAndValues.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/PSetAttributeTypeAndValues.c deleted file mode 100644 index 839839ea2..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/PSetAttributeTypeAndValues.c +++ /dev/null @@ -1,166 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValues - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_ATAV - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValues -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSPKIXAttributeTypeAndValue *atavs[], - PRInt32 countOpt -) -{ - NSSPKIXAttributeTypeAndValue **ip; - NSSPKIXAttributeTypeAndValue **newarray; - PRUint32 i; - nssArenaMark *mark; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } - - if( (NSSPKIXAttributeTypeAndValues **)NULL == atavs ) { - nss_SetError(NSS_ERROR_INVALID_POINTER); - return PR_FAILURE; - } - - { - PRUint32 i, count; - - if( 0 == countOpt ) { - for( i = 0; i < 0x80000000; i++ ) { - if( (NSSPKIXAttributeTypeAndValue *)NULL == atav[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0x80000000 == i ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } -#endif /* PEDANTIC */ - - count = (PRUint32)i; - } else { - if( countOpt < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - count = (PRUint32)countOpt; - } - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav[i]) ) { - return PR_FAILURE; - } - } - } -#endif /* NSSDEBUG */ - - if( 0 == countOpt ) { - for( i = 0; i < 0xffffffff; i++ ) { - if( (NSSPKIXAttributeTypeAndValue *)NULL == atavs[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0xffffffff == 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - reutrn PR_FAILURE; - } -#endif /* PEDANTIC */ - - countOpt = i; - } - - mark = nssArena_Mark(rdn->mark); - if( (nssArenaMark *)NULL == mark ) { - return PR_FAILURE; - } - - newarray = nss_ZNEWARRAY(rdn->arena, NSSPKIXAttributeTypeAndValue *, countOpt); - if( (NSSPKIXAttributeTypeAndValue **)NULL == newarray ) { - goto loser; - } - - for( i = 0; i < countOpt; i++ ) { - newarray[i] = nssPKIXAttributeTypeAndValue_Duplicate(atavs[i], rdn->arena); - if( (NSSPKIXAttributeTypeAndValue *)NULL == newarray[i] ) { - goto loser; - } - } - - for( i = 0; i < rdn->count; i++ ) { - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_Destroy(rdn->atavs[i]) ) { - goto loser; - } - } - - nss_ZFreeIf(rdn->atavs); - - rdn->count = countOpt; - rdn->atavs = newarray; - - (void)nss_pkix_RelativeDistinguishedName_Clear(rdn); - - return nssArena_Unmark(rdn->arena, mark); - - loser: - (void)nssArena_Release(a->arena, mark); - return PR_FAILURE; -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/RemoveAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/RemoveAttributeTypeAndValue.c deleted file mode 100644 index b9f1deb66..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/RemoveAttributeTypeAndValue.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 */ - -/* - * NSSPKIXRelativeDistinguishedName_RemoveAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_AT_MINIMUM - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRelativeDistinguishedName_RemoveAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - PRInt32 i -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_RemoveAttributeTypeAndValue(rdn, i); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/SetAttributeTypeAndValue.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/SetAttributeTypeAndValue.c deleted file mode 100644 index fa2224a6b..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/SetAttributeTypeAndValue.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 */ - -/* - * NSSPKIXRelativeDistinguishedName_SetAttributeTypeAndValue - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_PKIX_ATAV - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRelativeDistinguishedName_SetAttributeTypeAndValue -( - NSSPKIXRelativeDistinguishedName *rdn, - PRInt32 i, - NSSPKIXAttributeTypeAndValue *atav -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atav) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValue(rdn, i, atav); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/SetAttributeTypeAndValues.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/SetAttributeTypeAndValues.c deleted file mode 100644 index c6a8f0434..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/SetAttributeTypeAndValues.c +++ /dev/null @@ -1,113 +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 */ - -/* - * NSSPKIXRelativeDistinguishedName_SetAttributeTypeAndValues - * - * -- fgmr comments -- - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_RDN - * NSS_ERROR_INVALID_POINTER - * NSS_ERROR_INVALID_ATAV - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXRelativeDistinguishedName_SetAttributeTypeAndValues -( - NSSPKIXRelativeDistinguishedName *rdn, - NSSPKIXAttributeTypeAndValue *atavs[], - PRInt32 countOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXRelativeDistinguishedName_verifyPointer(rdn) ) { - return PR_FAILURE; - } - - if( (NSSPKIXAttributeTypeAndValue **)NULL == atavs ) { - nss_SetError(NSS_ERROR_INVALID_POINTER); - return PR_FAILURE; - } - - { - PRUint32 i, count; - - if( 0 == countOpt ) { - for( i = 0; i < 0x80000000; i++ ) { - if( (NSSPKIXAttributeTypeAndValue *)NULL == atavs[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0x80000000 == i ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } -#endif /* PEDANTIC */ - - count = (PRUint32)i; - } else { - if( countOpt < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - count = (PRUint32)countOpt; - } - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssPKIXAttributeTypeAndValue_verifyPointer(atavs[i]) ) { - return PR_FAILURE; - } - } - } -#endif /* DEBUG */ - - return nssPKIXRelativeDistinguishedName_SetAttributeTypeAndValues(rdn, atavs, countOpt); -} diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/template.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/template.c deleted file mode 100644 index fff01836a..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/template.c +++ /dev/null @@ -1,55 +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 */ - -/* - * nssPKIXRelativeDistinguishedName_template - * - */ - -const nssASN1Template nssPKIXRelativeDistinguishedName_template[] = { - { nssASN1_SET_OF, offsetof(NSSPKIXRelativeDistinguishedName, atavs), - nssPKIXAttributeTypeAndValue_template, - sizeof(NSSPKIXRelativeDistinguishedName) } -}; diff --git a/security/nss/lib/pkix/src/RelativeDistinguishedName/verifyPointer.c b/security/nss/lib/pkix/src/RelativeDistinguishedName/verifyPointer.c deleted file mode 100644 index d7274abae..000000000 --- a/security/nss/lib/pkix/src/RelativeDistinguishedName/verifyPointer.c +++ /dev/null @@ -1,205 +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_rdn_pointer_tracker; - -/* - * nss_pkix_RelativeDistinguishedName_add_pointer - * - * This method is only present in debug builds. - * - * This module-private routine adds an NSSPKIXRelativeDistinguishedName 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_RelativeDistinguishedName_add_pointer -( - const NSSPKIXRelativeDistinguishedName *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_rdn_pointer_tracker); - if( PR_SUCCESS != rv ) { - return rv; - } - - rv = nssPointerTracker_add(&pkix_rdn_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_RelativeDistinguishedName_remove_pointer, p); - if( PR_SUCCESS != rv ) { - (void)nss_pkix_RelativeDistinguishedName_remove_pointer(p); - return rv; - } - -#ifdef NSSDEBUG - { - NSSPKIXAttributeTypeAndValue *a; - - for( a = p->atavs; *a; a++ ) { - if( PR_SUCCESS != nss_pkix_AttributeTypeAndValue_add_pointer(*a) ) { - nss_pkix_RelativeDistinguishedName_remove_pointer(p); - return PR_FAILURE; - } - } - } -#endif /* NSSDEBUG */ - - return PR_SUCCESS; -} - -/* - * nss_pkix_RelativeDistinguishedName_remove_pointer - * - * This method is only present in debug builds. - * - * This module-private routine removes a valid NSSPKIXRelativeDistinguishedName - * 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_RelativeDistinguishedName_remove_pointer -( - const NSSPKIXRelativeDistinguishedName *p -) -{ - PRStatus rv; - -#ifdef NSSDEBUG - { - NSSPKIXAttributeTypeAndValue *a; - - for( a = p->atavs; *a; a++ ) { - (void)nss_pkix_AttributeTypeAndValue_remove_pointer(*a); - } - } -#endif /* NSSDEBUG */ - - rv = nssPointerTracker_remove(&pkix_rdn_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - /* - * nssArena_deregisterDestructor(p->arena, - * nss_pkix_RelativeDistinguishedName_remove_pointer, p); - */ - - return rv; -} - -/* - * nssPKIXRelativeDistinguishedName_verifyPointer - * - * This method is only present in debug builds. - * - * If the specified pointer is a valid pointer to an NSSPKIXRelativeDistinguishedName - * 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 -nssPKIXRelativeDistinguishedName_verifyPointer -( - NSSPKIXRelativeDistinguishedName *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_rdn_pointer_tracker); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - rv = nssPointerTracker_verify(&pkix_rdn_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/security/nss/lib/pkix/src/Time/Compare.c b/security/nss/lib/pkix/src/Time/Compare.c deleted file mode 100644 index 6a125d6c6..000000000 --- a/security/nss/lib/pkix/src/Time/Compare.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXTime_Compare - * - * Usual result: -1, 0, 1 - * Returns 0 on error - */ - -NSS_IMPLEMENT PRInt32 -NSSPKIXTime_Compare -( - NSSPKIXTime *time1, - NSSPKIXTime *tiem2, - PRStatus *statusOpt -) - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time1) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return 0; - } - - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time2) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return 0; - } -#endif /* DEBUG */ - - return nssPKIXTime_Compare(time1, time2, statusOpt); -} diff --git a/security/nss/lib/pkix/src/Time/CreateFromPRTime.c b/security/nss/lib/pkix/src/Time/CreateFromPRTime.c deleted file mode 100644 index 909adb14e..000000000 --- a/security/nss/lib/pkix/src/Time/CreateFromPRTime.c +++ /dev/null @@ -1,65 +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 */ - -/* - * NSSPKIXTime_CreateFromPRTime - * - */ - -NSS_IMPLEMENT NSSPKIXTime * -NSSPKIXTime_CreateFromPRTime -( - NSSArena *arenaOpt, - PRTime prTime -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXTime *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXTime_CreateFromPRTime(arenaOpt, prTime); -} diff --git a/security/nss/lib/pkix/src/Time/CreateFromUTF8.c b/security/nss/lib/pkix/src/Time/CreateFromUTF8.c deleted file mode 100644 index 469741ac6..000000000 --- a/security/nss/lib/pkix/src/Time/CreateFromUTF8.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 */ - -/* - * NSSPKIXTime_CreateFromUTF8 - * - */ - -NSS_EXTERN NSSPKIXTime * -NSSPKIXTime_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *utf8 -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXTime *)NULL; - } - } - - if( (NSSUTF8 *)NULL == utf8 ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXTime *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXTime_CreateFromUTF8(arenaOpt, utf8); -} diff --git a/security/nss/lib/pkix/src/Time/Decode.c b/security/nss/lib/pkix/src/Time/Decode.c deleted file mode 100644 index 948dc0b93..000000000 --- a/security/nss/lib/pkix/src/Time/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 */ - -/* - * NSSPKIXTime_Decode - * - * - * - * 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 NSSPKIXTime upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXTime * -NSSPKIXTime_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXTime *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXTime *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXTime_Decode(arenaOpt, ber); -} diff --git a/security/nss/lib/pkix/src/Time/Destroy.c b/security/nss/lib/pkix/src/Time/Destroy.c deleted file mode 100644 index d694850ef..000000000 --- a/security/nss/lib/pkix/src/Time/Destroy.c +++ /dev/null @@ -1,62 +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 */ - -/* - * NSSPKIXTime_Destroy - * - */ - -NSS_IMPLEMENT PR_STATUS -NSSPKIXTime_Destroy -( - NSSPKIXTime *time -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXTime_Destroy(time); -} diff --git a/security/nss/lib/pkix/src/Time/Duplicate.c b/security/nss/lib/pkix/src/Time/Duplicate.c deleted file mode 100644 index dee6f61e9..000000000 --- a/security/nss/lib/pkix/src/Time/Duplicate.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXTime_Duplicate - * - */ - -NSS_IMPLEMENT NSSPKIXTime * -NSSPKXITime_Duplicate -( - NSSPKIXTime *time, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time) ) { - return (NSSPKXITime *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXTime *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXTime_Duplicate(time, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Time/Encode.c b/security/nss/lib/pkix/src/Time/Encode.c deleted file mode 100644 index 9063e4f3a..000000000 --- a/security/nss/lib/pkix/src/Time/Encode.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 */ - -/* - * NSSPKIXTime_Encode - * - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXTime_Encode -( - NSSPKIXTime *time, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXTime_Encode(time, encoding, rvOpt, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Time/Equal.c b/security/nss/lib/pkix/src/Time/Equal.c deleted file mode 100644 index 4ed05acd5..000000000 --- a/security/nss/lib/pkix/src/Time/Equal.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXTime_Equal - * - */ - -NSS_IMPLEMENT PRBool -NSSPKXITime_Equal -( - NSSPKXITime *time1, - NSSPKXITime *time2, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time1) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time2) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIXTime_Equal(time1, time2, statusOpt); -} diff --git a/security/nss/lib/pkix/src/Time/GetPRTime.c b/security/nss/lib/pkix/src/Time/GetPRTime.c deleted file mode 100644 index 5871a482d..000000000 --- a/security/nss/lib/pkix/src/Time/GetPRTime.c +++ /dev/null @@ -1,64 +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 */ - -/* - * NSSPKIXTime_GetPRTime - * - * Returns a zero on error - */ - -NSS_IMPLEMENT PRTime -NSSPKIXTime_GetPRTime -( - NSSPKIXTime *time, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time) ) { - return (PRTime)0; - } -#endif /* DEBUG */ - - return nssPKIXTime_GetPRTime(time, statusOpt); -} diff --git a/security/nss/lib/pkix/src/Time/GetUTF8Encoding.c b/security/nss/lib/pkix/src/Time/GetUTF8Encoding.c deleted file mode 100644 index 7fc383b81..000000000 --- a/security/nss/lib/pkix/src/Time/GetUTF8Encoding.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXTime_GetUTF8Encoding - * - */ - -NSS_IMPLEMENT NSSUTF8 * -NSSPKXITime_GetUTF8Encoding -( - NSSPKIXTime *time, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time) ) { - return (NSSUTF8 *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSUTF8 *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXTime_GetUTF8Encoding(time, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Time/PCreateFromPRTime.c b/security/nss/lib/pkix/src/Time/PCreateFromPRTime.c deleted file mode 100644 index 13805e65d..000000000 --- a/security/nss/lib/pkix/src/Time/PCreateFromPRTime.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXTime_CreateFromPRTime - * - */ - -NSS_IMPLEMENT NSSPKIXTime * -nssPKIXTime_CreateFromPRTime -( - NSSArena *arenaOpt, - PRTime prTime -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXTime *rv = (NSSPKIXTime *)NULL; - PRStatus status; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXTime *)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, NSSPKIXTime); - if( (NSSPKIXTime *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - rv->prTime = prTime; - rv->prTimeValid = PR_TRUE; - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Time_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 (NSSPKIXTime *)NULL; -} diff --git a/security/nss/lib/pkix/src/Time/PCreateFromUTF8.c b/security/nss/lib/pkix/src/Time/PCreateFromUTF8.c deleted file mode 100644 index 1a15639ed..000000000 --- a/security/nss/lib/pkix/src/Time/PCreateFromUTF8.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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXTime_CreateFromUTF8 - * - */ - -NSS_IMPLEMENT NSSPKIXTime * -nssPKIXTime_CreateFromUTF8 -( - NSSArena *arenaOpt, - NSSUTF8 *utf8 -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXTime *rv = (NSSPKIXTime *)NULL; - PRStatus status; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXTime *)NULL; - } - } - - if( (NSSUTF8 *)NULL == utf8 ) { - nss_SetError(NSS_ERROR_INVALID_STRING); - return (NSSPKIXTime *)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, NSSPKIXTime); - if( (NSSPKIXTime *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - /* fgmr base on nspr's pl implementation? */ - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Time_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 (NSSPKIXTime *)NULL; -} diff --git a/security/nss/lib/pkix/src/Time/PDecode.c b/security/nss/lib/pkix/src/Time/PDecode.c deleted file mode 100644 index 385665468..000000000 --- a/security/nss/lib/pkix/src/Time/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$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXTime_Decode - * - * - * - * 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 NSSPKIXTime upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXTime * -nssPKIXTime_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXTime *rv = (NSSPKIXTime *)NULL; - PRStatus status; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXTime *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXTime *)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, NSSPKIXTime); - if( (NSSPKIXTime *)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, nssPKIXTime_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_Time_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 (NSSPKIXTime *)NULL; -} diff --git a/security/nss/lib/pkix/src/Time/PDestroy.c b/security/nss/lib/pkix/src/Time/PDestroy.c deleted file mode 100644 index 973974b51..000000000 --- a/security/nss/lib/pkix/src/Time/PDestroy.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 */ - -/* - * nssPKIXTime_Destroy - * - */ - -NSS_IMPLEMENT PR_STATUS -nssPKIXTime_Destroy -( - NSSPKIXTime *time -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - -#ifdef DEBUG - (void)nss_pkix_Time_remove_pointer(time); -#endif /* DEBUG */ - - if( PR_TRUE == time->i_allocated_arena ) { - return nssArena_Destroy(time->arena); - } - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/Time/PEncode.c b/security/nss/lib/pkix/src/Time/PEncode.c deleted file mode 100644 index 8904fac50..000000000 --- a/security/nss/lib/pkix/src/Time/PEncode.c +++ /dev/null @@ -1,66 +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 */ - -/* - * nssPKIXTime_Encode - * - */ - -NSS_IMPLEMENT NSSBER * -nssPKIXTime_Encode -( - NSSPKIXTime *time, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXTime_verifyPointer(time) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* NSSDEBUG */ diff --git a/security/nss/lib/pkix/src/Time/template.c b/security/nss/lib/pkix/src/Time/template.c deleted file mode 100644 index 38c4f3c78..000000000 --- a/security/nss/lib/pkix/src/Time/template.c +++ /dev/null @@ -1,54 +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 */ - -/* - * nssPKIXTime_template - * - */ - -const nssASN1Template nssPKIXTime_template[] = { - { nssASN1_INLINE, offsetof(NSSPKIXTime, asn1item), - nssASN1Template_Any, sizeof(NSSPKIXTime) } -}; diff --git a/security/nss/lib/pkix/src/X520Name/CreateFromUTF8.c b/security/nss/lib/pkix/src/X520Name/CreateFromUTF8.c deleted file mode 100644 index 84df20054..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/Decode.c b/security/nss/lib/pkix/src/X520Name/Decode.c deleted file mode 100644 index ac59d5598..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/Destroy.c b/security/nss/lib/pkix/src/X520Name/Destroy.c deleted file mode 100644 index 49037d3b4..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/Duplicate.c b/security/nss/lib/pkix/src/X520Name/Duplicate.c deleted file mode 100644 index bcb4b5a2b..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/Encode.c b/security/nss/lib/pkix/src/X520Name/Encode.c deleted file mode 100644 index 83cfd5442..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/Equal.c b/security/nss/lib/pkix/src/X520Name/Equal.c deleted file mode 100644 index 75842e8f5..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/GetUTF8Encoding.c b/security/nss/lib/pkix/src/X520Name/GetUTF8Encoding.c deleted file mode 100644 index 2e42124eb..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/MDoUTF8.c b/security/nss/lib/pkix/src/X520Name/MDoUTF8.c deleted file mode 100644 index 69cbf691e..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/PCreate.c b/security/nss/lib/pkix/src/X520Name/PCreate.c deleted file mode 100644 index c507a8f75..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/PCreateFromUTF8.c b/security/nss/lib/pkix/src/X520Name/PCreateFromUTF8.c deleted file mode 100644 index 0459f8c51..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/PDecode.c b/security/nss/lib/pkix/src/X520Name/PDecode.c deleted file mode 100644 index 8228c8db4..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/PDestroy.c b/security/nss/lib/pkix/src/X520Name/PDestroy.c deleted file mode 100644 index 9a9bdaaa2..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/PDuplicate.c b/security/nss/lib/pkix/src/X520Name/PDuplicate.c deleted file mode 100644 index a2b6d7e53..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/PEncode.c b/security/nss/lib/pkix/src/X520Name/PEncode.c deleted file mode 100644 index d9f001bae..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/PEqual.c b/security/nss/lib/pkix/src/X520Name/PEqual.c deleted file mode 100644 index 9ebe75005..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/PGetUTF8Encoding.c b/security/nss/lib/pkix/src/X520Name/PGetUTF8Encoding.c deleted file mode 100644 index b023b1fea..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/template.c b/security/nss/lib/pkix/src/X520Name/template.c deleted file mode 100644 index 63f18e724..000000000 --- a/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$ $Revision$ $Date$ $Name$"; -#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/security/nss/lib/pkix/src/X520Name/verifyPointer.c b/security/nss/lib/pkix/src/X520Name/verifyPointer.c deleted file mode 100644 index 9e447797d..000000000 --- a/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$ $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_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 */ -- cgit v1.2.1