-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keysource=raw,file:///root/.crypted.aes-256 -> invalid all zeros key 0 #23
Comments
I've been looking into fixing this and found http://opencryptoki.sourceforge.net/ which might be possible to use. At least it have the C_Initialize and the other C_* functions needed (used by SUNW_C_GetMechSession() which I found in pkcs11SUNWExtensions.c in the OpenSolaris11 code). However, looking quickly at the example program (http://www.ibm.com/developerworks/security/library/s-pkcs/sampleprog.html), it's used (at least started/initialized) slightly different. Maybe not a biggie, but if someone have a better idea (before I spend to much time with this), that would be good. |
This tells me that we aren't quite right. The fix to passphrase,file= submitted recently should actually be raw,file. The key is read byte-for-byte and used as is. The passphrase,file= should be changed to read the file, then call hex,file needs to read the file, then call Now the two tricky ones are Most likely additional dependency then would be OpenSSL, as it quite often installed on the system and handled both pkcs11 and https. However, such dependency is quite annoying, as not everyone needs |
I sent a fix for #24, which fixes http. And it seems that curl takes care of https automatically - I had a broken cert chain in my local webserver, and I was refused that keyfile. But it worked through http just fine (even though the key was sent in the clear, it DID work :). So there is no need to do anything special regarding https... hex I haven't tried (I'm unsure how to create a file/value with hex values). |
Yeah but curl isn't currently a dependency. So you probably have it on your platform alright, but it is not optional in autoconf. If you are going to pull in PKCS support, from say, openssl, then curl is no longer needed |
If you look at the commit, I've added all that to, including the dependency in rpm.spec. And OpenSSL needs to be compiled in a special way to get PKCS#11 support. |
Ah nice. I personally do not need pkcs support, but for completeness sake it should be done eventually. :) Carry on! :) |
So are you using passphrase,prompt then? Because with your latest fix, passphrase,file works fine (and with my fix, so does passphrase,http://.... and passphrase,https://....) But for some reason I can't see, raw doesn't work. In any form... |
Yeah, I can clean up raw and passphrase (since passphrase,file should generate passwords) tomorrow, unless you want a crack at it |
I don't have anything else to do, so I'll still do it. But before you fix it (don't have time to fix it now? :), have a look here and see if I managed to do it myself. Because, as I can see, it all looks good.
This looks exactly as it's supposed to be... |
Sorry, never mind! I'm an idiot. tmpkeydata and tmpkeydatalen was unset! Fix is simple: with this, both of these works:
|
I now see that you want/think that 'passphrase,file' should generate a password. In my understanding, it shouldn't! It should use a passphrase from a file. As in, a "passphrase in clear text, located in a file"... And this is exactly how it works now. And if this is not it's intended behaviour, I'd much rather have it as is, than change it... |
Well, from the Solaris manpage, when it says "passphrase: a character string that generates a key" when used with prompt, we get the string from user, then call |
Right, see that now (fixing #21).
But why would it 'prompt for a key', if the key 'is stored at an http location'?? How does it actually work on solaris? Only have an older OpenSolaris (which obviously don't have encryption) so I can't test myself. Does my examples work on Solaris with encryption, or does it ask for a pass even if 'passphrase,file'? That is:
|
into tmpkeydata and tmpkeydatalen so that the tripple check at the bottom of key_hdl_to_zc() works. Fixes zfsrogue#23.
into tmpkeydata and tmpkeydatalen so that the tripple check at the bottom of key_hdl_to_zc() works. Fixes zfsrogue#23.
into tmpkeydata and tmpkeydatalen so that the tripple check at the bottom of key_hdl_to_zc() works. Fixes zfsrogue#23.
I have an old OpenSolaris (snv_101b) where I created a pkcs#11 key (don't know how to do that on Linux, or what other type of raw type I can use):
Copying that over to the Linux test machine:
When creating a filesystem, I get:
And changing key don't work either:
The text was updated successfully, but these errors were encountered: