security/nss/lib/libpkix/pkix/certsel/pkix_comcertselparams.c

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rwxr-xr-x

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4 /*
michael@0 5 * pkix_comcertselparams.c
michael@0 6 *
michael@0 7 * ComCertSelParams Object Functions
michael@0 8 *
michael@0 9 */
michael@0 10
michael@0 11 #include "pkix_comcertselparams.h"
michael@0 12
michael@0 13 /* --Private-Functions-------------------------------------------- */
michael@0 14
michael@0 15 /*
michael@0 16 * FUNCTION: pkix_ComCertSelParams_Destroy
michael@0 17 * (see comments for PKIX_PL_DestructorCallback in pkix_pl_system.h)
michael@0 18 */
michael@0 19 static PKIX_Error *
michael@0 20 pkix_ComCertSelParams_Destroy(
michael@0 21 PKIX_PL_Object *object,
michael@0 22 void *plContext)
michael@0 23 {
michael@0 24 PKIX_ComCertSelParams *params = NULL;
michael@0 25
michael@0 26 PKIX_ENTER(COMCERTSELPARAMS, "pkix_ComCertSelParams_Destroy");
michael@0 27 PKIX_NULLCHECK_ONE(object);
michael@0 28
michael@0 29 /* Check that this object is a comCertSelParams object */
michael@0 30 PKIX_CHECK(pkix_CheckType
michael@0 31 (object, PKIX_COMCERTSELPARAMS_TYPE, plContext),
michael@0 32 PKIX_OBJECTNOTCOMCERTSELPARAMS);
michael@0 33
michael@0 34 params = (PKIX_ComCertSelParams *)object;
michael@0 35
michael@0 36 PKIX_DECREF(params->subject);
michael@0 37 PKIX_DECREF(params->policies);
michael@0 38 PKIX_DECREF(params->cert);
michael@0 39 PKIX_DECREF(params->nameConstraints);
michael@0 40 PKIX_DECREF(params->pathToNames);
michael@0 41 PKIX_DECREF(params->subjAltNames);
michael@0 42 PKIX_DECREF(params->date);
michael@0 43 PKIX_DECREF(params->extKeyUsage);
michael@0 44 PKIX_DECREF(params->certValid);
michael@0 45 PKIX_DECREF(params->issuer);
michael@0 46 PKIX_DECREF(params->serialNumber);
michael@0 47 PKIX_DECREF(params->authKeyId);
michael@0 48 PKIX_DECREF(params->subjKeyId);
michael@0 49 PKIX_DECREF(params->subjPubKey);
michael@0 50 PKIX_DECREF(params->subjPKAlgId);
michael@0 51
michael@0 52 cleanup:
michael@0 53
michael@0 54 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 55 }
michael@0 56
michael@0 57 /*
michael@0 58 * FUNCTION: pkix_ComCertSelParams_Duplicate
michael@0 59 * (see comments for PKIX_PL_DuplicateCallback in pkix_pl_system.h)
michael@0 60 */
michael@0 61 static PKIX_Error *
michael@0 62 pkix_ComCertSelParams_Duplicate(
michael@0 63 PKIX_PL_Object *object,
michael@0 64 PKIX_PL_Object **pNewObject,
michael@0 65 void *plContext)
michael@0 66 {
michael@0 67 PKIX_ComCertSelParams *params = NULL;
michael@0 68 PKIX_ComCertSelParams *paramsDuplicate = NULL;
michael@0 69
michael@0 70 PKIX_ENTER(COMCERTSELPARAMS, "pkix_ComCertSelParams_Duplicate");
michael@0 71 PKIX_NULLCHECK_TWO(object, pNewObject);
michael@0 72
michael@0 73 PKIX_CHECK(pkix_CheckType
michael@0 74 (object, PKIX_COMCERTSELPARAMS_TYPE, plContext),
michael@0 75 PKIX_OBJECTNOTCOMCERTSELPARAMS);
michael@0 76
michael@0 77 params = (PKIX_ComCertSelParams *)object;
michael@0 78
michael@0 79 PKIX_CHECK(PKIX_ComCertSelParams_Create(&paramsDuplicate, plContext),
michael@0 80 PKIX_COMCERTSELPARAMSCREATEFAILED);
michael@0 81
michael@0 82 paramsDuplicate->minPathLength = params->minPathLength;
michael@0 83 paramsDuplicate->matchAllSubjAltNames = params->matchAllSubjAltNames;
michael@0 84
michael@0 85 PKIX_DUPLICATE(params->subject, &paramsDuplicate->subject, plContext,
michael@0 86 PKIX_OBJECTDUPLICATEFAILED);
michael@0 87
michael@0 88 PKIX_DUPLICATE(params->policies, &paramsDuplicate->policies, plContext,
michael@0 89 PKIX_OBJECTDUPLICATEFAILED);
michael@0 90
michael@0 91 if (params->cert){
michael@0 92 PKIX_CHECK(PKIX_PL_Object_Duplicate
michael@0 93 ((PKIX_PL_Object *)params->cert,
michael@0 94 (PKIX_PL_Object **)&paramsDuplicate->cert,
michael@0 95 plContext),
michael@0 96 PKIX_OBJECTDUPLICATEFAILED);
michael@0 97 }
michael@0 98
michael@0 99 PKIX_DUPLICATE
michael@0 100 (params->nameConstraints,
michael@0 101 &paramsDuplicate->nameConstraints,
michael@0 102 plContext,
michael@0 103 PKIX_OBJECTDUPLICATEFAILED);
michael@0 104
michael@0 105 PKIX_DUPLICATE
michael@0 106 (params->pathToNames,
michael@0 107 &paramsDuplicate->pathToNames,
michael@0 108 plContext,
michael@0 109 PKIX_OBJECTDUPLICATEFAILED);
michael@0 110
michael@0 111 PKIX_DUPLICATE
michael@0 112 (params->subjAltNames,
michael@0 113 &paramsDuplicate->subjAltNames,
michael@0 114 plContext,
michael@0 115 PKIX_OBJECTDUPLICATEFAILED);
michael@0 116
michael@0 117 if (params->date){
michael@0 118 PKIX_CHECK(PKIX_PL_Object_Duplicate
michael@0 119 ((PKIX_PL_Object *)params->date,
michael@0 120 (PKIX_PL_Object **)&paramsDuplicate->date,
michael@0 121 plContext),
michael@0 122 PKIX_OBJECTDUPLICATEFAILED);
michael@0 123 }
michael@0 124
michael@0 125 paramsDuplicate->keyUsage = params->keyUsage;
michael@0 126
michael@0 127 PKIX_DUPLICATE(params->certValid,
michael@0 128 &paramsDuplicate->certValid,
michael@0 129 plContext,
michael@0 130 PKIX_OBJECTDUPLICATEFAILED);
michael@0 131
michael@0 132 PKIX_DUPLICATE(params->issuer,
michael@0 133 &paramsDuplicate->issuer,
michael@0 134 plContext,
michael@0 135 PKIX_OBJECTDUPLICATEFAILED);
michael@0 136
michael@0 137 PKIX_DUPLICATE(params->serialNumber,
michael@0 138 &paramsDuplicate->serialNumber,
michael@0 139 plContext,
michael@0 140 PKIX_OBJECTDUPLICATEFAILED);
michael@0 141
michael@0 142 PKIX_DUPLICATE(params->authKeyId,
michael@0 143 &paramsDuplicate->authKeyId,
michael@0 144 plContext,
michael@0 145 PKIX_OBJECTDUPLICATEFAILED);
michael@0 146
michael@0 147 PKIX_DUPLICATE(params->subjKeyId,
michael@0 148 &paramsDuplicate->subjKeyId,
michael@0 149 plContext,
michael@0 150 PKIX_OBJECTDUPLICATEFAILED);
michael@0 151
michael@0 152 PKIX_DUPLICATE(params->subjPubKey,
michael@0 153 &paramsDuplicate->subjPubKey,
michael@0 154 plContext,
michael@0 155 PKIX_OBJECTDUPLICATEFAILED);
michael@0 156
michael@0 157 PKIX_DUPLICATE(params->subjPKAlgId,
michael@0 158 &paramsDuplicate->subjPKAlgId,
michael@0 159 plContext,
michael@0 160 PKIX_OBJECTDUPLICATEFAILED);
michael@0 161
michael@0 162 paramsDuplicate->leafCertFlag = params->leafCertFlag;
michael@0 163
michael@0 164 *pNewObject = (PKIX_PL_Object *)paramsDuplicate;
michael@0 165
michael@0 166 cleanup:
michael@0 167
michael@0 168 if (PKIX_ERROR_RECEIVED){
michael@0 169 PKIX_DECREF(paramsDuplicate);
michael@0 170 }
michael@0 171
michael@0 172 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 173 }
michael@0 174
michael@0 175 /*
michael@0 176 * FUNCTION: pkix_ComCertSelParams_RegisterSelf
michael@0 177 * DESCRIPTION:
michael@0 178 * Registers PKIX_COMCERTSELPARAMS_TYPE and its related functions with
michael@0 179 * systemClasses[]
michael@0 180 * THREAD SAFETY:
michael@0 181 * Not Thread Safe - for performance and complexity reasons
michael@0 182 *
michael@0 183 * Since this function is only called by PKIX_PL_Initialize, which should
michael@0 184 * only be called once, it is acceptable that this function is not
michael@0 185 * thread-safe.
michael@0 186 */
michael@0 187 PKIX_Error *
michael@0 188 pkix_ComCertSelParams_RegisterSelf(void *plContext)
michael@0 189 {
michael@0 190 extern pkix_ClassTable_Entry systemClasses[PKIX_NUMTYPES];
michael@0 191 pkix_ClassTable_Entry* entry = &systemClasses[PKIX_COMCERTSELPARAMS_TYPE];
michael@0 192
michael@0 193 PKIX_ENTER(COMCERTSELPARAMS, "pkix_ComCertSelParams_RegisterSelf");
michael@0 194
michael@0 195 entry->description = "ComCertSelParams";
michael@0 196 entry->typeObjectSize = sizeof(PKIX_ComCertSelParams);
michael@0 197 entry->destructor = pkix_ComCertSelParams_Destroy;
michael@0 198 entry->duplicateFunction = pkix_ComCertSelParams_Duplicate;
michael@0 199
michael@0 200 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 201 }
michael@0 202
michael@0 203 /* --Public-Functions--------------------------------------------- */
michael@0 204
michael@0 205
michael@0 206 /*
michael@0 207 * FUNCTION: PKIX_ComCertSelParams_Create (see comments in pkix_certsel.h)
michael@0 208 */
michael@0 209 PKIX_Error *
michael@0 210 PKIX_ComCertSelParams_Create(
michael@0 211 PKIX_ComCertSelParams **pParams,
michael@0 212 void *plContext)
michael@0 213 {
michael@0 214 PKIX_ComCertSelParams *params = NULL;
michael@0 215
michael@0 216 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_Create");
michael@0 217 PKIX_NULLCHECK_ONE(pParams);
michael@0 218
michael@0 219 PKIX_CHECK(PKIX_PL_Object_Alloc
michael@0 220 (PKIX_COMCERTSELPARAMS_TYPE,
michael@0 221 sizeof (PKIX_ComCertSelParams),
michael@0 222 (PKIX_PL_Object **)&params,
michael@0 223 plContext),
michael@0 224 PKIX_COULDNOTCREATECOMMONCERTSELPARAMSOBJECT);
michael@0 225
michael@0 226 /* initialize fields */
michael@0 227 params->version = 0xFFFFFFFF;
michael@0 228 params->minPathLength = -1;
michael@0 229 params->matchAllSubjAltNames = PKIX_TRUE;
michael@0 230 params->subject = NULL;
michael@0 231 params->policies = NULL;
michael@0 232 params->cert = NULL;
michael@0 233 params->nameConstraints = NULL;
michael@0 234 params->pathToNames = NULL;
michael@0 235 params->subjAltNames = NULL;
michael@0 236 params->extKeyUsage = NULL;
michael@0 237 params->keyUsage = 0;
michael@0 238 params->extKeyUsage = NULL;
michael@0 239 params->keyUsage = 0;
michael@0 240 params->date = NULL;
michael@0 241 params->certValid = NULL;
michael@0 242 params->issuer = NULL;
michael@0 243 params->serialNumber = NULL;
michael@0 244 params->authKeyId = NULL;
michael@0 245 params->subjKeyId = NULL;
michael@0 246 params->subjPubKey = NULL;
michael@0 247 params->subjPKAlgId = NULL;
michael@0 248 params->leafCertFlag = PKIX_FALSE;
michael@0 249
michael@0 250 *pParams = params;
michael@0 251
michael@0 252 cleanup:
michael@0 253
michael@0 254 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 255
michael@0 256 }
michael@0 257
michael@0 258 /*
michael@0 259 * FUNCTION: PKIX_ComCertSelParams_GetSubject (see comments in pkix_certsel.h)
michael@0 260 */
michael@0 261 PKIX_Error *
michael@0 262 PKIX_ComCertSelParams_GetSubject(
michael@0 263 PKIX_ComCertSelParams *params,
michael@0 264 PKIX_PL_X500Name **pSubject,
michael@0 265 void *plContext)
michael@0 266 {
michael@0 267 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetSubject");
michael@0 268 PKIX_NULLCHECK_TWO(params, pSubject);
michael@0 269
michael@0 270 PKIX_INCREF(params->subject);
michael@0 271
michael@0 272 *pSubject = params->subject;
michael@0 273
michael@0 274 cleanup:
michael@0 275 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 276 }
michael@0 277
michael@0 278 /*
michael@0 279 * FUNCTION: PKIX_ComCertSelParams_SetSubject (see comments in pkix_certsel.h)
michael@0 280 */
michael@0 281 PKIX_Error *
michael@0 282 PKIX_ComCertSelParams_SetSubject(
michael@0 283 PKIX_ComCertSelParams *params,
michael@0 284 PKIX_PL_X500Name *subject,
michael@0 285 void *plContext)
michael@0 286 {
michael@0 287 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetSubject");
michael@0 288 PKIX_NULLCHECK_ONE(params);
michael@0 289
michael@0 290 PKIX_DECREF(params->subject);
michael@0 291
michael@0 292 PKIX_INCREF(subject);
michael@0 293
michael@0 294 params->subject = subject;
michael@0 295
michael@0 296 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 297 ((PKIX_PL_Object *)params, plContext),
michael@0 298 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 299
michael@0 300 cleanup:
michael@0 301
michael@0 302 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 303 }
michael@0 304
michael@0 305
michael@0 306 /*
michael@0 307 * FUNCTION: PKIX_ComCertSelParams_GetBasicConstraints
michael@0 308 * (see comments in pkix_certsel.h)
michael@0 309 */
michael@0 310 PKIX_Error *
michael@0 311 PKIX_ComCertSelParams_GetBasicConstraints(
michael@0 312 PKIX_ComCertSelParams *params,
michael@0 313 PKIX_Int32 *pMinPathLength,
michael@0 314 void *plContext)
michael@0 315 {
michael@0 316 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 317 "PKIX_ComCertSelParams_GetBasicConstraints");
michael@0 318 PKIX_NULLCHECK_TWO(params, pMinPathLength);
michael@0 319
michael@0 320 *pMinPathLength = params->minPathLength;
michael@0 321
michael@0 322 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 323 }
michael@0 324
michael@0 325
michael@0 326 /*
michael@0 327 * FUNCTION: PKIX_ComCertSelParams_SetBasicConstraints
michael@0 328 * (see comments in pkix_certsel.h)
michael@0 329 */
michael@0 330 PKIX_Error *
michael@0 331 PKIX_ComCertSelParams_SetBasicConstraints(
michael@0 332 PKIX_ComCertSelParams *params,
michael@0 333 PKIX_Int32 minPathLength,
michael@0 334 void *plContext)
michael@0 335 {
michael@0 336 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 337 "PKIX_ComCertSelParams_SetBasicConstraints");
michael@0 338 PKIX_NULLCHECK_ONE(params);
michael@0 339
michael@0 340 params->minPathLength = minPathLength;
michael@0 341
michael@0 342 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 343 ((PKIX_PL_Object *)params, plContext),
michael@0 344 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 345
michael@0 346 cleanup:
michael@0 347
michael@0 348 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 349 }
michael@0 350
michael@0 351
michael@0 352 /*
michael@0 353 * FUNCTION: PKIX_ComCertSelParams_GetPolicy (see comments in pkix_certsel.h)
michael@0 354 */
michael@0 355 PKIX_Error *
michael@0 356 PKIX_ComCertSelParams_GetPolicy(
michael@0 357 PKIX_ComCertSelParams *params,
michael@0 358 PKIX_List **pPolicy, /* List of PKIX_PL_OID */
michael@0 359 void *plContext)
michael@0 360 {
michael@0 361 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetPolicy");
michael@0 362 PKIX_NULLCHECK_TWO(params, pPolicy);
michael@0 363
michael@0 364 PKIX_INCREF(params->policies);
michael@0 365 *pPolicy = params->policies;
michael@0 366
michael@0 367 cleanup:
michael@0 368 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 369 }
michael@0 370
michael@0 371 /*
michael@0 372 * FUNCTION: PKIX_ComCertSelParams_SetPolicy (see comments in pkix_certsel.h)
michael@0 373 */
michael@0 374 PKIX_Error *
michael@0 375 PKIX_ComCertSelParams_SetPolicy(
michael@0 376 PKIX_ComCertSelParams *params,
michael@0 377 PKIX_List *policy, /* List of PKIX_PL_OID */
michael@0 378 void *plContext)
michael@0 379 {
michael@0 380 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetPolicy");
michael@0 381 PKIX_NULLCHECK_ONE(params);
michael@0 382
michael@0 383 PKIX_DECREF(params->policies);
michael@0 384 PKIX_INCREF(policy);
michael@0 385 params->policies = policy;
michael@0 386
michael@0 387 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 388 ((PKIX_PL_Object *)params, plContext),
michael@0 389 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 390 cleanup:
michael@0 391
michael@0 392 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 393 }
michael@0 394
michael@0 395 /*
michael@0 396 * FUNCTION: PKIX_ComCertSelParams_GetCertificate
michael@0 397 * (see comments in pkix_certsel.h)
michael@0 398 */
michael@0 399 PKIX_Error *
michael@0 400 PKIX_ComCertSelParams_GetCertificate(
michael@0 401 PKIX_ComCertSelParams *params,
michael@0 402 PKIX_PL_Cert **pCert,
michael@0 403 void *plContext)
michael@0 404 {
michael@0 405 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetCertificate");
michael@0 406 PKIX_NULLCHECK_TWO(params, pCert);
michael@0 407
michael@0 408 PKIX_INCREF(params->cert);
michael@0 409 *pCert = params->cert;
michael@0 410
michael@0 411 cleanup:
michael@0 412 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 413 }
michael@0 414
michael@0 415 /*
michael@0 416 * FUNCTION: PKIX_ComCertSelParams_SetCertificate
michael@0 417 * (see comments in pkix_certsel.h)
michael@0 418 */
michael@0 419 PKIX_Error *
michael@0 420 PKIX_ComCertSelParams_SetCertificate(
michael@0 421 PKIX_ComCertSelParams *params,
michael@0 422 PKIX_PL_Cert *cert,
michael@0 423 void *plContext)
michael@0 424 {
michael@0 425 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetCertificate");
michael@0 426 PKIX_NULLCHECK_ONE(params);
michael@0 427
michael@0 428 PKIX_DECREF(params->cert);
michael@0 429 PKIX_INCREF(cert);
michael@0 430 params->cert = cert;
michael@0 431
michael@0 432 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 433 ((PKIX_PL_Object *)params, plContext),
michael@0 434 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 435 cleanup:
michael@0 436
michael@0 437 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 438 }
michael@0 439
michael@0 440 /*
michael@0 441 * FUNCTION: PKIX_ComCertSelParams_GetCertificateValid
michael@0 442 * (see comments in pkix_certsel.h)
michael@0 443 */
michael@0 444 PKIX_Error *
michael@0 445 PKIX_ComCertSelParams_GetCertificateValid(
michael@0 446 PKIX_ComCertSelParams *params,
michael@0 447 PKIX_PL_Date **pDate,
michael@0 448 void *plContext)
michael@0 449 {
michael@0 450 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 451 "PKIX_ComCertSelParams_GetCertificateValid");
michael@0 452
michael@0 453 PKIX_NULLCHECK_TWO(params, pDate);
michael@0 454
michael@0 455 PKIX_INCREF(params->date);
michael@0 456 *pDate = params->date;
michael@0 457
michael@0 458 cleanup:
michael@0 459 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 460 }
michael@0 461
michael@0 462 /*
michael@0 463 * FUNCTION: PKIX_ComCertSelParams_SetCertificateValid
michael@0 464 * (see comments in pkix_certsel.h)
michael@0 465 */
michael@0 466 PKIX_Error *
michael@0 467 PKIX_ComCertSelParams_SetCertificateValid(
michael@0 468 PKIX_ComCertSelParams *params,
michael@0 469 PKIX_PL_Date *date,
michael@0 470 void *plContext)
michael@0 471 {
michael@0 472 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 473 "PKIX_ComCertSelParams_SetCertificateValid");
michael@0 474 PKIX_NULLCHECK_ONE(params);
michael@0 475
michael@0 476 PKIX_DECREF(params->date);
michael@0 477 PKIX_INCREF(date);
michael@0 478 params->date = date;
michael@0 479
michael@0 480 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 481 ((PKIX_PL_Object *)params, plContext),
michael@0 482 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 483 cleanup:
michael@0 484
michael@0 485 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 486 }
michael@0 487
michael@0 488 /*
michael@0 489 * FUNCTION: PKIX_ComCertSelParams_GetNameConstraints
michael@0 490 * (see comments in pkix_certsel.h)
michael@0 491 */
michael@0 492 PKIX_Error *
michael@0 493 PKIX_ComCertSelParams_GetNameConstraints(
michael@0 494 PKIX_ComCertSelParams *params,
michael@0 495 PKIX_PL_CertNameConstraints **pNameConstraints,
michael@0 496 void *plContext)
michael@0 497 {
michael@0 498 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 499 "PKIX_ComCertSelParams_GetNameConstraints");
michael@0 500 PKIX_NULLCHECK_TWO(params, pNameConstraints);
michael@0 501
michael@0 502 PKIX_INCREF(params->nameConstraints);
michael@0 503
michael@0 504 *pNameConstraints = params->nameConstraints;
michael@0 505
michael@0 506 cleanup:
michael@0 507 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 508 }
michael@0 509
michael@0 510 /*
michael@0 511 * FUNCTION: PKIX_ComCertSelParams_SetNameConstraints
michael@0 512 * (see comments in pkix_certsel.h)
michael@0 513 */
michael@0 514 PKIX_Error *
michael@0 515 PKIX_ComCertSelParams_SetNameConstraints(
michael@0 516 PKIX_ComCertSelParams *params,
michael@0 517 PKIX_PL_CertNameConstraints *nameConstraints,
michael@0 518 void *plContext)
michael@0 519 {
michael@0 520 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 521 "PKIX_ComCertSelParams_SetNameConstraints");
michael@0 522 PKIX_NULLCHECK_ONE(params);
michael@0 523
michael@0 524 PKIX_DECREF(params->nameConstraints);
michael@0 525 PKIX_INCREF(nameConstraints);
michael@0 526 params->nameConstraints = nameConstraints;
michael@0 527
michael@0 528 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 529 ((PKIX_PL_Object *)params, plContext),
michael@0 530 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 531
michael@0 532 cleanup:
michael@0 533
michael@0 534 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 535 }
michael@0 536
michael@0 537 /*
michael@0 538 * FUNCTION: PKIX_ComCertSelParams_GetPathToNames
michael@0 539 * (see comments in pkix_certsel.h)
michael@0 540 */PKIX_Error *
michael@0 541 PKIX_ComCertSelParams_GetPathToNames(
michael@0 542 PKIX_ComCertSelParams *params,
michael@0 543 PKIX_List **pNames, /* list of PKIX_PL_GeneralName */
michael@0 544 void *plContext)
michael@0 545 {
michael@0 546 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetPathToNames");
michael@0 547 PKIX_NULLCHECK_TWO(params, pNames);
michael@0 548
michael@0 549 PKIX_INCREF(params->pathToNames);
michael@0 550
michael@0 551 *pNames = params->pathToNames;
michael@0 552
michael@0 553 cleanup:
michael@0 554 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 555 }
michael@0 556
michael@0 557 /*
michael@0 558 * FUNCTION: PKIX_ComCertSelParams_SetPathToNames
michael@0 559 * (see comments in pkix_certsel.h)
michael@0 560 */
michael@0 561 PKIX_Error *
michael@0 562 PKIX_ComCertSelParams_SetPathToNames(
michael@0 563 PKIX_ComCertSelParams *params,
michael@0 564 PKIX_List *names, /* list of PKIX_PL_GeneralName */
michael@0 565 void *plContext)
michael@0 566 {
michael@0 567 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetPathToNames");
michael@0 568 PKIX_NULLCHECK_ONE(params);
michael@0 569
michael@0 570 PKIX_DECREF(params->pathToNames);
michael@0 571 PKIX_INCREF(names);
michael@0 572
michael@0 573 params->pathToNames = names;
michael@0 574
michael@0 575 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 576 ((PKIX_PL_Object *)params, plContext),
michael@0 577 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 578
michael@0 579 cleanup:
michael@0 580
michael@0 581 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 582 }
michael@0 583
michael@0 584 /*
michael@0 585 * FUNCTION: PKIX_ComCertSelParams_AddPathToName
michael@0 586 * (see comments in pkix_certsel.h)
michael@0 587 */
michael@0 588 PKIX_Error *
michael@0 589 PKIX_ComCertSelParams_AddPathToName(
michael@0 590 PKIX_ComCertSelParams *params,
michael@0 591 PKIX_PL_GeneralName *name,
michael@0 592 void *plContext)
michael@0 593 {
michael@0 594 PKIX_List *pathToNamesList = NULL;
michael@0 595
michael@0 596 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_AddPathToName");
michael@0 597 PKIX_NULLCHECK_ONE(params);
michael@0 598
michael@0 599 if (name == NULL) {
michael@0 600 goto cleanup;
michael@0 601 }
michael@0 602
michael@0 603 if (params->pathToNames == NULL) {
michael@0 604 /* Create a list for name item */
michael@0 605 PKIX_CHECK(PKIX_List_Create(&pathToNamesList, plContext),
michael@0 606 PKIX_LISTCREATEFAILED);
michael@0 607
michael@0 608 params->pathToNames = pathToNamesList;
michael@0 609 }
michael@0 610
michael@0 611 PKIX_CHECK(PKIX_List_AppendItem
michael@0 612 (params->pathToNames, (PKIX_PL_Object *)name, plContext),
michael@0 613 PKIX_LISTAPPENDITEMFAILED);
michael@0 614
michael@0 615 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 616 ((PKIX_PL_Object *)params, plContext),
michael@0 617 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 618
michael@0 619 cleanup:
michael@0 620
michael@0 621 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 622 }
michael@0 623
michael@0 624 /*
michael@0 625 * FUNCTION: PKIX_ComCertSelParams_GetSubjAltNames
michael@0 626 * (see comments in pkix_certsel.h)
michael@0 627 */
michael@0 628 PKIX_Error *
michael@0 629 PKIX_ComCertSelParams_GetSubjAltNames(
michael@0 630 PKIX_ComCertSelParams *params,
michael@0 631 PKIX_List **pNames, /* list of PKIX_PL_GeneralName */
michael@0 632 void *plContext)
michael@0 633 {
michael@0 634 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetSubjAltNames");
michael@0 635 PKIX_NULLCHECK_TWO(params, pNames);
michael@0 636
michael@0 637 PKIX_INCREF(params->subjAltNames);
michael@0 638
michael@0 639 *pNames = params->subjAltNames;
michael@0 640
michael@0 641 cleanup:
michael@0 642 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 643 }
michael@0 644
michael@0 645 /*
michael@0 646 * FUNCTION: PKIX_ComCertSelParams_SetSubjAltNames
michael@0 647 * (see comments in pkix_certsel.h)
michael@0 648 */
michael@0 649 PKIX_Error *
michael@0 650 PKIX_ComCertSelParams_SetSubjAltNames(
michael@0 651 PKIX_ComCertSelParams *params,
michael@0 652 PKIX_List *names, /* list of PKIX_PL_GeneralName */
michael@0 653 void *plContext)
michael@0 654 {
michael@0 655 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetSubjAltNames");
michael@0 656 PKIX_NULLCHECK_TWO(params, names);
michael@0 657
michael@0 658 PKIX_DECREF(params->subjAltNames);
michael@0 659 PKIX_INCREF(names);
michael@0 660
michael@0 661 params->subjAltNames = names;
michael@0 662
michael@0 663 cleanup:
michael@0 664 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 665 }
michael@0 666
michael@0 667 /*
michael@0 668 * FUNCTION: PKIX_ComCertSelParams_AddSubjAltNames
michael@0 669 * (see comments in pkix_certsel.h)
michael@0 670 */
michael@0 671 PKIX_Error *
michael@0 672 PKIX_ComCertSelParams_AddSubjAltName(
michael@0 673 PKIX_ComCertSelParams *params,
michael@0 674 PKIX_PL_GeneralName *name,
michael@0 675 void *plContext)
michael@0 676 {
michael@0 677 PKIX_List *list = NULL;
michael@0 678
michael@0 679 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_AddSubjAltName");
michael@0 680 PKIX_NULLCHECK_TWO(params, name);
michael@0 681
michael@0 682 if (params->subjAltNames == NULL) {
michael@0 683 PKIX_CHECK(PKIX_List_Create(&list, plContext),
michael@0 684 PKIX_LISTCREATEFAILED);
michael@0 685 params->subjAltNames = list;
michael@0 686 }
michael@0 687
michael@0 688 PKIX_CHECK(PKIX_List_AppendItem
michael@0 689 (params->subjAltNames, (PKIX_PL_Object *)name, plContext),
michael@0 690 PKIX_LISTAPPENDITEMFAILED);
michael@0 691
michael@0 692 cleanup:
michael@0 693
michael@0 694 PKIX_RETURN(COMCERTSELPARAMS)
michael@0 695 }
michael@0 696
michael@0 697 /*
michael@0 698 * FUNCTION: PKIX_ComCertSelParams_GetMatchAllSubjAltNames
michael@0 699 * (see comments in pkix_certsel.h)
michael@0 700 */
michael@0 701 PKIX_Error *
michael@0 702 PKIX_ComCertSelParams_GetMatchAllSubjAltNames(
michael@0 703 PKIX_ComCertSelParams *params,
michael@0 704 PKIX_Boolean *pMatch,
michael@0 705 void *plContext)
michael@0 706 {
michael@0 707 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 708 "PKIX_ComCertSelParams_GetMatchAllSubjAltNames");
michael@0 709 PKIX_NULLCHECK_TWO(params, pMatch);
michael@0 710
michael@0 711 *pMatch = params->matchAllSubjAltNames;
michael@0 712
michael@0 713 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 714 }
michael@0 715
michael@0 716 /*
michael@0 717 * FUNCTION: PKIX_ComCertSelParams_SetMatchAllSubjAltNames
michael@0 718 * (see comments in pkix_certsel.h)
michael@0 719 */
michael@0 720 PKIX_Error *
michael@0 721 PKIX_ComCertSelParams_SetMatchAllSubjAltNames(
michael@0 722 PKIX_ComCertSelParams *params,
michael@0 723 PKIX_Boolean match,
michael@0 724 void *plContext)
michael@0 725 {
michael@0 726 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 727 "PKIX_ComCertSelParams_SetMatchAllSubjAltNames");
michael@0 728 PKIX_NULLCHECK_ONE(params);
michael@0 729
michael@0 730 params->matchAllSubjAltNames = match;
michael@0 731
michael@0 732 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 733 }
michael@0 734
michael@0 735 /*
michael@0 736 * FUNCTION: PKIX_ComCertSelParams_GetExtendedKeyUsage
michael@0 737 * (see comments in pkix_certsel.h)
michael@0 738 */
michael@0 739 PKIX_Error *
michael@0 740 PKIX_ComCertSelParams_GetExtendedKeyUsage(
michael@0 741 PKIX_ComCertSelParams *params,
michael@0 742 PKIX_List **pExtKeyUsage, /* list of PKIX_PL_OID */
michael@0 743 void *plContext)
michael@0 744 {
michael@0 745 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 746 "PKIX_ComCertSelParams_GetExtendedKeyUsage");
michael@0 747 PKIX_NULLCHECK_TWO(params, pExtKeyUsage);
michael@0 748
michael@0 749 PKIX_INCREF(params->extKeyUsage);
michael@0 750 *pExtKeyUsage = params->extKeyUsage;
michael@0 751
michael@0 752 cleanup:
michael@0 753 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 754 }
michael@0 755
michael@0 756 /*
michael@0 757 * FUNCTION: PKIX_ComCertSelParams_SetExtendedKeyUsage
michael@0 758 * (see comments in pkix_certsel.h)
michael@0 759 */
michael@0 760 PKIX_Error *
michael@0 761 PKIX_ComCertSelParams_SetExtendedKeyUsage(
michael@0 762 PKIX_ComCertSelParams *params,
michael@0 763 PKIX_List *extKeyUsage, /* list of PKIX_PL_OID */
michael@0 764 void *plContext)
michael@0 765 {
michael@0 766 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 767 "PKIX_ComCertSelParams_SetExtendedKeyUsage");
michael@0 768 PKIX_NULLCHECK_ONE(params);
michael@0 769
michael@0 770 PKIX_DECREF(params->extKeyUsage);
michael@0 771 PKIX_INCREF(extKeyUsage);
michael@0 772
michael@0 773 params->extKeyUsage = extKeyUsage;
michael@0 774
michael@0 775 cleanup:
michael@0 776 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 777 }
michael@0 778
michael@0 779 /*
michael@0 780 * FUNCTION: PKIX_ComCertSelParams_GetKeyUsage
michael@0 781 * (see comments in pkix_certsel.h)
michael@0 782 */
michael@0 783 PKIX_Error *
michael@0 784 PKIX_ComCertSelParams_GetKeyUsage(
michael@0 785 PKIX_ComCertSelParams *params,
michael@0 786 PKIX_UInt32 *pKeyUsage,
michael@0 787 void *plContext)
michael@0 788 {
michael@0 789 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 790 "PKIX_ComCertSelParams_GetKeyUsage");
michael@0 791 PKIX_NULLCHECK_TWO(params, pKeyUsage);
michael@0 792
michael@0 793 *pKeyUsage = params->keyUsage;
michael@0 794
michael@0 795 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 796 }
michael@0 797
michael@0 798 /*
michael@0 799 * FUNCTION: PKIX_ComCertSelParams_SetKeyUsage
michael@0 800 * (see comments in pkix_certsel.h)
michael@0 801 */
michael@0 802 PKIX_Error *
michael@0 803 PKIX_ComCertSelParams_SetKeyUsage(
michael@0 804 PKIX_ComCertSelParams *params,
michael@0 805 PKIX_UInt32 keyUsage,
michael@0 806 void *plContext)
michael@0 807 {
michael@0 808 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 809 "PKIX_ComCertSelParams_SetKeyUsage");
michael@0 810 PKIX_NULLCHECK_ONE(params);
michael@0 811
michael@0 812 params->keyUsage = keyUsage;
michael@0 813
michael@0 814 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 815 }
michael@0 816
michael@0 817 /*
michael@0 818 * FUNCTION: PKIX_ComCertSelParams_GetIssuer
michael@0 819 * (see comments in pkix_certsel.h)
michael@0 820 */
michael@0 821 PKIX_Error *
michael@0 822 PKIX_ComCertSelParams_GetIssuer(
michael@0 823 PKIX_ComCertSelParams *params,
michael@0 824 PKIX_PL_X500Name **pIssuer,
michael@0 825 void *plContext)
michael@0 826 {
michael@0 827 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetIssuer");
michael@0 828 PKIX_NULLCHECK_TWO(params, pIssuer);
michael@0 829
michael@0 830 PKIX_INCREF(params->issuer);
michael@0 831 *pIssuer = params->issuer;
michael@0 832
michael@0 833 cleanup:
michael@0 834 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 835 }
michael@0 836
michael@0 837 /*
michael@0 838 * FUNCTION: PKIX_ComCertSelParams_SetIssuer
michael@0 839 * (see comments in pkix_certsel.h)
michael@0 840 */
michael@0 841 PKIX_Error *
michael@0 842 PKIX_ComCertSelParams_SetIssuer(
michael@0 843 PKIX_ComCertSelParams *params,
michael@0 844 PKIX_PL_X500Name *issuer,
michael@0 845 void *plContext)
michael@0 846 {
michael@0 847 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetIssuer");
michael@0 848 PKIX_NULLCHECK_ONE(params);
michael@0 849
michael@0 850 PKIX_DECREF(params->issuer);
michael@0 851 PKIX_INCREF(issuer);
michael@0 852 params->issuer = issuer;
michael@0 853
michael@0 854 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 855 ((PKIX_PL_Object *)params, plContext),
michael@0 856 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 857
michael@0 858 cleanup:
michael@0 859
michael@0 860 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 861 }
michael@0 862
michael@0 863 /*
michael@0 864 * FUNCTION: PKIX_ComCertSelParams_GetSerialNumber
michael@0 865 * (see comments in pkix_certsel.h)
michael@0 866 */
michael@0 867 PKIX_Error *
michael@0 868 PKIX_ComCertSelParams_GetSerialNumber(
michael@0 869 PKIX_ComCertSelParams *params,
michael@0 870 PKIX_PL_BigInt **pSerialNumber,
michael@0 871 void *plContext)
michael@0 872 {
michael@0 873 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetSerialNumber");
michael@0 874 PKIX_NULLCHECK_TWO(params, pSerialNumber);
michael@0 875
michael@0 876 PKIX_INCREF(params->serialNumber);
michael@0 877 *pSerialNumber = params->serialNumber;
michael@0 878
michael@0 879 cleanup:
michael@0 880 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 881 }
michael@0 882
michael@0 883 /*
michael@0 884 * FUNCTION: PKIX_ComCertSelParams_SetSerialNumber
michael@0 885 * (see comments in pkix_certsel.h)
michael@0 886 */
michael@0 887 PKIX_Error *
michael@0 888 PKIX_ComCertSelParams_SetSerialNumber(
michael@0 889 PKIX_ComCertSelParams *params,
michael@0 890 PKIX_PL_BigInt *serialNumber,
michael@0 891 void *plContext)
michael@0 892 {
michael@0 893 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetSerialNumber");
michael@0 894 PKIX_NULLCHECK_ONE(params);
michael@0 895
michael@0 896 PKIX_DECREF(params->serialNumber);
michael@0 897 PKIX_INCREF(serialNumber);
michael@0 898 params->serialNumber = serialNumber;
michael@0 899
michael@0 900 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 901 ((PKIX_PL_Object *)params, plContext),
michael@0 902 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 903
michael@0 904 cleanup:
michael@0 905
michael@0 906 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 907 }
michael@0 908
michael@0 909 /*
michael@0 910 * FUNCTION: PKIX_ComCertSelParams_GetVersion
michael@0 911 * (see comments in pkix_certsel.h)
michael@0 912 */
michael@0 913 PKIX_Error *
michael@0 914 PKIX_ComCertSelParams_GetVersion(
michael@0 915 PKIX_ComCertSelParams *params,
michael@0 916 PKIX_UInt32 *pVersion,
michael@0 917 void *plContext)
michael@0 918 {
michael@0 919 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetVersion");
michael@0 920 PKIX_NULLCHECK_TWO(params, pVersion);
michael@0 921
michael@0 922 *pVersion = params->version;
michael@0 923
michael@0 924 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 925 }
michael@0 926
michael@0 927 /*
michael@0 928 * FUNCTION: PKIX_ComCertSelParams_SetVersion
michael@0 929 * (see comments in pkix_certsel.h)
michael@0 930 */
michael@0 931 PKIX_Error *
michael@0 932 PKIX_ComCertSelParams_SetVersion(
michael@0 933 PKIX_ComCertSelParams *params,
michael@0 934 PKIX_Int32 version,
michael@0 935 void *plContext)
michael@0 936 {
michael@0 937 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetVersion");
michael@0 938 PKIX_NULLCHECK_ONE(params);
michael@0 939
michael@0 940 params->version = version;
michael@0 941
michael@0 942 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 943 ((PKIX_PL_Object *)params, plContext),
michael@0 944 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 945
michael@0 946 cleanup:
michael@0 947
michael@0 948 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 949 }
michael@0 950
michael@0 951 /*
michael@0 952 * FUNCTION: PKIX_ComCertSelParams_GetSubjKeyIdentifier
michael@0 953 * (see comments in pkix_certsel.h)
michael@0 954 */
michael@0 955 PKIX_Error *
michael@0 956 PKIX_ComCertSelParams_GetSubjKeyIdentifier(
michael@0 957 PKIX_ComCertSelParams *params,
michael@0 958 PKIX_PL_ByteArray **pSubjKeyId,
michael@0 959 void *plContext)
michael@0 960 {
michael@0 961 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 962 "PKIX_ComCertSelParams_GetSubjKeyIdentifier");
michael@0 963 PKIX_NULLCHECK_TWO(params, pSubjKeyId);
michael@0 964
michael@0 965 PKIX_INCREF(params->subjKeyId);
michael@0 966
michael@0 967 *pSubjKeyId = params->subjKeyId;
michael@0 968
michael@0 969 cleanup:
michael@0 970 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 971 }
michael@0 972
michael@0 973 /*
michael@0 974 * FUNCTION: PKIX_ComCertSelParams_SetSubjKeyIdentifier
michael@0 975 * (see comments in pkix_certsel.h)
michael@0 976 */
michael@0 977 PKIX_Error *
michael@0 978 PKIX_ComCertSelParams_SetSubjKeyIdentifier(
michael@0 979 PKIX_ComCertSelParams *params,
michael@0 980 PKIX_PL_ByteArray *subjKeyId,
michael@0 981 void *plContext)
michael@0 982 {
michael@0 983 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 984 "PKIX_ComCertSelParams_SetSubjKeyIdentifier");
michael@0 985 PKIX_NULLCHECK_ONE(params);
michael@0 986
michael@0 987 PKIX_DECREF(params->subjKeyId);
michael@0 988 PKIX_INCREF(subjKeyId);
michael@0 989
michael@0 990 params->subjKeyId = subjKeyId;
michael@0 991
michael@0 992 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 993 ((PKIX_PL_Object *)params, plContext),
michael@0 994 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 995
michael@0 996 cleanup:
michael@0 997
michael@0 998 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 999 }
michael@0 1000
michael@0 1001 /*
michael@0 1002 * FUNCTION: PKIX_ComCertSelParams_GetAuthorityKeyIdentifier
michael@0 1003 * (see comments in pkix_certsel.h)
michael@0 1004 */
michael@0 1005 PKIX_Error *
michael@0 1006 PKIX_ComCertSelParams_GetAuthorityKeyIdentifier(
michael@0 1007 PKIX_ComCertSelParams *params,
michael@0 1008 PKIX_PL_ByteArray **pAuthKeyId,
michael@0 1009 void *plContext)
michael@0 1010 {
michael@0 1011 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 1012 "PKIX_ComCertSelParams_GetAuthorityKeyIdentifier");
michael@0 1013 PKIX_NULLCHECK_TWO(params, pAuthKeyId);
michael@0 1014
michael@0 1015 PKIX_INCREF(params->authKeyId);
michael@0 1016
michael@0 1017 *pAuthKeyId = params->authKeyId;
michael@0 1018
michael@0 1019 cleanup:
michael@0 1020 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 1021 }
michael@0 1022
michael@0 1023 /*
michael@0 1024 * FUNCTION: PKIX_ComCertSelParams_SetAuthorityKeyIdentifier
michael@0 1025 * (see comments in pkix_certsel.h)
michael@0 1026 */
michael@0 1027 PKIX_Error *
michael@0 1028 PKIX_ComCertSelParams_SetAuthorityKeyIdentifier(
michael@0 1029 PKIX_ComCertSelParams *params,
michael@0 1030 PKIX_PL_ByteArray *authKeyId,
michael@0 1031 void *plContext)
michael@0 1032 {
michael@0 1033 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 1034 "PKIX_ComCertSelParams_SetAuthKeyIdentifier");
michael@0 1035 PKIX_NULLCHECK_ONE(params);
michael@0 1036
michael@0 1037 PKIX_DECREF(params->authKeyId);
michael@0 1038 PKIX_INCREF(authKeyId);
michael@0 1039
michael@0 1040 params->authKeyId = authKeyId;
michael@0 1041
michael@0 1042 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 1043 ((PKIX_PL_Object *)params, plContext),
michael@0 1044 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 1045
michael@0 1046 cleanup:
michael@0 1047
michael@0 1048 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 1049 }
michael@0 1050
michael@0 1051 /*
michael@0 1052 * FUNCTION: PKIX_ComCertSelParams_GetSubjPubKey
michael@0 1053 * (see comments in pkix_certsel.h)
michael@0 1054 */
michael@0 1055 PKIX_Error *
michael@0 1056 PKIX_ComCertSelParams_GetSubjPubKey(
michael@0 1057 PKIX_ComCertSelParams *params,
michael@0 1058 PKIX_PL_PublicKey **pSubjPubKey,
michael@0 1059 void *plContext)
michael@0 1060 {
michael@0 1061 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetSubjPubKey");
michael@0 1062 PKIX_NULLCHECK_TWO(params, pSubjPubKey);
michael@0 1063
michael@0 1064 PKIX_INCREF(params->subjPubKey);
michael@0 1065
michael@0 1066 *pSubjPubKey = params->subjPubKey;
michael@0 1067
michael@0 1068 cleanup:
michael@0 1069 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 1070 }
michael@0 1071
michael@0 1072 /*
michael@0 1073 * FUNCTION: PKIX_ComCertSelParams_SetSubjPubKey
michael@0 1074 * (see comments in pkix_certsel.h)
michael@0 1075 */
michael@0 1076 PKIX_Error *
michael@0 1077 PKIX_ComCertSelParams_SetSubjPubKey(
michael@0 1078 PKIX_ComCertSelParams *params,
michael@0 1079 PKIX_PL_PublicKey *subjPubKey,
michael@0 1080 void *plContext)
michael@0 1081 {
michael@0 1082 PKIX_ENTER(COMCERTSELPARAMS,
michael@0 1083 "PKIX_ComCertSelParams_SetSubjPubKey");
michael@0 1084 PKIX_NULLCHECK_ONE(params);
michael@0 1085
michael@0 1086 PKIX_DECREF(params->subjPubKey);
michael@0 1087 PKIX_INCREF(subjPubKey);
michael@0 1088
michael@0 1089 params->subjPubKey = subjPubKey;
michael@0 1090
michael@0 1091 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 1092 ((PKIX_PL_Object *)params, plContext),
michael@0 1093 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 1094
michael@0 1095 cleanup:
michael@0 1096
michael@0 1097 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 1098 }
michael@0 1099
michael@0 1100 /*
michael@0 1101 * FUNCTION: PKIX_ComCertSelParams_GetSubjPKAlgId
michael@0 1102 * (see comments in pkix_certsel.h)
michael@0 1103 */
michael@0 1104 PKIX_Error *
michael@0 1105 PKIX_ComCertSelParams_GetSubjPKAlgId(
michael@0 1106 PKIX_ComCertSelParams *params,
michael@0 1107 PKIX_PL_OID **pAlgId,
michael@0 1108 void *plContext)
michael@0 1109 {
michael@0 1110 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetSubjPKAlgId");
michael@0 1111 PKIX_NULLCHECK_TWO(params, pAlgId);
michael@0 1112
michael@0 1113 PKIX_INCREF(params->subjPKAlgId);
michael@0 1114
michael@0 1115 *pAlgId = params->subjPKAlgId;
michael@0 1116
michael@0 1117 cleanup:
michael@0 1118 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 1119 }
michael@0 1120
michael@0 1121 /*
michael@0 1122 * FUNCTION: PKIX_ComCertSelParams_SetSubjPKAlgId
michael@0 1123 * (see comments in pkix_certsel.h)
michael@0 1124 */
michael@0 1125 PKIX_Error *
michael@0 1126 PKIX_ComCertSelParams_SetSubjPKAlgId(
michael@0 1127 PKIX_ComCertSelParams *params,
michael@0 1128 PKIX_PL_OID *algId,
michael@0 1129 void *plContext)
michael@0 1130 {
michael@0 1131 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetSubjPKAlgId");
michael@0 1132 PKIX_NULLCHECK_ONE(params);
michael@0 1133
michael@0 1134 PKIX_DECREF(params->subjPKAlgId);
michael@0 1135 PKIX_INCREF(algId);
michael@0 1136
michael@0 1137 params->subjPKAlgId = algId;
michael@0 1138
michael@0 1139 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 1140 ((PKIX_PL_Object *)params, plContext),
michael@0 1141 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 1142
michael@0 1143 cleanup:
michael@0 1144
michael@0 1145 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 1146 }
michael@0 1147
michael@0 1148 /*
michael@0 1149 * FUNCTION: PKIX_ComCertSelParams_GetLeafCertFlag
michael@0 1150 * (see comments in pkix_certsel.h)
michael@0 1151 */
michael@0 1152 PKIX_Error*
michael@0 1153 PKIX_ComCertSelParams_GetLeafCertFlag(
michael@0 1154 PKIX_ComCertSelParams *params,
michael@0 1155 PKIX_Boolean *pLeafFlag,
michael@0 1156 void *plContext)
michael@0 1157 {
michael@0 1158 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_GetLeafCertFlag");
michael@0 1159 PKIX_NULLCHECK_TWO(params, pLeafFlag);
michael@0 1160
michael@0 1161 *pLeafFlag = params->leafCertFlag;
michael@0 1162
michael@0 1163 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 1164 }
michael@0 1165
michael@0 1166 /*
michael@0 1167 * FUNCTION: PKIX_ComCertSelParams_SetLeafCertFlag
michael@0 1168 * (see comments in pkix_certsel.h)
michael@0 1169 */
michael@0 1170 PKIX_Error *
michael@0 1171 PKIX_ComCertSelParams_SetLeafCertFlag(
michael@0 1172 PKIX_ComCertSelParams *params,
michael@0 1173 PKIX_Boolean leafFlag,
michael@0 1174 void *plContext)
michael@0 1175 {
michael@0 1176 PKIX_ENTER(COMCERTSELPARAMS, "PKIX_ComCertSelParams_SetLeafCertFlag");
michael@0 1177 PKIX_NULLCHECK_ONE(params);
michael@0 1178
michael@0 1179 params->leafCertFlag = leafFlag;
michael@0 1180
michael@0 1181 PKIX_CHECK(PKIX_PL_Object_InvalidateCache
michael@0 1182 ((PKIX_PL_Object *)params, plContext),
michael@0 1183 PKIX_OBJECTINVALIDATECACHEFAILED);
michael@0 1184
michael@0 1185 cleanup:
michael@0 1186
michael@0 1187 PKIX_RETURN(COMCERTSELPARAMS);
michael@0 1188 }

mercurial