X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfcrypt.c;fp=tfcrypt.c;h=7da9e99e550623fdce783b84d4ee420161d2383c;hb=ef3f3a7b878b0be4da7a22a6954f378aa86561e3;hp=e6d422dbe25277dbf231633021e4f318fac14ee4;hpb=ba5ce99d77078a8629779641e8506b74e50fe6af;p=tfcrypt.git diff --git a/tfcrypt.c b/tfcrypt.c index e6d422d..7da9e99 100644 --- a/tfcrypt.c +++ b/tfcrypt.c @@ -456,6 +456,33 @@ _baddfname: } else oseek = tfc_modifysize(oseek, strchr(s, ':')); } + else if (!strncmp(s, "ioseek", 6) && *(s+6) == '=') { + s += 7; + + iseek = tfc_humanfsize(s, &stoi); + if (!str_empty(stoi)) { + iseek = tfc_fnamesize(s, YES); + iseek = tfc_modifysize(iseek, strchr(s, ':')); + if (iseek == NOFSIZE) xerror(NO, YES, YES, + "%s: invalid iseek value", s); + } + else iseek = tfc_modifysize(iseek, strchr(s, ':')); + if (ctr_mode != TFC_MODE_PLAIN && iseek % TF_BLOCK_SIZE) + xerror(NO, YES, YES, + "%s: not round to TF block size " + "of %u bytes", + s, TFC_U(TF_BLOCK_SIZE)); + iseek_blocks = iseek / TF_BLOCK_SIZE; + + oseek = tfc_humanfsize(s, &stoi); + if (!str_empty(stoi)) { + oseek = tfc_fnamesize(s, YES); + oseek = tfc_modifysize(oseek, strchr(s, ':')); + if (oseek == NOFSIZE) xerror(NO, YES, YES, + "%s: invalid oseek value", s); + } + else oseek = tfc_modifysize(oseek, strchr(s, ':')); + } else if (!strncmp(s, "count", 5) && *(s+5) == '=') { s += 6; maxlen = tfc_humanfsize(s, &stoi);