<div dir="ltr"><div><div><div><div>Ok, I don't insist - I just need the functionality. What should I do to get my patch accepted? :) <br><br></div><div>1. Store key as bin<br></div><div>2. Separate files<br></div><div>
<div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 30, 2013 at 10:00 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<div><br>
On Mon, Sep 30, 2013 at 08:15:34PM +0400, kyprizel wrote:<br>
<br>
> $ openssl rand -base64 48 | awk '{print "-----BEGIN SESSION TICKET<br>
> KEY-----"; print; print "-----END SESSION TICKET KEY-----"}' >><br>
</div><div>> ticket.key.new && cat ticket.key | awk 'sa==1{n++;sa=1}/-----BEGIN SESSION<br>
> TICKET KEY-----/{sa=1;X=2}{if(n<3*X){print;}}' >> ticket.key.new && mv<br>
> ticket.key.new ticket.key<br>
><br>
> store not more than X=2 old keys + new one, you can add it to cron file.<br>
><br>
> I know it's weird to use awk, but I only try to illustrate that it's not a<br>
> big problem to rotate keys with my schema ;)<br>
<br>
</div>While it's not a big problem, it's certainly not something<br>
trivial.<br>
<div><br>
> But you can' rotate keys with<br>
> oneliner if you use "one key per file schema" - there'll be too big<br>
> probability of mistake during nginx config parsing.<br>
<br>
</div>Huh? Even trivial<br>
<br>
$ mv key.new key.old && openssl rand 48 > key.new<br>
<br>
would be fine as in a worst case a new configuration will just<br>
fail to load. And<br>
<br>
$ cp key.new key.old.tmp && mv key.old.tmp key.old \<br>
&& openssl rand 48 > key.new.tmp && mv key.new.tmp key.new<br>
<br>
is atomic.<br>
<div><div><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/en/donation.html" target="_blank">http://nginx.org/en/donation.html</a><br>
<br>
_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org" target="_blank">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br>
</div></div></blockquote></div><br></div></div></div></div></div></div>