Start a new topic

using Wikitude with spatialite pods iOS

using Wikitude with spatialite pods iOS


here the code of MD5_final function present in spatialite 4.1.1 (here the pod: https://cocoapods.org/pods/spatialite):

MD5_Final(unsigned char *result, MD5_CTX *ctx)
{
unsigned long used, free;

used = ctx->lo & 0x3f;

ctx->buffer = 0x80;

free = 64 - used;

if (free < 8) {
memset(&ctx->buffer, 0, free);
body(ctx, ctx->buffer, 64);
used = 0;
free = 64;
}

memset(&ctx->buffer, 0, free - 8);

ctx->lo <<= 3;
ctx->buffer = ctx->lo;
ctx->buffer = ctx->lo >> 8;
ctx->buffer = ctx->lo >> 16;
ctx->buffer = ctx->lo >> 24;
ctx->buffer = ctx->hi;
ctx->buffer = ctx->hi >> 8;
ctx->buffer = ctx->hi >> 16;
ctx->buffer = ctx->hi >> 24;

body(ctx, ctx->buffer, 64);

result = ctx->a;
result = ctx->a >> 8;
result = ctx->a >> 16;
result = ctx->a >> 24;
result = ctx->b;
result = ctx->b >> 8;
result = ctx->b >> 16;
result = ctx->b >> 24;
result = ctx->c;
result = ctx->c >> 8;
result = ctx->c >> 16;
result = ctx->c >> 24;
result = ctx->d;
result = ctx->d >> 8;
result = ctx->d >> 16;
result = ctx->d >> 24;

memset(ctx, 0, sizeof(*ctx));
}


 

thanks for your answer! :)

Giampo

Thx for sharing your solution! 
We might update/change our encryption functions in the future, so this might also solve the problem.

Best regards

Andreas

Hi,

may be setLicenseKey method call MD5_Final() function also declared in spatialite md5.c (row n.251 ) file;

I've commented this function and the app is working well!!

so, problem solved for now..

 

 

thanks!

 

Hi Gian,
Do you know if the spatialite library uses any openssl functions? Maybe there is a symbol mixup in the background. If it does include openssl symbols, you could try to remove them from the spatialite library using tools like described in this blog post.

Best regards

Andreas

Hi,

I'm working on an app using spatialite library for geospatial queries;  when launching view controller dedicated to Wikitude AR the app crashes.

Spatialite library is at version 4.1.1, installed using related pod; no spatialite function is called in AR view Controller, but the app crashes apparently when setting license key and shows this error:

"error for object 0xXXXXXXX: incorrect checksum for freed object - object was probably modified after being freed"

The error only occures when spatialite libraries are installed, removing them the app works properly.

 

Anyone has experienced problem like this??

More details are visible in attached file.

 

Thanks
Login or Signup to post a comment