rv = SEC_ASN1DecodeItem(arena, &sdrResult, template, data);
rv = SEC_QuickDERDecodeItem(arena, &sdrResult, template, data);
PK11SDR_Decrypt(SECItem *data, SECItem *result, void *cx){  SECStatus rv = SECSuccess;  PK11SlotInfo *slot = 0;  PK11SymKey *key = 0;  PK11Context *ctx = 0;  CK_MECHANISM_TYPE type;  SDRResult sdrResult;  SECItem *params = 0;  SECItem paddedResult;  PLArenaPool *arena = 0;  paddedResult.len = 0;  paddedResult.data = 0;  arena = PORT_NewArena(SEC_ASN1_DEFAULT_ARENA_SIZE);  if (!arena) { rv = SECFailure; goto loser; }  /* Decode the incoming data */  memset(&sdrResult, 0, sizeof sdrResult);  rv = SEC_ASN1DecodeItem(arena, &sdrResult, template, data);  if (rv != SECSuccess) goto loser;  /* Invalid format */  /* Find the slot and key for the given keyid */  slot = PK11_GetInternalKeySlot();  if (!slot) { rv = SECFailure; goto loser; }  rv = PK11_Authenticate(slot, PR_TRUE, cx);  if (rv != SECSuccess) goto loser;  /* Use triple-DES (Should look up the algorithm) */  type = CKM_DES3_CBC;  key = PK11_FindFixedKey(slot, type, &sdrResult.keyid, cx);  if (!key) { rv = SECFailure; goto loser; }  /* Get the parameter values from the data */  params = PK11_ParamFromAlgid(&sdrResult.alg);  if (!params) { rv = SECFailure; goto loser; }  ctx = PK11_CreateContextBySymKey(type, CKA_DECRYPT, key, params);  if (!ctx) { rv = SECFailure; goto loser; }  paddedResult.len = sdrResult.data.len;  paddedResult.data = PORT_ArenaAlloc(arena, paddedResult.len);  rv = PK11_CipherOp(ctx, paddedResult.data, (int*)&paddedResult.len, paddedResult.len,                     sdrResult.data.data, sdrResult.data.len);  if (rv != SECSuccess) goto loser;  PK11_Finalize(ctx);  /* Remove the padding */  rv = unpadBlock(&paddedResult, PK11_GetBlockSize(type, 0), result);  if (rv) goto loser;loser:  /* SECITEM_ZfreeItem(&paddedResult, PR_FALSE); */  if (arena) PORT_FreeArena(arena, PR_TRUE);  if (ctx) PK11_DestroyContext(ctx, PR_TRUE);  if (key) PK11_FreeSymKey(key);  if (params) SECITEM_ZfreeItem(params, PR_TRUE);  if (slot) PK11_FreeSlot(slot);  return rv;}