Coat chicken legs with turmeric and salt in a dish and refrigerate overnight.
Bring the marinated chicken to room temperature 30 minutes before cooking.
Blend all spice paste ingredients in a food processor until smooth.
Heat 45ml oil in a frying pan and brown the chicken for 5 minutes.
Drain the fried chicken on kitchen paper.
Stir-fry onions and spice paste in a wok with remaining oil for 3 minutes.
Add the chicken to the wok and cook for 6 minutes.
Add coconut milk, lime leaves, and sugar and simmer for 30 minutes.
Stir in the lime juice.
Heat oil in a heavy saucepan for deep frying.
Fry shallots until crisp and drain them on kitchen paper.
Garnish the curry with shallots, mint, chilli, and cucumber and serve with rice.