[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4762: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4764: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4765: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4766: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3897)
newlispfanclub.alh.net • View topic - generating aws signature

generating aws signature

Q&A's, tips, howto's

generating aws signature

Postby joejoe » Sun Oct 23, 2016 4:38 am

Hi,

I am following this php code and am trying to reproduce it with nL.

http://webtutsdepot.com/2009/10/13/amaz ... quest-php/

I cannot figure out if this is a two part transaction or just a single query.

Would anyone know if I need an initial aws server response from the get-url command in order to complete the rest of building the url that will make the request with the aws signature?

Like do I need to say 'knock knock', and use part of their 'whos there' response in order to generate my signature?

Thanks for help!

joejoe
joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: generating aws signature

Postby ralph.ronnquist » Sun Oct 23, 2016 5:07 am

I'm no expert on AWS API, but from reading the PHP, it looks like it's a single handshake, but it relies on a prior agreement between you and Amazon about the thingies called "$publicKey" and "$privateKey". Basically it seems to be a matter of scrambling the original request with the private key, then issue the compound request of that scramble together with the public key, for getting the request to be serviced.
ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: generating aws signature

Postby joejoe » Sun Oct 23, 2016 5:12 am

Ok great, that is what I had hoped, thank you very much Ralph!
joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: generating aws signature

Postby joejoe » Sun Oct 23, 2016 5:16 am

And would I be correct to use this module that Lutz has already created?

http://www.newlisp.org/code/modules/cry ... rypto_hmac

or just use the

http://www.newlisp.org/code/modules/cry ... pto_sha256

Thanks again!
joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: generating aws signature

Postby ralph.ronnquist » Sun Oct 23, 2016 5:22 am

Last edited by ralph.ronnquist on Sun Oct 23, 2016 5:32 am, edited 1 time in total.
ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: generating aws signature

Postby joejoe » Sun Oct 23, 2016 5:28 am

Got it, thanks Ralph! Much appreciated!! :D
joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: generating aws signature

Postby joejoe » Sat Nov 05, 2016 11:03 am

joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: generating aws signature

Postby ralph.ronnquist » Sun Nov 06, 2016 2:33 am

ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: generating aws signature

Postby joejoe » Sun Dec 11, 2016 10:57 am

joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: generating aws signature

Postby ralph.ronnquist » Mon Dec 12, 2016 9:27 am

Maybe you meant to have (string ...) embeddings for the third argument to crypto:hmac calls?
ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: generating aws signature

Postby joejoe » Thu Dec 15, 2016 2:26 am

joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: generating aws signature

Postby joejoe » Wed Dec 21, 2016 3:32 pm

joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: generating aws signature

Postby ralph.ronnquist » Wed Dec 21, 2016 9:10 pm

An online tool, using a form, would typically digest line ends as \r\j, whereas a *nix system would prefer using \j only, and a mac system would rather favour \r for line endings. The AWS tool you pointed at some posts earlier appears to compute the signature using \j line endings. And it also scrambles the hmac output by both base64 encoding then url-encoding.
ralph.ronnquist
 
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: generating aws signature

Postby joejoe » Wed Dec 21, 2016 9:47 pm

joejoe
 
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest