Noél Dubau Posted November 4, 2009 Posted November 4, 2009 Hello, I have a Filemaker runtime solution using 360ScriptMaster to make AWS requests through it . Beside that plugin I use also InsideScan (an image acquisition pi) and Doscript. It works fine on many recent iMac, on many G4 and Macbook (Pro or not) but an user said me this evening that he couldn't get infos from Amazon on Mac having G3 processors. I've just installed Tiger on an old iMac G3 500Mhz and encountered the same problem. The minimal configuration for Filemaker 9 is Mac OS X 10.4.8 PowerPC G3, G4, G5 ou Intel 256 Mo de RAM. Do you know a limitation of the 360Scriptmaster plugin ? Thanks for your help ! Noël
Jesse Barnum Posted November 4, 2009 Posted November 4, 2009 Hello Noël - I have not tested ScriptMaster on a G3 processor, and I don't have one to test on, so I really don't know whether it will work or not.
Noél Dubau Posted November 5, 2009 Author Posted November 5, 2009 Hello Jesse Thanks for your answer ! I can't send you my old iMac from France but I can join the script used in 360SM, the returned text and a scree copy of the message error... Hope it will be useful to someone for help ! Noël Archive.zip
Jesse Barnum Posted November 5, 2009 Posted November 5, 2009 I don't think that this is related to running on a G3 processor. This is failing because the String.replace() function expects two char arguments, not String arguments. Try String.replaceAll() instead. This takes two String arguments, but they are treated like regex expressions. I'm not much of a regex pro, but my advice would be to just try it, and if certain things don't work, stick two backslashes ('') before any characters that regex treats specially (like the * asterisk character).
Noél Dubau Posted November 5, 2009 Author Posted November 5, 2009 Thanks for your interest. I must leave now and I'll try to understand your idea later. But the same script with the same datas runs fine on my iMac 24, my G4, my MB Pro... and not on a G3. I join that script in which the only thing we change is the ISBN 13 of the book, just after Keywords= in the query. Regards, Noël ECS_Only_ScriptmasterND.fp7.zip
Noél Dubau Posted January 1, 2013 Author Posted January 1, 2013 Coming back 3 years ago on that question because I don't understand why the script runs fine under some systems and not on old ones ! First this is the script  // get some values from filemaker fields // aws_key, secret_key, query1, isbn_ean, query2 import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.text.DateFormat; import java.text.SimpleDateFormat; import javax.crypto.Mac; // Get current timestamp        String timestamp = null;        Calendar cal = Calendar.getInstance();        DateFormat dfm = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");        dfm.setTimeZone(TimeZone.getTimeZone("GMT"));        timestamp = dfm.format(cal.getTime()); // Encode timestamp        try {            timestamp2 = URLEncoder.encode(timestamp, "UTF-8")                .replace("+", "%20")                .replace("*", "%2A")                .replace("%7E", "~");        } catch (UnsupportedEncodingException e) {            timestamp2 = timestamp;        } def good_req="http://webservices.amazon.fr/onca/xml?AWSAccessKeyId=" + aws_key + "&" + query1 + isbn_ean+ query2 +"&Timestamp="+timestamp+"&Version=2009-01-06" // define canonical string (string which we must sign)   def s = "GETnwebservices.amazon.frn/onca/xmlnAWSAccessKeyId=" + aws_key + "&" + query1 + isbn_ean+ query2 + "&Timestamp="+timestamp2+"&Version=2009-01-06"            stringToSign =  s.replace("+", "%20");            stringToSign =   s.replace("*", "%2A");            stringToSign =   s.replace("%7E", "~"); // Sign the string   def signingKey = new javax.crypto.spec.SecretKeySpec(secret_key.getBytes(),'HmacSHA256');   def mymac = Mac.getInstance('HmacSHA256');   mymac.init(signingKey); // Base64 encode the signature   def rawSig = mymac.doFinal(stringToSign.getBytes());   def sig = new sun.misc.BASE64Encoder().encode(rawSig);   sig = java.net.URLEncoder.encode(sig); // Form URL to execute query   url = "http://webservices.amazon.fr/onca/xml?AWSAccessKeyId=" + aws_key + "&" + query1 + isbn_ean+ query2 + "&Timestamp=" + timestamp2 + "&Version=2009-01-06" + "&Signature=" + sig; // Submit URL to execute query raw_html = new URL(url).getText(); // Return query results to Filemaker return raw_html;  When I run on my imac or MBP having java version "1.6.0_37" no problem. The iBook with G3 has java version "1.5.0_19" ; when I run the script I get an error (Image1) and details are (Image2) Is there a possiblility that the encryption isn't possible for a java before 1.6 ? Can someone help me ? And happy new year for all ! Noël Â
john renfrew Posted January 1, 2013 Posted January 1, 2013 Noel Can you give details of OS as well as processor, as that is where the Java is from It is almost certainly related to that. I am not in for a couple of days so can't test but I did write this when faced with something similar last year to check the security provisions If you do not see Hmacsha256 on the list then that would be why you get the errors // SecurityList // 11_06_21 JR // v1.0 // returns lists of installed security provisions // see http://docs.oracle.com/javase/6/docs/technotes/guides/security/crypto/CryptoSpec.html import java.security.Provider import java.security.Security providers = Security.getProviders() ciphers = [] keyAgreements = [] macs = [] messageDigests = [] signatures = [] for (i in 0..<providers.length) { iter = providers.keySet().iterator() while (iter.hasNext()) { entry = iter.next() if (entry.startsWith('Alg.Alias.')) { entry = entry.substring('Alg.Alias.'.length()) } if (entry.startsWith('Cipher.')) { ciphers.add(entry.substring('Cipher.'.length())) } else if (entry.startsWith('KeyAgreement.')) { keyAgreements.add(entry.substring('KeyAgreement.'.length())) } else if (entry.startsWith('Mac.')) { macs.add(entry.substring('Mac.'.length())) } else if (entry.startsWith('MessageDigest.')) { messageDigests.add(entry.substring('MessageDigest.'.length())) } else if (entry.startsWith('Signature.')) { signatures.add(entry.substring('Signature.'.length())) } } } return 'Macs:n' + macs.join('n') return 'ciphers:n' + ciphers.join('n') + 'nnkeyAgreements:n' + keyAgreements.join('n') + 'nnMacs:n' + macs.join('n') + 'nnmessageDigests:n' + messageDigests.join('n') + 'nnsignatures:n' + signatures.join('n') John
Noél Dubau Posted January 2, 2013 Author Posted January 2, 2013 John, Thanks for your quick answer. The iBook on which I can test now is based on G3 processor and has OS 10,4,11. I had tried on various eMac or iMac all with G3 and Tiger as OS. I ran your script ; it returns nothing but Macs: Waiting for your verdict ! Noël
Recommended Posts
This topic is 4355 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now