OLD | NEW |
1 /* | 1 /* |
2 * Merge the source token into the target token. | 2 * Merge the source token into the target token. |
3 */ | 3 */ |
4 | 4 |
5 #include "secmod.h" | 5 #include "secmod.h" |
6 #include "secmodi.h" | 6 #include "secmodi.h" |
7 #include "secmodti.h" | 7 #include "secmodti.h" |
8 #include "pk11pub.h" | 8 #include "pk11pub.h" |
9 #include "pk11priv.h" | 9 #include "pk11priv.h" |
10 #include "pkcs11.h" | 10 #include "pkcs11.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 * | 314 * |
315 *************************************************************************/ | 315 *************************************************************************/ |
316 | 316 |
317 /* | 317 /* |
318 * we need to find a unique CKA_ID. | 318 * we need to find a unique CKA_ID. |
319 * The basic idea is to just increment the lowest byte. | 319 * The basic idea is to just increment the lowest byte. |
320 * This code also handles the following corner cases: | 320 * This code also handles the following corner cases: |
321 * 1) the single byte overflows. On overflow we increment the next byte up | 321 * 1) the single byte overflows. On overflow we increment the next byte up |
322 * and so forth until we have overflowed the entire CKA_ID. | 322 * and so forth until we have overflowed the entire CKA_ID. |
323 * 2) If we overflow the entire CKA_ID we expand it by one byte. | 323 * 2) If we overflow the entire CKA_ID we expand it by one byte. |
324 * 3) the CKA_ID is non-existant, we create a new one with one byte. | 324 * 3) the CKA_ID is non-existent, we create a new one with one byte. |
325 * This means no matter what CKA_ID is passed, the result of this function | 325 * This means no matter what CKA_ID is passed, the result of this function |
326 * is always a new CKA_ID, and this function will never return the same | 326 * is always a new CKA_ID, and this function will never return the same |
327 * CKA_ID the it has returned in the passed. | 327 * CKA_ID the it has returned in the passed. |
328 */ | 328 */ |
329 static SECStatus | 329 static SECStatus |
330 pk11_incrementID(PRArenaPool *arena, CK_ATTRIBUTE *ptemplate) | 330 pk11_incrementID(PRArenaPool *arena, CK_ATTRIBUTE *ptemplate) |
331 { | 331 { |
332 unsigned char *buf = ptemplate->pValue; | 332 unsigned char *buf = ptemplate->pValue; |
333 CK_ULONG len = ptemplate->ulValueLen; | 333 CK_ULONG len = ptemplate->ulValueLen; |
334 | 334 |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1406 return log; | 1406 return log; |
1407 } | 1407 } |
1408 | 1408 |
1409 void | 1409 void |
1410 PK11_DestroyMergeLog(PK11MergeLog *log) | 1410 PK11_DestroyMergeLog(PK11MergeLog *log) |
1411 { | 1411 { |
1412 if (log && log->arena) { | 1412 if (log && log->arena) { |
1413 PORT_FreeArena(log->arena, PR_FALSE); | 1413 PORT_FreeArena(log->arena, PR_FALSE); |
1414 } | 1414 } |
1415 } | 1415 } |
OLD | NEW |