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bmZvX2hlYWRbU0hNX1VOSVRfTlVNX0JJVFNdOyAvKsO/uPZzaG21xGtlebncwO3Qxc+iKi8KK307CisKKy8qKgorICogyKu+1rHkwb+2qNLlCisgKi8KK3BoeXNfYWRkcl90ICAgZ19zaG1fcGh5QWRkciA9IDA7Cit2b2lkICAgICAgICAgKmdfc2htX3JlZ2lvbiA9IE5VTEw7CisKK3N0cnVjdCBzaG1fZW50aXR5ICpzaG1fcmVtb3RlX21hbmFnZXI7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgc2htX3F1YXJ5X2tleUFycmF5CisqILLOyv3LtcP3OgorKiAgICAotKvI67LOyv0pICAgIHZvaWQKKyogICAgKLSrs/ayzsr9KSAgICB2b2lkCisqILe1ILvYINa1OiAgICAgU0hNX0NUUkxfT0sgb3IgU0hNX0NUUkxfRVJST1IKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIHNlYXJjaCBhIHNwZWNpYWwga2V5IGluIGFycmF5CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCBzaG1fcXVhcnlfa2V5QXJyYXkoY29uc3Qga2V5X3Qga2V5KQoreworICAgIHVuc2lnbmVkIGludCAgICAgICAgICBpbmRleCAgICAgPSAwOworICAgIHN0cnVjdCAgIHNobV9rZXlfbm9kZSAqc2htX2RhdGEgPSBOVUxMOworCisgICAgc2htX2RhdGEgPSBzaG1fcmVtb3RlX21hbmFnZXItPmtleXNfaW5mb19oZWFkOworICAgIAorICAgIGZvciAoOyBpbmRleCA8IFNITV9VTklUX05VTV9CSVRTOyBpbmRleCsrKQorICAgIHsKKyAgICAgICAgaWYgKHNobV9kYXRhW2luZGV4XS5rZXkgPT0ga2V5KQorICAgICAgICAgICAgcmV0dXJuIGluZGV4OworICAgIH0KKyAgICByZXR1cm4gU0hNX0NUUkxfRVJST1I7ICAgIAorfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHNobV9jdHJsX3B0ZV9yYW5nZQorKiCyzsr9y7XD9zoKKyogICAgKLSryOuyzsr9KSAgICB2b2lkCisqICAgICi0q7P2ss7K/SkgICAgdm9pZAorKiC3tSC72CDWtTogICAgIFNITV9DVFJMX09LIG9yIFNITV9DVFJMX0VSUk9SCisqIMbky/zLtcP3OiAgICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciBjbGVhciB0aGUgcGFnZXRhYmxlIHB0ZSAKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCit1bnNpZ25lZCBsb25nIHNobV9jdHJsX3B0ZV9yYW5nZShzdHJ1Y3QgbW1fc3RydWN0ICptbSwKKyAgICAgICAgICAgICAgICBzdHJ1Y3Qgdm1fYXJlYV9zdHJ1Y3QgKnZtYSwgcG1kX3QgKnBtZCwKKyAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGFkZHIsIHVuc2lnbmVkIGxvbmcgZW5kKQoreworICAgIHNwaW5sb2NrX3QgKnB0bDsKKyAgICBwdGVfdCAqc3RhcnRfcHRlOworICAgIHB0ZV90ICpwdGU7CisKKyAgICBzdGFydF9wdGUgPSBwdGVfb2Zmc2V0X21hcF9sb2NrKG1tLCBwbWQsIGFkZHIsICZwdGwpOworICAgIHB0ZSA9IHN0YXJ0X3B0ZTsKKyAgICBhcmNoX2VudGVyX2xhenlfbW11X21vZGUoKTsKKyAgICBkbyB7CisgICAgICAgIHB0ZV90IHB0ZW50ID0gKnB0ZTsKKyAgICAgICAgaWYgKHB0ZV9ub25lKHB0ZW50KSkgeworICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIH0KKworICAgICAgICBpZiAocHRlX3ByZXNlbnQocHRlbnQpKSB7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHB0ZW50ID0gcHRlcF9nZXRfYW5kX2NsZWFyKG1tLCBhZGRyLCBwdGUpOworICAgICAgICB9CisgICAgICAgIHB0ZV9jbGVhcl9ub3RfcHJlc2VudF9mdWxsKG1tLCBhZGRyLCBwdGUsIDApOworICAgIH0gd2hpbGUgKHB0ZSsrLCBhZGRyICs9IFBBR0VfU0laRSwgYWRkciAhPSBlbmQpOworCisgICAgYXJjaF9sZWF2ZV9sYXp5X21tdV9tb2RlKCk7CisgICAgcHRlX3VubWFwX3VubG9jayhzdGFydF9wdGUsIHB0bCk7CisKKyAgICByZXR1cm4gYWRkcjsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICBzaG1fY3RybF9wbWRfcmFuZ2UKKyogss7K/cu1w/c6CisqICAgICi0q8jrss7K/SkgICAgbW06IMjOzvG1xMTatObD6Mr2t/sKKyogICAgKLSryOuyzsr9KSAgICB2bWGjur/nusu5ss/txNq05r34s8y12Na3v9W85HZtYQorKiAgICAotKvI67LOyv0pICAgIHB1ZKO6cHVk0rPJz7LjxL/CvAorKiAgICAotKvI67LOyv0pICAgIGFkZHI6INDpxOLG8Mq8tdjWtworKiAgICAotKvI67LOyv0pICAgIGVuZDogINDpxOK94cr4tdjWtworKiAgICAotKuz9rLOyv0pICAgIL/VCisqILe1ILvYINa1OiAgICAgYWRkcgorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgY2xlYXIgdGhlIHBhZ2V0YWJsZSBwdGUgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGlubGluZSB1bnNpZ25lZCBsb25nIHNobV9jdHJsX3BtZF9yYW5nZShzdHJ1Y3QgbW1fc3RydWN0ICptbSwKKyAgICAgICAgICAgICAgICBzdHJ1Y3Qgdm1fYXJlYV9zdHJ1Y3QgKnZtYSwgcHVkX3QgKnB1ZCwKKyAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGFkZHIsIHVuc2lnbmVkIGxvbmcgZW5kKQoreworICAgIHBtZF90ICpwbWQ7CisgICAgdW5zaWduZWQgbG9uZyBuZXh0OworCisgICAgcG1kID0gcG1kX29mZnNldChwdWQsIGFkZHIpOworICAgIGRvIHsKKyAgICAgICAgbmV4dCA9IHBtZF9hZGRyX2VuZChhZGRyLCBlbmQpOworICAgICAgICAvKgorICAgICAgICAgKiBIZXJlIHRoZXJlIGNhbiBiZSBvdGhlciBjb25jdXJyZW50IE1BRFZfRE9OVE5FRUQgb3IKKyAgICAgICAgICogdHJhbnMgaHVnZSBwYWdlIGZhdWx0cyBydW5uaW5nLCBhbmQgaWYgdGhlIHBtZCBpcworICAgICAgICAgKiBub25lIG9yIHRyYW5zIGh1Z2UgaXQgY2FuIGNoYW5nZSB1bmRlciB1cy4gVGhpcyBpcworICAgICAgICAgKiBiZWNhdXNlIE1BRFZfRE9OVE5FRUQgaG9sZHMgdGhlIG1tYXBfc2VtIGluIHJlYWQKKyAgICAgICAgICogbW9kZS4KKyAgICAgICAgICovCisgICAgICAgIGlmIChwbWRfbm9uZV9vcl90cmFuc19odWdlX29yX2NsZWFyX2JhZChwbWQpKQorICAgICAgICAgICAgZ290byBuZXh0OworICAgICAgICBuZXh0ID0gc2htX2N0cmxfcHRlX3JhbmdlKG1tLCB2bWEsIHBtZCwgYWRkciwgbmV4dCk7CituZXh0OgorICAgICAgICBjb25kX3Jlc2NoZWQoKTsKKyAgICB9IHdoaWxlIChwbWQrKywgYWRkciA9IG5leHQsIGFkZHIgIT0gZW5kKTsKKworICAgIHJldHVybiBhZGRyOworfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICBzaG1fY3RybF9wdWRfcmFuZ2UKKyogss7K/cu1w/c6CisqICAgICi0q8jrss7K/SkgICAgbW06ICDIzs7xtcTE2rTmw+jK9rf7CisqICAgICi0q8jrss7K/SkgICAgdm1hOiC/57rLubLP7cTatOa9+LPMtdjWt7/VvOR2bWEKKyogICAgKLSryOuyzsr9KSAgICBwZ2Q6IHBnZNKzxL/CvM/uCisqICAgICi0q8jrss7K/SkgICAgYWRkcjog0OnE4sbwyry12Na3CisqICAgICi0q8jrss7K/SkgICAgZW5kOiAg0OnE4r3hyvi12Na3CisqICAgICi0q7P2ss7K/SkgICAgzt4KKyogt7Ugu9gg1rU6ICAgICBTSE1fQ1RSTF9PSyBvciBTSE1fQ1RSTF9FUlJPUgorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgZmluZCBwdWQKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW5saW5lIHVuc2lnbmVkIGxvbmcgc2htX2N0cmxfcHVkX3JhbmdlKHN0cnVjdCBtbV9zdHJ1Y3QgKm1tLCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCB2bV9hcmVhX3N0cnVjdCAqdm1hLCBwZ2RfdCAqcGdkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zaWduZWQgbG9uZyBhZGRyLCB1bnNpZ25lZCBsb25nIGVuZCkKK3sKKyAgICBwdWRfdCAqcHVkOworICAgIHVuc2lnbmVkIGxvbmcgbmV4dDsKKworICAgIHB1ZCA9IHB1ZF9vZmZzZXQocGdkLCBhZGRyKTsKKyAgICBkbyB7CisgICAgICAgIG5leHQgPSBwdWRfYWRkcl9lbmQoYWRkciwgZW5kKTsKKyAgICAgICAgaWYgKHB1ZF9ub25lX29yX2NsZWFyX2JhZChwdWQpKQorICAgICAgICAgICAgY29udGludWU7CisgICAgICAgIG5leHQgPSBzaG1fY3RybF9wbWRfcmFuZ2UobW0sIHZtYSwgcHVkLCBhZGRyLCBuZXh0KTsKKyAgICB9IHdoaWxlIChwdWQrKywgYWRkciA9IG5leHQsIGFkZHIgIT0gZW5kKTsKKworICAgIHJldHVybiBhZGRyOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHNobV91bm1hcF9wYWdlX3JhbmdlCisqILLOyv3LtcP3OgorKiAgICAotKvI67LOyv0pICAgIG1tOiDIzs7xtcTE2rTmw+jK9rf7CisqICAgICi0q8jrss7K/SkgICAgdm1hIL/nusu5ss/txNq05r34s8y12Na3v9W85HZtYSAKKyogICAgKLSryOuyzsr9KSAgICBhZGRyINDpxOLG8Mq8tdjWtworKiAgICAotKvI67LOyv0pICAgIGVuZCAg0OnE4r3hyvi12Na3CisqICAgICi0q7P2ss7K/SkgICAgv9UKKyogt7Ugu9gg1rU6ICAgICB2b2lkCisqIMbky/zLtcP3OiAgICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciB1bm1hcCB0aGUgc2htIG1lbW9yeQorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK3ZvaWQgc2htX3VubWFwX3BhZ2VfcmFuZ2Uoc3RydWN0IG1tX3N0cnVjdCAqbW0sIHN0cnVjdCB2bV9hcmVhX3N0cnVjdCAqdm1hLAorICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIGFkZHIsIHVuc2lnbmVkIGxvbmcgZW5kKQoreworICAgIHBnZF90ICpwZ2Q7CisgICAgdW5zaWduZWQgbG9uZyBuZXh0OworCisgICAgQlVHX09OKGFkZHIgPj0gZW5kKTsKKyAgICBwZ2QgPSBwZ2Rfb2Zmc2V0KHZtYS0+dm1fbW0sIGFkZHIpOworICAgIGRvIHsKKyAgICAgICAgbmV4dCA9IHBnZF9hZGRyX2VuZChhZGRyLCBlbmQpOworICAgICAgICBpZiAocGdkX25vbmVfb3JfY2xlYXJfYmFkKHBnZCkpCisgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgbmV4dCA9IHNobV9jdHJsX3B1ZF9yYW5nZShtbSwgdm1hLCBwZ2QsIGFkZHIsIG5leHQpOworICAgIH0gd2hpbGUgKHBnZCsrLCBhZGRyID0gbmV4dCwgYWRkciAhPSBlbmQpOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHNobV92bWFfd3JpdGVfcGFnZXRhYmxlCisqILLOyv3LtcP3OiAgICAgCisqICAgICi0q8jrss7K/SkgICAgdm9pZAorKiAgICAotKuz9rLOyv0pICAgIHZvaWQgCisqILe1ILvYINa1OiAgICAgU0hNX0NUUkxfT0sgb3IgU0hNX0NUUkxfRVJST1IKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIGNyZWF0ZSBwYWdldGFibGUgZm9yIHNobSBtZW0gcmVnaW9uICAgICAgICAgICAgICAgICAgICAgICAgICAKKyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitzdGF0aWMgaW50IHNobV92bWFfd3JpdGVfcGFnZXRhYmxlKHN0cnVjdCB2bV9hcmVhX3N0cnVjdCAqdm1hLCB1bnNpZ25lZCBsb25nIHZtX2FkZHIsCisgICAgICAgICAgICBwaHlzX2FkZHJfdCBzaG1hZGRyX3BoeSkKK3sKKyAgICBwdGVfdCAgKnB0ZTsKKyAgICBpbnQgICAgcmV0dmFsICA9IDA7CisgICAgcHRlX3QgIHB0ZV92YWwgPSAwOworICAgIHNwaW5sb2NrX3QgKnB0bDsKKworICAgIGlmICh2bV9hZGRyIDwgdm1hLT52bV9zdGFydCB8fCB2bV9hZGRyID49IHZtYS0+dm1fZW5kKQorICAgICAgICByZXR1cm4gLUVGQVVMVDsKKworICAgIHB0ZSA9IGdldF9sb2NrZWRfcHRlKHZtYS0+dm1fbW0sIHZtX2FkZHIsICZwdGwpOworICAgIGlmICgoIXB0ZSkgfHwgKCFwdGVfbm9uZSgqcHRlKSkpCisgICAgICAgIHJldHVybiAtRUZBVUxUOworCisgICAgcHRlX3ZhbCA9IF9fcHRlKChwaHlzX2FkZHJfdCkoc2htYWRkcl9waHkpIHwgcGdwcm90X3ZhbCh2bWEtPnZtX3BhZ2VfcHJvdCkpOworCisgICAgc2V0X3B0ZV9hdCh2bWEtPnZtX21tLCB2bV9hZGRyLCBwdGUsIHB0ZV92YWwpOworICAgIHB0ZV91bm1hcF91bmxvY2socHRlLCBwdGwpOworCisgICAgcmV0dXJuIHJldHZhbDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICBzaG1fZmlsbF9rZXl0YWJsZQorKiCyzsr9y7XD9zogICAgIAorKiAgICAotKvI67LOyv0pICAgIHZvaWQKKyogICAgKLSrs/ayzsr9KSAgICB2b2lkIAorKiC3tSC72CDWtTogICAgIFNITV9DVFJMX09LIG9yIFNITV9DVFJMX0VSUk9SCisqIMbky/zLtcP3OiAgICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciByZWNvcmQgdGhlIGtleSBhbmQgaW5kZXggcmVsYXRpb24gICAgICAgICAgICAgICAgICAgICAgICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHNobV9maWxsX2tleXRhYmxlKHN0cnVjdCBzaG1fa2V5X25vZGUgICprZXlkYXRhKQoreworICAgIHVuc2lnbmVkIGludCAga2V5X2luZGV4ID0gMDsKKworICAgIGlmIChrZXlkYXRhID09IE5VTEwpCisgICAgICAgIHJldHVybiBTSE1fQ1RSTF9FUlJPUjsKKworICAgIGZvcig7IGtleV9pbmRleCA8IFNITV9VTklUX05VTV9CSVRTOyBrZXlfaW5kZXgrKykKKyAgICB7CisgICAgICAgIGlmKHNobV9yZW1vdGVfbWFuYWdlci0+a2V5c19pbmZvX2hlYWRba2V5X2luZGV4XS5rZXkgPT0gMCkKKyAgICAgICAgeworICAgICAgICAgICAgbWVtY3B5KCZzaG1fcmVtb3RlX21hbmFnZXItPmtleXNfaW5mb19oZWFkW2tleV9pbmRleF0sIGtleWRhdGEsIHNpemVvZihzdHJ1Y3Qgc2htX2tleV9ub2RlKSk7CisgICAgICAgICAgICByZXR1cm4gU0hNX0NUUkxfT0s7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIFNITV9DVFJMX0VSUk9SOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHNobV9yZW1vdmVfa2V5bm9kZQorKiCyzsr9y7XD9zogICAgIAorKiAgICAotKvI67LOyv0pICAgIHZvaWQKKyogICAgKLSrs/ayzsr9KSAgICB2b2lkIAorKiC3tSC72CDWtTogICAgIFNITV9DVFJMX09LIG9yIFNITV9DVFJMX0VSUk9SCisqIMbky/zLtcP3OiAgICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciByZW1vdmUgdGhlIGtleSBhbmQgaW5kZXggcmVsYXRpb24gICAgICAgICAgICAgICAgICAgICAgICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIHZvaWQgc2htX3JlbW92ZV9rZXlub2RlKHVuc2lnbmVkIGludCBrZXlfaW5kZXgpCit7CisgICAgbWVtc2V0KCZzaG1fcmVtb3RlX21hbmFnZXItPmtleXNfaW5mb19oZWFkW2tleV9pbmRleF0sIDAsIHNpemVvZihzdHJ1Y3Qgc2htX2tleV9ub2RlKSk7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgc2htX2FsbG9jX25ld19wYWdlCisqILLOyv3LtcP3OiAgICAgCisqICAgICi0q8jrss7K/SkgICAgdm9pZAorKiAgICAotKuz9rLOyv0pICAgIHZvaWQgCisqILe1ILvYINa1OiAgICAgU0hNX0NUUkxfT0sgb3IgU0hNX0NUUkxfRVJST1IKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yICBhbGxvYyBwYWdlIGZyb20gc2htIG1lbSByZWdpb24gICAgICAgICAgICAgICAgICAgICAgICAgIAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludCBzaG1fYWxsb2NfbmV3X3BhZ2Uoc3RydWN0IHZtX2FyZWFfc3RydWN0ICp2bWEsICBrZXlfdCBrZXkpCit7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgdm1fYWRkciAgICAgID0gMDsKKyAgICB1bnNpZ25lZCBpbnQgICAgICAgICByZWdpb25faW5kZXggPSAwOworICAgIHZvaWQgICAgICAgICAgICAgICAgICpuZXdfcGFnZSAgICA9IE5VTEw7CisgICAgc3RydWN0IHNobV9rZXlfbm9kZSAgbmV3X2tleSAgICAgID0gezB9OworCisgICAgaWYoKHZtYSA9PSBOVUxMKSB8fCAoZ19zaG1fcmVnaW9uID09IE5VTEwpKQorICAgIHsKKyAgICAgICAgcHJpbnRrKCJTaG0gcmVnaW9uIGlzIG5vdCByZWFkeVxuIik7CisgICAgICAgIHJldHVybiBTSE1fQ1RSTF9FUlJPUjsKKyAgICB9CisKKyAgICB2bV9hZGRyID0gdm1hLT52bV9zdGFydDsKKyAgICAKKyAgICBmb3IgKDsgdm1fYWRkciA8IHZtYS0+dm1fZW5kOyB2bV9hZGRyICs9IFBBR0VfU0laRSkKKyAgICB7CisgICAgICAgIHJlZ2lvbl9pbmRleCA9IGZpbmRfZmlyc3RfemVyb19iaXQoc2htX3JlbW90ZV9tYW5hZ2VyLT5zaG1fcmVnaW9uc19iaXRtYXAsIFNITV9VTklUX05VTV9CSVRTKTsKKworICAgICAgICBpZiAocmVnaW9uX2luZGV4IDwgU0hNX1VOSVRfTlVNX0JJVFMpIAorICAgICAgICB7CisgICAgICAgICAgICBzZXRfYml0KHJlZ2lvbl9pbmRleCwgc2htX3JlbW90ZV9tYW5hZ2VyLT5zaG1fcmVnaW9uc19iaXRtYXApOyAgICAKKyAgICAgICAgICAgIG5ld19wYWdlID0gU0hNX1VOSVRfUEFHRV9BRERSKHJlZ2lvbl9pbmRleCk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChzaG1fdm1hX3dyaXRlX3BhZ2V0YWJsZSh2bWEsIHZtX2FkZHIsIG5ld19wYWdlKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gU0hNX0NUUkxfRVJST1I7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzZXRfYml0KHJlZ2lvbl9pbmRleCwgbmV3X2tleS5zaG1faW51c2VfaW5kZXgpOworICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIFNITV9DVFJMX0VSUk9SOworICAgICAgICB9CisgICAgfQorCisgICAgaWYgKCFiaXRtYXBfZW1wdHkobmV3X2tleS5zaG1faW51c2VfaW5kZXgsIFNITV9VTklUX05VTV9CSVRTKSkKKyAgICB7CisgICAgICAgIG5ld19rZXkua2V5ID0ga2V5OyAgICAKKyAgICAgICAgbmV3X2tleS52bWFfY291bnQrKzsKKyAgICAgICAgc2htX2ZpbGxfa2V5dGFibGUoJm5ld19rZXkpOworICAgIH0KKyAgICByZXR1cm4gU0hNX0NUUkxfT0s7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCisqILmmxNzD6Mr2OiAgICAgc2htX2RvX3JlbW90ZV9tYXBfdm1hCisqILLOyv3LtcP3OiAgICAgCisqICAgICi0q8jrss7K/SkgICAgdm9pZAorKiAgICAotKuz9rLOyv0pICAgIHZvaWQKKyogt7Ugu9gg1rU6ICAgICBTSE1fQ1RSTF9PSyBvciBTSE1fQ1RSTF9FUlJPUgorKiDG5Mv8y7XD9zogICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgCisqICAgICAgICAgICAgICAgICAgIAorLyqy6dGva2V5LMjnufvS0bfWxeS5/cq508NrZXm21NOmtcRiaXRtYXAsILfx1PK009fcxNq05rPYt9bF5CAgICAgICAgICAgCisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworaW50IHNobV9kb19yZW1vdGVfbWFwX3ZtYShzdHJ1Y3Qgdm1fYXJlYV9zdHJ1Y3QgKnZtYSwgIGtleV90IGtleSkKK3sKKyAgICBpbnQgICAgICAgICAgICAgICAgICAgcmV0ICAgICAgICAgICA9IDA7CisgICAgdW5zaWduZWQgbG9uZyAgICAgICAgIHZtX2FkZHIgICAgICAgPSAwOworICAgIHVuc2lnbmVkIGludCAgICAgICAgICByZWdpb25faW5kZXggID0gMDsKKyAgICBpbnQgICAgICAgICAgICAgICAgICAga2V5X2luZGV4ICAgICA9IDA7CisgICAgdm9pZCAgICAgICAgICAgICAgICAgICpuZXdfcGFnZV9waHkgPSBOVUxMOworICAgIHN0cnVjdCAgIHNobV9rZXlfbm9kZSAqa2V5X25vZGUgICAgID0gTlVMTDsKKyAgICBERUNMQVJFX0JJVE1BUChzaG1faW51c2VfdG1wLCBTSE1fVU5JVF9OVU1fQklUUyk7CisKKyAgICBpZigodm1hID09IE5VTEwpIHx8IChnX3NobV9yZWdpb24gPT0gTlVMTCkpCisgICAgeworICAgICAgICBwcmludGsoInNobV9kb19yZW1vdGVfbWFwX3ZtYTpTaG0gcmVnaW9uIGlzIG5vdCByZWFkeVxuIik7CisgICAgICAgIHJldHVybiBTSE1fQ1RSTF9FUlJPUjsKKyAgICB9CisKKyAgICAvKtOzyeR2bWHOqrfHY2FjaGXK9NDUKi8KKyAgICBwZ3Byb3Rfbm9uY2FjaGVkKHZtYS0+dm1fcGFnZV9wcm90KTsKKworICAgIHNvZnRfc3Bpbl9sb2NrKFNITV9TRkxPQ0spOworCisgICAga2V5X2luZGV4ID0gc2htX3F1YXJ5X2tleUFycmF5KGtleSk7CisgICAgCisgICAgaWYgKGtleV9pbmRleCA8IDApIAorICAgIHsKKyAgICAgICAgcmV0ID0gc2htX2FsbG9jX25ld19wYWdlKHZtYSwga2V5KTsKKyAgICAgICAgc29mdF9zcGluX3VubG9jayhTSE1fU0ZMT0NLKTsgICAgCisgICAgICAgIGlmIChyZXQgPCAwKQorICAgICAgICAgICAgcGFuaWMoInNobV9hbGxvY19uZXdfcGFnZSBGYWlsXG4iKTsKKyAgICAgICAgcmV0dXJuIHJldDsKKyAgICB9CisKKyAgICB2bV9hZGRyID0gdm1hLT52bV9zdGFydDsKKyAgICAKKyAgICBpZiAoKDAgPD0ga2V5X2luZGV4KSAmJiAoa2V5X2luZGV4IDwgU0hNX1VOSVRfTlVNX0JJVFMpKQorICAgICAgICBrZXlfbm9kZSA9ICZzaG1fcmVtb3RlX21hbmFnZXItPmtleXNfaW5mb19oZWFkW2tleV9pbmRleF07CisgICAgZWxzZQorICAgICAgICBwYW5pYygia2V5X2luZGV4IG91dCBvZiByYW5nZTogZmFpbGVkXG4iKTsKKworICAgIG1lbWNweShzaG1faW51c2VfdG1wLCBrZXlfbm9kZS0+c2htX2ludXNlX2luZGV4LCBzaXplb2Yoc2htX2ludXNlX3RtcCkpOworCisgICAgZm9yICg7IHZtX2FkZHIgPCB2bWEtPnZtX2VuZDsgdm1fYWRkciArPSBQQUdFX1NJWkUpCisgICAgeyAgICAKKyAgICAgICAgcmVnaW9uX2luZGV4ID0gZmluZF9maXJzdF9iaXQoc2htX2ludXNlX3RtcCwgU0hNX1VOSVRfTlVNX0JJVFMpOworICAgICAgICBpZiAocmVnaW9uX2luZGV4IDwgU0hNX1VOSVRfTlVNX0JJVFMpIAorICAgICAgICB7CisgICAgICAgICAgICBuZXdfcGFnZV9waHkgPSBTSE1fVU5JVF9QQUdFX0FERFIocmVnaW9uX2luZGV4KTsKKyAgICAgICAgICAgIGlmIChzaG1fdm1hX3dyaXRlX3BhZ2V0YWJsZSh2bWEsIHZtX2FkZHIsIG5ld19wYWdlX3BoeSkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc29mdF9zcGluX3VubG9jayhTSE1fU0ZMT0NLKTsKKyAgICAgICAgICAgICAgICBwYW5pYygic2htX2RvX3JlbW90ZV9tYXBfdm1hIHZtX2luc2VydF9wYWdlIGZhaWxlZFxuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIFNITV9DVFJMX0VSUk9SOworICAgICAgICAgICAgfQorICAgICAgICAgICAgY2xlYXJfYml0KHJlZ2lvbl9pbmRleCwgc2htX2ludXNlX3RtcCk7ICAgIAorICAgICAgICB9CisgICAgICAgIGVsc2UKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIFNITV9DVFJMX0VSUk9SOworICAgICAgICB9CisgICAgfQorICAgIGtleV9ub2RlLT52bWFfY291bnQrKzsKKworICAgIHNvZnRfc3Bpbl91bmxvY2soU0hNX1NGTE9DSyk7CisgICAgcmV0dXJuIFNITV9DVFJMX09LOworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorKiC5psTcw+jK9jogICAgIHNobV9yZW1vdGVfZnJlZV9wYWdlcworKiCyzsr9y7XD9zogICAgIAorKiAgICAotKvI67LOyv0pICAgIHZvaWQKKyogICAgKLSrs/ayzsr9KSAgICB2b2lkCisqILe1ILvYINa1OiAgICAgU0hNX0NUUkxfT0sgb3IgU0hNX0NUUkxfRVJST1IKKyogxuTL/Mu1w/c6ICAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIAorKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2ludCBzaG1fcmVtb3RlX2ZyZWVfcGFnZXMoa2V5X3Qga2V5KQoreworICAgIGludCAgICAgICAgICAgICAgICAgIGtleV9pbmRleCA9IDA7CisgICAgdW5zaWduZWQgaW50ICAgICAgICAgcmVnaW9uX2luZGV4ID0gMDsKKyAgICBzdHJ1Y3QgIHNobV9rZXlfbm9kZSAqa2V5X25vZGUgPSBOVUxMOworICAgIAorICAgIGlmKGdfc2htX3JlZ2lvbiA9PSBOVUxMKQorICAgIHsKKyAgICAgICAgcHJpbnRrKCJzaG1fcmVtb3RlX2ZyZWVfcGFnZXM6IFNobSByZWdpb24gaXMgbm90IHJlYWR5XG4iKTsKKyAgICAgICAgcmV0dXJuIFNITV9DVFJMX0VSUk9SOworICAgIH0KKworICAgIHNvZnRfc3Bpbl9sb2NrKFNITV9TRkxPQ0spOworCisgICAgLyqy6dGva2V5Ki8KKyAgICBrZXlfaW5kZXggPSBzaG1fcXVhcnlfa2V5QXJyYXkoa2V5KTsKKyAgICBpZihrZXlfaW5kZXggPCAwIHx8IGtleV9pbmRleCA+PSBTSE1fVU5JVF9OVU1fQklUUykgCisgICAgeworICAgICAgICBzb2Z0X3NwaW5fdW5sb2NrKFNITV9TRkxPQ0spOworICAgICAgICBwYW5pYygiZXJyb3JcbiIpOworICAgIH0KKworICAgIC8qyvTT2r/nusu1xL7Nys23xbW9s9jX08DvKi8KKyAgICBrZXlfbm9kZSA9ICZzaG1fcmVtb3RlX21hbmFnZXItPmtleXNfaW5mb19oZWFkW2tleV9pbmRleF07CisKKyAgICBrZXlfbm9kZS0+dm1hX2NvdW50LS07CisKKyAgICBpZihrZXlfbm9kZS0+dm1hX2NvdW50ID09IDApCisgICAgeworICAgICAgICBmb3JfZWFjaF9zZXRfYml0KHJlZ2lvbl9pbmRleCwga2V5X25vZGUtPnNobV9pbnVzZV9pbmRleCwgU0hNX1VOSVRfTlVNX0JJVFMpCisgICAgICAgIHsKKyAgICAgICAgICAgIGNsZWFyX2JpdChyZWdpb25faW5kZXgsIHNobV9yZW1vdGVfbWFuYWdlci0+c2htX3JlZ2lvbnNfYml0bWFwKTsgICAgICAgIAorICAgICAgICB9CisgICAgICAgIHNobV9yZW1vdmVfa2V5bm9kZShrZXlfaW5kZXgpOworICAgIH0KKyAgICBzb2Z0X3NwaW5fdW5sb2NrKFNITV9TRkxPQ0spOworICAgIHJldHVybiBTSE1fQ1RSTF9PSzsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyoguabE3MPoyvY6ICAgICBzaG1fcnBjb3JlX2luaXQKKyogss7K/cu1w/c6CisqICAgKLSryOuyzsr9KSAgdm9pZAorKiAgICi0q7P2ss7K/SkgIHZvaWQKKyogt7Ugu9gg1rU6CisqIMbky/zLtcP3OiAgICAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciBzaG0gY3RybCBpbml0CisqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3RhdGljIGludCBfX2luaXQgc2htX3JwY29yZV9pbml0KHZvaWQpCit7ICAgIAorICAgIGRtYV9hZGRyX3QgICAgICAgICAgIGRtYV9waHlzOworICAgIGRtYV9hZGRyX3QgICAgICAgICAgIHNobV9rZXlJbmZvX3BoeXM7CisgICAgc3RydWN0IHNobV9wb29sX21zZyAgc2htX21zZyA9IHswfTsKKyAgICAgCisgICAgZ19zaG1fcmVnaW9uID0gZG1hX2FsbG9jX2NvaGVyZW50KE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzaXplX3QpU0hNX1JFTU9URV9CVUZGX0xFTiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRtYV9waHlzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHRlBfS0VSTkVMKTsKKyAgICBpZighZ19zaG1fcmVnaW9uKQorICAgIHsKKyAgICAgICAgcGFuaWMoImdfc2htX3JlZ2lvbiBOT01FTVxuIik7CisgICAgfQorCisgICAgZ19zaG1fcGh5QWRkciA9IGRtYV9waHlzOworCisgICAgc2htX3JlbW90ZV9tYW5hZ2VyID0gZG1hX2FsbG9jX2NvaGVyZW50KE5VTEwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzaXplX3QpKFNITV9LRVlTX1NUQVRVU19MRU4pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2htX2tleUluZm9fcGh5cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0ZQX0tFUk5FTCk7CisgICAgaWYoIXNobV9yZW1vdGVfbWFuYWdlcikgICAgCisgICAgeworICAgICAgICBwYW5pYygic2htX3JlbW90ZV9tYW5hZ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