In the bowl of a food processor fitted with the metal blade, process the onion and tomato separately into fairly smooth purees.
Heat a large skillet over medium-high heat. Add the oil.
When the oil shimmers, fry the onion puree for about five minutes.
Add the tomato puree and fry for another five minutes, or until most of the moisture has cooked out.
Add the salt, garlic, ginger, and the rest of the spices and continue to fry until the oil begins to separate from the vegetables.
To use in a recipe, for each cup of paste, add about ½ cup of stock and/or coconut milk and bring to a boil. Toast your favorite curry powder in a dry skillet until fragrant and stir that into the sauce. Reduce the heat, add meat and/or vegetables, and simmer until everything is cooked through.
Garam Masala, or mixed spice, is available at Indian grocery stores. You can also make your own spice blend using any one of a number of recipes on the Internet.