From a few documents I have read and a few questions about padding here, I think if I passed a encrypted text fewer than BLOCK SIZE, openssl would pad it per PKCS7. And use that padded encrypted text as IV for next data block.
But when I followed the example (changed method to cfb), I noticed that in decrypt, ctx->iv after EVP_DecryptUpdate was the last part of ciphertext padded in the way I could not figure out.
ciphered text (hex): db 11 d7 9c a8 f2 1c 29 07 dc 6d 62 13 7a 5e bf 3a c2 fa 2f a1 0f 73 90 ae bd cf 57 cf 1f 82 a2 24 ac d1 de 29 6a e2 95 9c 0f ec
IV after decrypt (hex): 24 ac d1 de 29 6a e2 95 9c 0f ec 9a 95 f0 e3 14
So where does "9a 95 f0 e3 14" come from?