On a iPhone 4/iOS 4 device, sandbox App Store is reporting this error during verification:
21002: The data in the receipt-data property was malformed.
For your sandbox environment use: https://sandbox.itunes.apple.com/verifyReceipt
For actual verification use: https://buy.itunes.apple.com/verifyReceipt
You can check this at Apple's official page.