case dsaKey:
case lowDSAKey:
ChangeKeyDBPasswordAlg(SECKEYKeyDBHandle *handle,		       SECItem *oldpwitem, SECItem *newpwitem,		       SECOidTag new_algorithm){    SECStatus rv;    keyList keylist;    keyNode *node = NULL;    SECKEYLowPrivateKey *privkey = NULL;    char *nickname;    DBT newkey;    int ret;    /* traverse the database, collecting the keys of all records */    keylist.arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);    if ( keylist.arena == NULL )     {	PORT_SetError(SEC_ERROR_NO_MEMORY);	return(SECFailure);    }    keylist.head = NULL;        /* TNH - TraverseKeys should not be public, since it exposes       the underlying DBT data type. */    rv = SECKEY_TraverseKeys(handle, sec_add_key_to_list, (void *)&keylist);    if ( rv != SECSuccess ) 	goto loser;    /* walk the list, re-encrypting each entry */    node = keylist.head;    while ( node != NULL )     {	privkey = seckey_get_private_key(handle, &node->key, &nickname,					 oldpwitem);		if (privkey == NULL) {	    PORT_SetError(SEC_ERROR_BAD_DATABASE);	    rv = SECFailure;	    goto loser;	}	/* delete the old record */	ret = (* handle->db->del)(handle->db, &node->key, 0);	if ( ret ) {	    PORT_SetError(SEC_ERROR_BAD_DATABASE);	    rv = SECFailure;	    goto loser;	}		/* get the public key, which we use as the database index */	switch (privkey->keyType) {	  case rsaKey:	    newkey.data = privkey->u.rsa.modulus.data;	    newkey.size = privkey->u.rsa.modulus.len;	    break;	  case dsaKey:	    newkey.data = privkey->u.dsa.publicValue.data;	    newkey.size = privkey->u.dsa.publicValue.len;	    break;	  case dhKey:	    newkey.data = privkey->u.dh.publicValue.data;	    newkey.size = privkey->u.dh.publicValue.len;	    break;	  default:	    /* XXX We don't do Fortezza. */	    return SECFailure;	}	rv = seckey_put_private_key(handle, &newkey, newpwitem, privkey,				    nickname, PR_TRUE, new_algorithm);		if ( rv != SECSuccess ) 	{	    PORT_SetError(SEC_ERROR_BAD_DATABASE);	    rv = SECFailure;	    goto loser;	}	/* next node */	node = node->next;    }    rv = SECKEY_SetKeyDBPasswordAlg(handle, newpwitem, new_algorithm);loser:    /* free the arena */    if ( keylist.arena ) {	PORT_FreeArena(keylist.arena, PR_FALSE);    }        return(rv);}