Skip to content

Commit

Permalink
Defect fix:public key should allow newline charactesrs
Browse files Browse the repository at this point in the history
  • Loading branch information
sudheerhebbale committed Jun 22, 2023
1 parent 0efc9a1 commit 215aed3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions evluaserver/evlcrypto/src/evl_crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,10 +783,9 @@ static int encrypt_text(lua_State *L)
//DEBUGPOINT("Here block_size = [%zu]\n", block_size);

size_t bufferlen = strlen(text);
size_t old_bufferlen = bufferlen;
while (bufferlen % block_size) bufferlen++;

/* Additional block for padding if required */
bufferlen += (old_bufferlen == bufferlen) ? block_size : 0;
bufferlen += (bufferlen % block_size) ? (block_size - (bufferlen % block_size)) : block_size;

//DEBUGPOINT("Here bufferlen = [%zu]\n", bufferlen);
//DEBUGPOINT("Here ivlen = [%zu]\n", ivlen);
Expand Down

0 comments on commit 215aed3

Please sign in to comment.