[systemd-devel] [PATCH 1/3] Add more password agent information

Benjamin SANS bs at ziirish.info
Tue Mar 25 01:50:10 PDT 2014


Hi David

* On Tuesday, 25 March 2014 01:46, David Härdeman <david at hardeman.nu> wrote:
> 
> I think Benjamin and I have basically both come up with the same
> solution (though I haven't changed the option from "keyscript=" to
> "keyhandler=" since that would break backwards compatibility...which is
> partly the point of the whole exercise)...

I agree here, the keyscript option would be much better.
> 
> Bejamin's approach does not seem to solve the binary key part of the
> puzzle either...(passing binary keys from the keyscript, as opposed to
> passphrases).

Actually it does, but I'm not very proud of the fix...
Here is an explanation:

- When using a keyscript, the agent creates a temporary file like so:

char temp[] = "/run/systemd/ask-password/tmp.XXXXXX";
int fd = mkostemp(temp, O_WRONLY|O_CLOEXEC);

- It then forks, redirect the standard output of the child to this temporary
  file, and execv the keyscript.

- Finally, it returns via the socket the path of this temporary file.

But all of this is based on the assumption that /run is a tmpfs and that it is
safe enough to temporary store the key.

> My proposed approach is provided in more detail in the corresponding
> Debian bug report, see:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=618862#44
> 
> So yes, I think they're related...as in they are independent
> implementations of the same thing :)
> 
> >
> >http://lists.freedesktop.org/archives/systemd-devel/2014-March/017869.html
> >
> >Benjamin, can you comment?
> >

A more detailed comment is available here:
http://lists.freedesktop.org/archives/systemd-devel/2014-March/017955.html

-- 
Benjamin SANS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140325/1f45f6b7/attachment.sig>


More information about the systemd-devel mailing list