<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Feb 5, 2014 at 8:00 PM, Bruno Oliveira <span dir="ltr"><<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">There is no magic, the password must exist in some place. If not possible require the password, is possible to follow the same approach provided for password reset functionality.<br>
<br>
If you want to stick to the KeyStore, you still need to provide the password in some place, but that’s more suitable when you have a key exchange or something like this.<br>
<br>
So if you patiently read my the code proposed, you will realize that is possible to achieve it via property file, database or whatever:<br>
<div class="im"><br>
@Test<br>
public void testPasswordValidationWithRandomSaltProvided() throws Exception {<br>
Pbkdf2 pbkdf2 = AeroGearCrypto.pbkdf2();<br>
byte[] salt = new Random().randomBytes();<br>
byte[] IV = new Random().randomBytes();<br>
int iterations = 100000;<br>
<br>
</div> read.secretFile(“secret.properties”);<br>
String PASSWORD = read.load(“password_to_my_superpassphrase”);<br></blockquote><div><br></div><div><br></div><div>yeah, but that is really per variant, not global. So we would need a lot of these secret file :-) </div>
<div><br></div><div><br></div><div><br></div><div>So, the passphrase is upload to the server (for all iOS variants), w/ this HTTP request:</div><div><br></div><div><a href="http://aerogear.org/docs/specs/aerogear-push-rest/Variants/iOS/">http://aerogear.org/docs/specs/aerogear-push-rest/Variants/iOS/</a><br>
</div><div><br></div><div><br></div><div>Somewhen later a totally different system submits a HTTP request to trigger the PUSH message delivery:</div><div><a href="http://aerogear.org/docs/specs/aerogear-push-rest/Sender/">http://aerogear.org/docs/specs/aerogear-push-rest/Sender/</a><br>
</div><div><br></div><div>And internally, only for iOS variant, all it needs is the certificate (from the apple developer portal) + its passphrase</div><div><br></div><div>Perhaps I am wrong, but I feel that if (for iOS variants) we start to require "password_to_my_superpassphrase" on the request for creating the logical construct of the variant,</div>
<div>and use the same for the Sender, we would have that magical password, but I fear that this opens a new can of worms.</div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im"><br>
//Encrypt step<br>
SecretKey secretKey = pbkdf2.generateSecretKey(PASSWORD, salt, iterations);<br>
CryptoBox box1 = new CryptoBox(secretKey.getEncoded());<br>
String passphrase = "My bonnie lies over the ocean";<br>
byte[] ciphertext = box1.encrypt(IV, passphrase.getBytes());<br>
<br>
//Decrypt step<br>
SecretKey recoveredKey = pbkdf2.generateSecretKey(PASSWORD, salt, iterations);<br>
}<br>
<br>
</div>If it’s not clear, let me know where should I introduce this functionality rather than a pet project and I can do that.<br></blockquote><div><br></div><div><br></div><div>The AGPUSH-358 ticket is still yours :-) I just felt looking at it, while reading up on our crypto bits.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
--<br>
abstractj<br>
<div class=""><div class="h5"><br>
On February 5, 2014 at 4:47:04 PM, Matthias Wessendorf (<a href="mailto:matzew@apache.org">matzew@apache.org</a>) wrote:<br>
> > as said in the comments, I don't have that PASSWORD here<br>
><br>
><br>
> That is only submitted when the user creates a new iOS variant,<br>
> it's never entered when the server tries to connect to the APNs<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Matthias Wessendorf <br><br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div>