As many of us know, Apple has a recent situation where hackers can get a free In-App Purchase for free. Apple recently released this document describing how to fix it, but I'm a little confused in step 4 and I will be grateful for any help.
The first steps are to download their .h and .m patch, include it in your project, and link it to the security infrastructure. Ok, ok, got it. Then Apple says:
4. Provide a base64 encoder, a base64 decoder, and the action to perform when validation succeeds.
What exactly does what I have to do with encoders? (The action that needs to be performed when the check was successful is clear to me.) I see that the functions called base64_encode
and base64_decode
in the class, of course. But what is he asking for? Is it like a special PIN that I only know to prevent hacking? I'm not sure what to do here. Of course, I understand the general concepts of encoding and decoding, but not the software features of how to properly generate in this situation.
The code that Apple writes if this helps anyone:
- (NSString *)encodeBase64:(const uint8_t *)input length:(NSInteger)length { #warning Replace this method. return nil; } - (NSString *)decodeBase64:(NSString *)input length:(NSInteger *)length { #warning Replace this method. return nil; } #warning Implement this function. char* base64_encode(const void* buf, size_t size) { return NULL; } #warning Implement this function. void * base64_decode(const char* s, size_t * data_len) { return NULL; }
I also wonder that there are 2 encoding and 2 decoding functions. I get that there is a pair that returns NSString*
s, but why does the second pair return a char*
and a void*
? Are these features expected to return? I really do not understand.
source share