Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4355 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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

Image_1.png

Archive.zip

Posted

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).

Posted

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

  • 3 years later...
Posted

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

 

post-71369-0-98963100-1357062387_thumb.p

post-71369-0-19402600-1357062399_thumb.p

Posted

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

Posted

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

 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.