X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/5149e37e66dd3324905ec7e18e67798b03f16ef6..e6432f05795ba0eaf1e34bb47b2a7f87a762de29:/client/scripting.c diff --git a/client/scripting.c b/client/scripting.c index 0ccdeeec..a7cf27d7 100644 --- a/client/scripting.c +++ b/client/scripting.c @@ -261,7 +261,7 @@ static int l_aes(lua_State *L) aes_context ctx; aes_init(&ctx); - aes_setkey_enc(&ctx,(const unsigned char *)p_key,128); + aes_setkey_dec(&ctx, aes_key, 128); aes_crypt_cbc(&ctx,AES_DECRYPT,sizeof(indata), iv, indata,outdata ); //Push decrypted array as a string lua_pushlstring(L,(const char *)&outdata, sizeof(outdata)); @@ -298,6 +298,7 @@ int setLuaPath( lua_State* L, const char* path ) lua_pushstring( L, buf ); // push the new one lua_setfield( L, -2, "path" ); // set the field "path" in table at -2 with value at top of stack lua_pop( L, 1 ); // get rid of package table from top of stack + free(buf); return 0; // all done! }