OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 /* | 4 /* |
5 * pkix_pl_infoaccess.c | 5 * pkix_pl_infoaccess.c |
6 * | 6 * |
7 * InfoAccess Object Definitions | 7 * InfoAccess Object Definitions |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 if (infoAccess->location != NULL) { | 474 if (infoAccess->location != NULL) { |
475 | 475 |
476 PKIX_TOSTRING(infoAccess->location, &locationString, plContext, | 476 PKIX_TOSTRING(infoAccess->location, &locationString, plContext, |
477 PKIX_GENERALNAMETOSTRINGFAILED); | 477 PKIX_GENERALNAMETOSTRINGFAILED); |
478 | 478 |
479 PKIX_CHECK(PKIX_PL_String_GetEncoded | 479 PKIX_CHECK(PKIX_PL_String_GetEncoded |
480 (locationString, PKIX_ESCASCII, &location, &len, plContext), | 480 (locationString, PKIX_ESCASCII, &location, &len, plContext), |
481 PKIX_STRINGGETENCODEDFAILED); | 481 PKIX_STRINGGETENCODEDFAILED); |
482 | 482 |
483 PKIX_OID_DEBUG("\tCalling PORT_Strcmp).\n"); | 483 PKIX_OID_DEBUG("\tCalling PORT_Strcmp).\n"); |
| 484 #ifndef NSS_PKIX_NO_LDAP |
484 if (PORT_Strncmp(location, "ldap:", 5) == 0){ | 485 if (PORT_Strncmp(location, "ldap:", 5) == 0){ |
485 type = PKIX_INFOACCESS_LOCATION_LDAP; | 486 type = PKIX_INFOACCESS_LOCATION_LDAP; |
486 } else | 487 } else |
| 488 #endif |
487 if (PORT_Strncmp(location, "http:", 5) == 0){ | 489 if (PORT_Strncmp(location, "http:", 5) == 0){ |
488 type = PKIX_INFOACCESS_LOCATION_HTTP; | 490 type = PKIX_INFOACCESS_LOCATION_HTTP; |
489 } | 491 } |
490 } | 492 } |
491 | 493 |
492 *pType = type; | 494 *pType = type; |
493 | 495 |
494 cleanup: | 496 cleanup: |
495 | 497 |
496 PKIX_PL_Free(location, plContext); | 498 PKIX_PL_Free(location, plContext); |
497 PKIX_DECREF(locationString); | 499 PKIX_DECREF(locationString); |
498 | 500 |
499 PKIX_RETURN(INFOACCESS); | 501 PKIX_RETURN(INFOACCESS); |
500 } | 502 } |
501 | 503 |
| 504 #ifndef NSS_PKIX_NO_LDAP |
502 /* | 505 /* |
503 * FUNCTION: pkix_pl_InfoAccess_ParseTokens | 506 * FUNCTION: pkix_pl_InfoAccess_ParseTokens |
504 * DESCRIPTION: | 507 * DESCRIPTION: |
505 * | 508 * |
506 * This function parses the string beginning at "startPos" into tokens using | 509 * This function parses the string beginning at "startPos" into tokens using |
507 * the separator contained in "separator" and the terminator contained in | 510 * the separator contained in "separator" and the terminator contained in |
508 * "terminator", copying the tokens into space allocated from the arena | 511 * "terminator", copying the tokens into space allocated from the arena |
509 * pointed to by "arena". It stores in "tokens" a null-terminated array of | 512 * pointed to by "arena". It stores in "tokens" a null-terminated array of |
510 * pointers to those tokens. | 513 * pointers to those tokens. |
511 * | 514 * |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 attr = *(++attrArray); | 864 attr = *(++attrArray); |
862 } | 865 } |
863 | 866 |
864 cleanup: | 867 cleanup: |
865 | 868 |
866 PKIX_PL_Free(locationAscii, plContext); | 869 PKIX_PL_Free(locationAscii, plContext); |
867 PKIX_DECREF(locationString); | 870 PKIX_DECREF(locationString); |
868 | 871 |
869 PKIX_RETURN(INFOACCESS); | 872 PKIX_RETURN(INFOACCESS); |
870 } | 873 } |
| 874 #endif /* !NSS_PKIX_NO_LDAP */ |
OLD | NEW |