diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 6915d52..64aadad 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -27,7 +27,7 @@ jobs: # Runs a single command using the runners shell - name: Run Synopsys Detect - run: bash <(curl -s -L https://detect.synopsys.com/detect.sh) --detect.parallel.processors=-1 $* -h + run: bash <(curl -s -L https://detect.synopsys.com/detect.sh) --detect.parallel.processors=-1 --blackduck.url=https://ec2-18-217-189-8.us-east-2.compute.amazonaws.com --blackduck.trust.cert=true --blackduck.api.token=NjJhYjMzMTEtMGQwZS00ODk4LWE2OTgtN2U5NGQ4MzgwZDkzOjM3MzU2MzU3LTkzZTctNDNjYS04NWQyLTNmODhiNmU1YjVjNw== --detect.detector.search.depth=10 --detect.policy.check.fail.on.severities=ALL # Runs a set of commands using the runners shell # - name: Run a multi-line script diff --git a/README.md b/README.md index 22d3199..c6147f6 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,6 @@ This is my repository for learning about Github actions and all the wonderful things you can do with them. -## feature2 -======= -these changes are being added for feature1 +line2 + +line3 \ No newline at end of file diff --git a/sample-app/.DS_Store b/sample-app/.DS_Store new file mode 100644 index 0000000..c2b1bdf Binary files /dev/null and b/sample-app/.DS_Store differ diff --git a/sample-app/my-app/detect.log b/sample-app/my-app/detect.log new file mode 100644 index 0000000..22f3f81 --- /dev/null +++ b/sample-app/my-app/detect.log @@ -0,0 +1 @@ +Error: Unable to access jarfile synopsys-detect-5.6.2.jar diff --git a/sample-app/my-app/pom.xml b/sample-app/my-app/pom.xml new file mode 100644 index 0000000..b3f5993 --- /dev/null +++ b/sample-app/my-app/pom.xml @@ -0,0 +1,99 @@ + + + + 4.0.0 + + com.mycompany.app + my-app + 1.0 + + my-app + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + org.apache.struts + struts2-core + 2.5.26 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + net.sourceforge.jwebunit + jwebunit-core + 1.4.1 + test + + + + + org.apache.logging.log4j + log4j-core + 2.11.1 + + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + maven-surefire-plugin + 2.22.1 + + + maven-jar-plugin + 3.0.2 + + + maven-install-plugin + 2.5.2 + + + maven-deploy-plugin + 2.8.2 + + + + maven-site-plugin + 3.7.1 + + + maven-project-info-reports-plugin + 3.0.0 + + + + + diff --git a/sample-app/my-app/pom_dependency_to_add.xml b/sample-app/my-app/pom_dependency_to_add.xml new file mode 100644 index 0000000..37151e7 --- /dev/null +++ b/sample-app/my-app/pom_dependency_to_add.xml @@ -0,0 +1,6 @@ + + + org.apache.velocity + velocity + 1.7 + diff --git a/sample-app/my-app/src/main/java/com/mycompany/app/App.java b/sample-app/my-app/src/main/java/com/mycompany/app/App.java new file mode 100644 index 0000000..77cf3e0 --- /dev/null +++ b/sample-app/my-app/src/main/java/com/mycompany/app/App.java @@ -0,0 +1,13 @@ +package com.mycompany.app; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} diff --git a/sample-app/my-app/src/test/java/com/mycompany/app/AppTest.java b/sample-app/my-app/src/test/java/com/mycompany/app/AppTest.java new file mode 100644 index 0000000..81ac345 --- /dev/null +++ b/sample-app/my-app/src/test/java/com/mycompany/app/AppTest.java @@ -0,0 +1,20 @@ +package com.mycompany.app; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest +{ + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() + { + assertTrue( true ); + } +} diff --git a/sample-app/my-app/target/classes/com/mycompany/app/App.class b/sample-app/my-app/target/classes/com/mycompany/app/App.class new file mode 100644 index 0000000..5cc43ee Binary files /dev/null and b/sample-app/my-app/target/classes/com/mycompany/app/App.class differ diff --git a/sample-app/my-app/target/maven-archiver/pom.properties b/sample-app/my-app/target/maven-archiver/pom.properties new file mode 100644 index 0000000..87edd0e --- /dev/null +++ b/sample-app/my-app/target/maven-archiver/pom.properties @@ -0,0 +1,4 @@ +#Created by Apache Maven 3.6.3 +groupId=com.mycompany.app +artifactId=my-app +version=1.0 diff --git a/sample-app/my-app/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/sample-app/my-app/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..de9dba0 --- /dev/null +++ b/sample-app/my-app/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +com/mycompany/app/App.class diff --git a/sample-app/my-app/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/sample-app/my-app/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..8cd11a7 --- /dev/null +++ b/sample-app/my-app/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +/Users/gsnyder/Projects/workflow-demo/sample-app/my-app/src/main/java/com/mycompany/app/App.java diff --git a/sample-app/my-app/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/sample-app/my-app/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..6348184 --- /dev/null +++ b/sample-app/my-app/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1 @@ +com/mycompany/app/AppTest.class diff --git a/sample-app/my-app/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/sample-app/my-app/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..d9da38a --- /dev/null +++ b/sample-app/my-app/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1 @@ +/Users/gsnyder/Projects/workflow-demo/sample-app/my-app/src/test/java/com/mycompany/app/AppTest.java diff --git a/sample-app/my-app/target/my-app-1.0.jar b/sample-app/my-app/target/my-app-1.0.jar new file mode 100644 index 0000000..d129d34 Binary files /dev/null and b/sample-app/my-app/target/my-app-1.0.jar differ diff --git a/sample-app/my-app/target/surefire-reports/TEST-com.mycompany.app.AppTest.xml b/sample-app/my-app/target/surefire-reports/TEST-com.mycompany.app.AppTest.xml new file mode 100644 index 0000000..3158f36 --- /dev/null +++ b/sample-app/my-app/target/surefire-reports/TEST-com.mycompany.app.AppTest.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sample-app/my-app/target/surefire-reports/com.mycompany.app.AppTest.txt b/sample-app/my-app/target/surefire-reports/com.mycompany.app.AppTest.txt new file mode 100644 index 0000000..4ba9904 --- /dev/null +++ b/sample-app/my-app/target/surefire-reports/com.mycompany.app.AppTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: com.mycompany.app.AppTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 s - in com.mycompany.app.AppTest diff --git a/sample-app/my-app/target/test-classes/com/mycompany/app/AppTest.class b/sample-app/my-app/target/test-classes/com/mycompany/app/AppTest.class new file mode 100644 index 0000000..197784c Binary files /dev/null and b/sample-app/my-app/target/test-classes/com/mycompany/app/AppTest.class differ diff --git a/sample-app/protex_tutorial/.DS_Store b/sample-app/protex_tutorial/.DS_Store new file mode 100644 index 0000000..c10bd1f Binary files /dev/null and b/sample-app/protex_tutorial/.DS_Store differ diff --git a/sample-app/protex_tutorial/MercurialToolbar/MercurialToolbar.vsix b/sample-app/protex_tutorial/MercurialToolbar/MercurialToolbar.vsix new file mode 100644 index 0000000..e00d644 Binary files /dev/null and b/sample-app/protex_tutorial/MercurialToolbar/MercurialToolbar.vsix differ diff --git a/sample-app/protex_tutorial/OpenSSL/ca-key.pem b/sample-app/protex_tutorial/OpenSSL/ca-key.pem new file mode 100644 index 0000000..3a520b2 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/ca-key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425 +gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd +2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB +AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6 +hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2 +J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs +HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL +21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s +nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz +MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa +pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb +KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2 +XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ +-----END RSA PRIVATE KEY----- diff --git a/sample-app/protex_tutorial/OpenSSL/ca-req.pem b/sample-app/protex_tutorial/OpenSSL/ca-req.pem new file mode 100644 index 0000000..77bf7ec --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/ca-req.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBmTCCAQICAQAwWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx +GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgx +MDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgy +bTsZDCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/d +FXSv1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUe +cQU2mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAKlk7 +cxu9gCJN3/iQFyJXQ6YphaiQAT5VBXTx9ftRrQIjA3vxlDzPWGDy+V5Tqa7h8PtR +5Bn00JShII2zf0hjyjKils6x/UkWmjEiwSiFp4hR70iE8XwSNEHY2P6j6nQEIpgW +kbfgmmUqk7dl2V+ossTJ80B8SBpEhrn81V/cHxA= +-----END CERTIFICATE REQUEST----- diff --git a/sample-app/protex_tutorial/OpenSSL/cert.pem b/sample-app/protex_tutorial/OpenSSL/cert.pem new file mode 100644 index 0000000..de4a77a --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/cert.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE----- +MIIBoDCCAUoCAQAwDQYJKoZIhvcNAQEEBQAwYzELMAkGA1UEBhMCQVUxEzARBgNV +BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMSMwIQYD +VQQDExpTZXJ2ZXIgdGVzdCBjZXJ0ICg1MTIgYml0KTAeFw05NzA5MDkwMzQxMjZa +Fw05NzEwMDkwMzQxMjZaMF4xCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0 +YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxFzAVBgNVBAMT +DkVyaWMgdGhlIFlvdW5nMFEwCQYFKw4DAgwFAANEAAJBALVEqPODnpI4rShlY8S7 +tB713JNvabvn6Gned7zylwLLiXQAo/PAT6mfdWPTyCX9RlId/Aroh1ou893BA32Q +sggwDQYJKoZIhvcNAQEEBQADQQCU5SSgapJSdRXJoX+CpCvFy+JVh9HpSjCpSNKO +19raHv98hKAUJuP9HyM+SUsffO6mAIgitUaqW8/wDMePhEC3 +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/052eae11.0 b/sample-app/protex_tutorial/OpenSSL/certs/052eae11.0 new file mode 100644 index 0000000..67bee1b --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/052eae11.0 @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD +VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 +cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O +IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB +VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1 +NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH +EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT +I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta +RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ +KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR +Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG +9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4 +WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/18d46017.0 b/sample-app/protex_tutorial/OpenSSL/certs/18d46017.0 new file mode 100644 index 0000000..05acf76 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/18d46017.0 @@ -0,0 +1,18 @@ +subject=/O=VeriSign, Inc/OU=www.verisign.com/repository/TestCPS Incorp. By Ref. Liab. LTD./OU=For VeriSign authorized testing only. No assurances (C)VS1997 +notBefore=Mar 4 00:00:00 1997 GMT +notAfter=Mar 4 23:59:59 2025 GMT +-----BEGIN CERTIFICATE----- +MIICTTCCAfcCEEdoCqpuXxnoK27q7d58Qc4wDQYJKoZIhvcNAQEEBQAwgakxFjAU +BgNVBAoTDVZlcmlTaWduLCBJbmMxRzBFBgNVBAsTPnd3dy52ZXJpc2lnbi5jb20v +cmVwb3NpdG9yeS9UZXN0Q1BTIEluY29ycC4gQnkgUmVmLiBMaWFiLiBMVEQuMUYw +RAYDVQQLEz1Gb3IgVmVyaVNpZ24gYXV0aG9yaXplZCB0ZXN0aW5nIG9ubHkuIE5v +IGFzc3VyYW5jZXMgKEMpVlMxOTk3MB4XDTk3MDMwNDAwMDAwMFoXDTI1MDMwNDIz +NTk1OVowgakxFjAUBgNVBAoTDVZlcmlTaWduLCBJbmMxRzBFBgNVBAsTPnd3dy52 +ZXJpc2lnbi5jb20vcmVwb3NpdG9yeS9UZXN0Q1BTIEluY29ycC4gQnkgUmVmLiBM +aWFiLiBMVEQuMUYwRAYDVQQLEz1Gb3IgVmVyaVNpZ24gYXV0aG9yaXplZCB0ZXN0 +aW5nIG9ubHkuIE5vIGFzc3VyYW5jZXMgKEMpVlMxOTk3MFwwDQYJKoZIhvcNAQEB +BQADSwAwSAJBAMak6xImJx44jMKcbkACy5/CyMA2fqXK4PlzTtCxRq5tFkDzne7s +cI8oFK/J+gFZNE3bjidDxf07O3JOYG9RGx8CAwEAATANBgkqhkiG9w0BAQQFAANB +ADT523tENOKrEheZFpsJx1UUjPrG7TwYc/C4NBHrZI4gZJcKVFIfNulftVS6UMYW +ToLEMaUojc3DuNXHG21PDG8= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/1ef89214.0 b/sample-app/protex_tutorial/OpenSSL/certs/1ef89214.0 new file mode 100644 index 0000000..207f34a --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/1ef89214.0 @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN +BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w +HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0 +IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL +MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls +aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww +GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL +ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc +zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0 +YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq +hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF +cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W +YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w== +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/certs/24867d38.0 b/sample-app/protex_tutorial/OpenSSL/certs/24867d38.0 new file mode 100644 index 0000000..e3641ad --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/24867d38.0 @@ -0,0 +1,49 @@ +-----BEGIN DSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,F80EEEBEEA7386C4 + +GZ9zgFcHOlnhPoiSbVi/yXc9mGoj44A6IveD4UlpSEUt6Xbse3Fr0KHIUyQ3oGnS +mClKoAp/eOTb5Frhto85SzdsxYtac+X1v5XwdzAMy2KowHVk1N8A5jmE2OlkNPNt +of132MNlo2cyIRYaa35PPYBGNCmUm7YcYS8O90YtkrQZZTf4+2C4kllhMcdkQwkr +FWSWC8YOQ7w0LHb4cX1FejHHom9Nd/0PN3vn3UyySvfOqoR7nbXkrpHXmPIr0hxX +RcF0aXcV/CzZ1/nfXWQf4o3+oD0T22SDoVcZY60IzI0oIc3pNCbDV3uKNmgekrFd +qOUJ+QW8oWp7oefRx62iBfIeC8DZunohMXaWAQCU0sLQOR4yEdeUCnzCSywe0bG1 +diD0KYaEe+Yub1BQH4aLsBgDjardgpJRTQLq0DUvw0/QGO1irKTJzegEDNVBKrVn +V4AHOKT1CUKqvGNRP1UnccUDTF6miOAtaj/qpzra7sSk7dkGBvIEeFoAg84kfh9h +hVvF1YyzC9bwZepruoqoUwke/WdNIR5ymOVZ/4Liw0JdIOcq+atbdRX08niqIRkf +dsZrUj4leo3zdefYUQ7w4N2Ns37yDFq7 +-----END DSA PRIVATE KEY----- +-----BEGIN CERTIFICATE REQUEST----- +MIICVTCCAhMCAQAwUzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx +ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEMMAoGA1UEAxMDUENB +MIIBtTCCASkGBSsOAwIMMIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2G +lrMV4FMuj+BZgnOQPnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7O +Zq5riDb77Cjcwtelu+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR +5HCVW1DNSQIVAPcHMe36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnl +aG8w42nh5bNdmLsohkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6 +kQmdtvFNnFQPWAbuSXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15Als +QReVkusBtXOlan7YMu0OArgDgYUAAoGBAKbtuR5AdW+ICjCFe2ixjUiJJzM2IKwe +6NZEMXg39+HQ1UTPTmfLZLps+rZfolHDXuRKMXbGFdSF0nXYzotPCzi7GauwEJTZ +yr27ZZjA1C6apGSQ9GzuwNvZ4rCXystVEagAS8OQ4H3D4dWS17Zg31ICb5o4E5r0 +z09o/Uz46u0VoAAwCQYFKw4DAhsFAAMxADAuAhUArRubTxsbIXy3AhtjQ943AbNB +nSICFQCu+g1iW3jwF+gOcbroD4S/ZcvB3w== +-----END CERTIFICATE REQUEST----- +-----BEGIN CERTIFICATE----- +MIIC0zCCApECAQAwCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK +U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww +CgYDVQQDEwNQQ0EwHhcNOTcwNjE0MjI1NDQ1WhcNOTcwNzE0MjI1NDQ1WjBTMQsw +CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu +ZXQgV2lkZ2l0cyBQdHkgTHRkMQwwCgYDVQQDEwNQQ0EwggG1MIIBKQYFKw4DAgww +ggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaWsxXgUy6P4FmCc5A+dTGZ +R3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5mrmuINvvsKNzC16W75Sw5 +JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHkcJVbUM1JAhUA9wcx7fps +BgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVobzDjaeHls12YuyiGSPze +mQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqRCZ228U2cVA9YBu5JdAfO +VX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxBF5WS6wG1c6Vqftgy7Q4C +uAOBhQACgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk +umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A +29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUwCQYFKw4D +AhsFAAMxADAuAhUAvtv6AkMolix1Jvy3UnVEIUqdCUICFQC+jq8P49mwrY9oJ24n +5rKUjNBhSg== +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/certs/2edf7016.0 b/sample-app/protex_tutorial/OpenSSL/certs/2edf7016.0 new file mode 100644 index 0000000..277894d --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/2edf7016.0 @@ -0,0 +1,17 @@ +subject=/C=US/O=VeriSign, Inc./OU=Class 1 Public Primary Certification Authority +notBefore=Jan 29 00:00:00 1996 GMT +notAfter=Jan 7 23:59:59 2020 GMT +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEDJQM89Q0VbzXIGtZVxPyCUwDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTIwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f +zGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi +TkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G +CSqGSIb3DQEBAgUAA4GBAEtEZmBoZOSYG/OwcuaViXzde7OVwB0u2NgZ0C00PcZQ +mhCGjKo/O6gE/DdSlcPZydvN8oYGxLEb8IKIMEKOF1AcZHq4PplJdJf8rAJD+5YM +VgQlDHx8h50kp9jwMim1pN9dokzFFjKoQvZFprY2ueC/ZTaTwtLXa9zeWdaiNfhF +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/3ecf89a3.0 b/sample-app/protex_tutorial/OpenSSL/certs/3ecf89a3.0 new file mode 100644 index 0000000..28065fd --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/3ecf89a3.0 @@ -0,0 +1,63 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt + Validity + Not Before: Apr 2 17:35:59 1997 GMT + Not After : Apr 2 17:35:59 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt, CN=USER + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:a8:a8:53:63:49:1b:93:c3:c3:0b:6c:88:11:55: + de:7e:6a:e2:f9:52:a0:dc:69:25:c4:c8:bf:55:e1: + 31:a8:ce:e4:a9:29:85:99:8a:15:9a:de:f6:2f:e1: + b4:50:5f:5e:04:75:a6:f4:76:dc:3c:0e:39:dc:3a: + be:3e:a4:61:8b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Authority Key Identifier: + 0...~r..:..B.44fu......3 + X509v3 Subject Key Identifier: + ...... .*...1.*....... + X509v3 Key Usage: critical + .... + X509v3 Certificate Policies: critical + 0.0...*...0....... + X509v3 Subject Alternative Name: + 0:..user@darmstadt.gmd.de.!http://www.darmstadt.gmd.de/~user + X509v3 Issuer Alternative Name: + 0....gmdca@gmd.de..http://www.gmd.de..saturn.darmstadt.gmd.de.\1!0...U. +..European ICE-TEL project1#0!..U....V3-Certification Authority1.0...U....Darmstadt..141.12.62.26 + X509v3 Basic Constraints: critical + 0. + X509v3 CRL Distribution Points: + 0.0.......gmdca@gmd.de + Signature Algorithm: md5WithRSAEncryption + 69:0c:e1:b7:a7:f2:d8:fb:e8:69:c0:13:cd:37:ad:21:06:22: + 4d:e8:c6:db:f1:04:0b:b7:e0:b3:d6:0c:81:03:ce:c3:6a:3e: + c7:e7:24:24:a4:92:64:c2:83:83:06:42:53:0e:6f:09:1e:84: + 9a:f7:6f:63:9b:94:99:83:d6:a4 +-----BEGIN CERTIFICATE----- +MIIDTzCCAvmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBcMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MRIwEAYDVQQHEwlEYXJtc3RhZHQwHhcNOTcwNDAyMTczNTU5WhcN +OTgwNDAyMTczNTU5WjBrMSEwHwYDVQQKExhFdXJvcGVhbiBJQ0UtVEVMIHByb2pl +Y3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24gQXV0aG9yaXR5MRIwEAYDVQQH +EwlEYXJtc3RhZHQxDTALBgNVBAMTBFVTRVIwWTAKBgRVCAEBAgICAANLADBIAkEA +qKhTY0kbk8PDC2yIEVXefmri+VKg3GklxMi/VeExqM7kqSmFmYoVmt72L+G0UF9e +BHWm9HbcPA453Dq+PqRhiwIDAQABo4IBmDCCAZQwHwYDVR0jBBgwFoAUfnLy+DqG +nEKINDRmdcPU/NGiETMwHQYDVR0OBBYEFJfc4B8gjSoRmLUx4Sq/ucIYiMrPMA4G +A1UdDwEB/wQEAwIB8DAcBgNVHSABAf8EEjAQMAYGBCoDBAUwBgYECQgHBjBDBgNV +HREEPDA6gRV1c2VyQGRhcm1zdGFkdC5nbWQuZGWGIWh0dHA6Ly93d3cuZGFybXN0 +YWR0LmdtZC5kZS9+dXNlcjCBsQYDVR0SBIGpMIGmgQxnbWRjYUBnbWQuZGWGEWh0 +dHA6Ly93d3cuZ21kLmRlghdzYXR1cm4uZGFybXN0YWR0LmdtZC5kZaRcMSEwHwYD +VQQKExhFdXJvcGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MRIwEAYDVQQHEwlEYXJtc3RhZHSHDDE0MS4xMi42 +Mi4yNjAMBgNVHRMBAf8EAjAAMB0GA1UdHwQWMBQwEqAQoA6BDGdtZGNhQGdtZC5k +ZTANBgkqhkiG9w0BAQQFAANBAGkM4ben8tj76GnAE803rSEGIk3oxtvxBAu34LPW +DIEDzsNqPsfnJCSkkmTCg4MGQlMObwkehJr3b2OblJmD1qQ= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/6bee6be3.0 b/sample-app/protex_tutorial/OpenSSL/certs/6bee6be3.0 new file mode 100644 index 0000000..7565236 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/6bee6be3.0 @@ -0,0 +1,59 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority + Validity + Not Before: Apr 2 17:35:53 1997 GMT + Not After : Apr 2 17:35:53 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:82:75:ba:f6:d1:60:b5:f9:15:b3:6a:dd:29:8f: + 8b:a4:6f:1a:88:e0:50:43:40:0b:79:41:d5:d3:16: + 44:7d:74:65:17:42:06:52:0b:e9:50:c8:10:cd:24: + e2:ae:8d:22:30:73:e6:b4:b7:93:1f:e5:6e:a2:ae: + 49:11:a5:c9:45 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Authority Key Identifier: + 0.........z.."p......e.. + X509v3 Subject Key Identifier: + ..~r..:..B.44fu......3 + X509v3 Key Usage: critical + .... + X509v3 Certificate Policies: critical + 0.0...*... + X509v3 Subject Alternative Name: + 0!..secude-support@darmstadt.gmd.de + X509v3 Issuer Alternative Name: + 0I..ice-tel-ca@darmstadt.gmd.de.*http://www.darmstadt.gmd.de/ice-tel/euroca + X509v3 Basic Constraints: critical + 0.... + X509v3 CRL Distribution Points: + 0200...,.*http://www.darmstadt.gmd.de/ice-tel/euroca + Signature Algorithm: md5WithRSAEncryption + 17:a2:88:b7:99:5a:05:41:e4:13:34:67:e6:1f:3e:26:ec:4b: + 69:f9:3e:28:22:be:9d:1c:ab:41:6f:0c:00:85:fe:45:74:f6: + 98:f0:ce:9b:65:53:4a:50:42:c7:d4:92:bd:d7:a2:a8:3d:98: + 88:73:cd:60:28:79:a3:fc:48:7a +-----BEGIN CERTIFICATE----- +MIICzDCCAnagAwIBAgIBATANBgkqhkiG9w0BAQQFADBIMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MB4XDTk3MDQwMjE3MzU1M1oXDTk4MDQwMjE3MzU1M1owXDEhMB8G +A1UEChMYRXVyb3BlYW4gSUNFLVRFTCBwcm9qZWN0MSMwIQYDVQQLExpWMy1DZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTESMBAGA1UEBxMJRGFybXN0YWR0MFkwCgYEVQgB +AQICAgADSwAwSAJBAIJ1uvbRYLX5FbNq3SmPi6RvGojgUENAC3lB1dMWRH10ZRdC +BlIL6VDIEM0k4q6NIjBz5rS3kx/lbqKuSRGlyUUCAwEAAaOCATgwggE0MB8GA1Ud +IwQYMBaAFIr3yNUOx3ro1yJw4AuJ1bbsZbzPMB0GA1UdDgQWBBR+cvL4OoacQog0 +NGZ1w9T80aIRMzAOBgNVHQ8BAf8EBAMCAfYwFAYDVR0gAQH/BAowCDAGBgQqAwQF +MCoGA1UdEQQjMCGBH3NlY3VkZS1zdXBwb3J0QGRhcm1zdGFkdC5nbWQuZGUwUgYD +VR0SBEswSYEbaWNlLXRlbC1jYUBkYXJtc3RhZHQuZ21kLmRlhipodHRwOi8vd3d3 +LmRhcm1zdGFkdC5nbWQuZGUvaWNlLXRlbC9ldXJvY2EwDwYDVR0TAQH/BAUwAwEB +/zA7BgNVHR8ENDAyMDCgLqAshipodHRwOi8vd3d3LmRhcm1zdGFkdC5nbWQuZGUv +aWNlLXRlbC9ldXJvY2EwDQYJKoZIhvcNAQEEBQADQQAXooi3mVoFQeQTNGfmHz4m +7Etp+T4oIr6dHKtBbwwAhf5FdPaY8M6bZVNKUELH1JK916KoPZiIc81gKHmj/Eh6 +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/73912336.0 b/sample-app/protex_tutorial/OpenSSL/certs/73912336.0 new file mode 100644 index 0000000..9eb08f3 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/73912336.0 @@ -0,0 +1,43 @@ +-----BEGIN DSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,C5B6C7CC9E1FE2C0 + +svCXBcBRhMuU22UXOfiKZA+thmz6KYXpt1Yg5Rd+TYQcQ1MdvNy0B0tkP1SxzDq0 +Xh1eMeTML9/9/0rKakgNXXXbpi5RB8t6BmwRSyej89F7nn1mtR3qzoyPRpp15SDl +Tn67C+2v+HDF3MFk88hiNCYkNbcmi7TWvChsl8N1r7wdZwtIox56yXdgxw6ZIpa/ +par0oUCzN7fiavPgCWz1kfPNSaBQSdxwH7TZi5tMHAr0J3C7a7QRnZfE09R59Uqr +zslrq+ndIw1BZAxoY0SlBu+iFOVaBVlwToC4AsHkv7j7l8ITtr7f42YbBa44D9TO +uOhONmkk/v3Fso4RaOEzdKZC+hnmmzvHs6TiTWm6yzJgSFwyOUK0eGmKEeVxpcH5 +rUOlHOwzen+FFtocZDZAfdFnb7QY7L/boQvyA5A+ZbRG4DUpmBQeQsSaICHM5Rxx +1QaLF413VNPXTLPbW0ilSc2H8x2iZTIVKfd33oSO6NhXPtSYQgfecEF4BvNHY5c4 +HovjT4mckbK95bcBzoCHu43vuSQkmZzdYo/ydSZt6zoPavbBLueTpgSbdXiDi827 +MVqOsYxGCb+kez0FoDSTgw== +-----END DSA PRIVATE KEY----- +-----BEGIN CERTIFICATE REQUEST----- +MIICUjCCAhECAQAwUjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx +ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDELMAkGA1UEAxMCQ0Ew +ggG0MIIBKQYFKw4DAgwwggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaW +sxXgUy6P4FmCc5A+dTGZR3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5m +rmuINvvsKNzC16W75Sw5JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHk +cJVbUM1JAhUA9wcx7fpsBgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVo +bzDjaeHls12YuyiGSPzemQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqR +CZ228U2cVA9YBu5JdAfOVX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxB +F5WS6wG1c6Vqftgy7Q4CuAOBhAACgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuH +vSLw9YUrJahcBHmbpvt494lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUq +AylOVFJJJXuirVJ+o+0TtOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u +3enxhqnDGaAAMAkGBSsOAwIbBQADMAAwLQIVAJGVuFsG/0DBuSZ0jF7ypdU0/G0v +AhQfeF5BoMMDbX/kidUVpQ6gadPlZA== +-----END CERTIFICATE REQUEST----- +-----BEGIN CERTIFICATE----- +MIIBrjCCAWwCAQswCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK +U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww +CgYDVQQDEwNQQ0EwHhcNOTcwNjE1MDIxNDI5WhcNOTcwNzE1MDIxNDI5WjBSMQsw +CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu +ZXQgV2lkZ2l0cyBQdHkgTHRkMQswCQYDVQQDEwJDQTCBkjAJBgUrDgMCDAUAA4GE +AAKBgBqmWXqKrP1etkWWTYYJVwH4qKHFacfsi4e9IvD1hSslqFwEeZum+3j3iUXi +ALnDdY8z69cmh9u6yTgahAQSxA0wNpqHibj25SoDKU5UUkkle6KtUn6j7RO04UMh +MQCX5hllquJc4Pu105I6X1Esw8Lr51ocpL17ry7d6fGGqcMZMAkGBSsOAwIbBQAD +MQAwLgIVAJ4wtQsANPxHo7Q4IQZYsL12SKdbAhUAjJ9n38zxT+iai2164xS+LIfa +C1Q= +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/certs/7651b327.0 b/sample-app/protex_tutorial/OpenSSL/certs/7651b327.0 new file mode 100644 index 0000000..aa5bb4c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/7651b327.0 @@ -0,0 +1,18 @@ +subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority +notBefore=Jan 29 00:00:00 1996 GMT +notAfter=Jan 7 23:59:59 2004 GMT +-----BEGIN CERTIFICATE----- +MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh +c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05 +NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD +VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp +bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo +RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4 +rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN +BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp +STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH +ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ +pA== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/8c401b31.0 b/sample-app/protex_tutorial/OpenSSL/certs/8c401b31.0 new file mode 100644 index 0000000..9c8d5bf --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/8c401b31.0 @@ -0,0 +1,16 @@ +Tims test GCI CA + +-----BEGIN CERTIFICATE----- +MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD +VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 +cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD +cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow +gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC +cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl +dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN +AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw +OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF +AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA +TfdbFZtAAD2Hx9jUtY3tfdrJOb8= +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/certs/ICE-CA.pem b/sample-app/protex_tutorial/OpenSSL/certs/ICE-CA.pem new file mode 100644 index 0000000..7565236 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/ICE-CA.pem @@ -0,0 +1,59 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority + Validity + Not Before: Apr 2 17:35:53 1997 GMT + Not After : Apr 2 17:35:53 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:82:75:ba:f6:d1:60:b5:f9:15:b3:6a:dd:29:8f: + 8b:a4:6f:1a:88:e0:50:43:40:0b:79:41:d5:d3:16: + 44:7d:74:65:17:42:06:52:0b:e9:50:c8:10:cd:24: + e2:ae:8d:22:30:73:e6:b4:b7:93:1f:e5:6e:a2:ae: + 49:11:a5:c9:45 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Authority Key Identifier: + 0.........z.."p......e.. + X509v3 Subject Key Identifier: + ..~r..:..B.44fu......3 + X509v3 Key Usage: critical + .... + X509v3 Certificate Policies: critical + 0.0...*... + X509v3 Subject Alternative Name: + 0!..secude-support@darmstadt.gmd.de + X509v3 Issuer Alternative Name: + 0I..ice-tel-ca@darmstadt.gmd.de.*http://www.darmstadt.gmd.de/ice-tel/euroca + X509v3 Basic Constraints: critical + 0.... + X509v3 CRL Distribution Points: + 0200...,.*http://www.darmstadt.gmd.de/ice-tel/euroca + Signature Algorithm: md5WithRSAEncryption + 17:a2:88:b7:99:5a:05:41:e4:13:34:67:e6:1f:3e:26:ec:4b: + 69:f9:3e:28:22:be:9d:1c:ab:41:6f:0c:00:85:fe:45:74:f6: + 98:f0:ce:9b:65:53:4a:50:42:c7:d4:92:bd:d7:a2:a8:3d:98: + 88:73:cd:60:28:79:a3:fc:48:7a +-----BEGIN CERTIFICATE----- +MIICzDCCAnagAwIBAgIBATANBgkqhkiG9w0BAQQFADBIMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MB4XDTk3MDQwMjE3MzU1M1oXDTk4MDQwMjE3MzU1M1owXDEhMB8G +A1UEChMYRXVyb3BlYW4gSUNFLVRFTCBwcm9qZWN0MSMwIQYDVQQLExpWMy1DZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTESMBAGA1UEBxMJRGFybXN0YWR0MFkwCgYEVQgB +AQICAgADSwAwSAJBAIJ1uvbRYLX5FbNq3SmPi6RvGojgUENAC3lB1dMWRH10ZRdC +BlIL6VDIEM0k4q6NIjBz5rS3kx/lbqKuSRGlyUUCAwEAAaOCATgwggE0MB8GA1Ud +IwQYMBaAFIr3yNUOx3ro1yJw4AuJ1bbsZbzPMB0GA1UdDgQWBBR+cvL4OoacQog0 +NGZ1w9T80aIRMzAOBgNVHQ8BAf8EBAMCAfYwFAYDVR0gAQH/BAowCDAGBgQqAwQF +MCoGA1UdEQQjMCGBH3NlY3VkZS1zdXBwb3J0QGRhcm1zdGFkdC5nbWQuZGUwUgYD +VR0SBEswSYEbaWNlLXRlbC1jYUBkYXJtc3RhZHQuZ21kLmRlhipodHRwOi8vd3d3 +LmRhcm1zdGFkdC5nbWQuZGUvaWNlLXRlbC9ldXJvY2EwDwYDVR0TAQH/BAUwAwEB +/zA7BgNVHR8ENDAyMDCgLqAshipodHRwOi8vd3d3LmRhcm1zdGFkdC5nbWQuZGUv +aWNlLXRlbC9ldXJvY2EwDQYJKoZIhvcNAQEEBQADQQAXooi3mVoFQeQTNGfmHz4m +7Etp+T4oIr6dHKtBbwwAhf5FdPaY8M6bZVNKUELH1JK916KoPZiIc81gKHmj/Eh6 +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/ICE-root.pem b/sample-app/protex_tutorial/OpenSSL/certs/ICE-root.pem new file mode 100644 index 0000000..fa99159 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/ICE-root.pem @@ -0,0 +1,48 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 0 (0x0) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority + Validity + Not Before: Apr 2 17:33:36 1997 GMT + Not After : Apr 2 17:33:36 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:80:3e:eb:ae:47:a9:fe:10:54:0b:81:8b:9c:2b: + 82:ab:3a:61:36:65:8b:f3:73:9f:ac:ac:7a:15:a7: + 13:8f:b4:c4:ba:a3:0f:bc:a5:58:8d:cc:b1:93:31: + 9e:81:9e:8c:19:61:86:fa:52:73:54:d1:97:76:22: + e7:c7:9f:41:cd + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + ........z.."p......e.. + X509v3 Key Usage: critical + .... + X509v3 Subject Alternative Name: + 0I.*http://www.darmstadt.gmd.de/ice-tel/euroca..ice-tel-ca@darmstadt.gmd.de + X509v3 Basic Constraints: critical + 0.... + Signature Algorithm: md5WithRSAEncryption + 76:69:61:db:b7:cf:8b:06:9e:d8:8c:96:53:d2:4d:a8:23:a6: + 03:44:e8:8f:24:a5:c0:84:a8:4b:77:d4:2d:2b:7d:37:91:67: + f2:2c:ce:02:31:4c:6b:cc:ce:f2:68:a6:11:11:ab:7d:88:b8: + 7e:22:9f:25:06:60:bd:79:30:3d +-----BEGIN CERTIFICATE----- +MIICFjCCAcCgAwIBAgIBADANBgkqhkiG9w0BAQQFADBIMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MB4XDTk3MDQwMjE3MzMzNloXDTk4MDQwMjE3MzMzNlowSDEhMB8G +A1UEChMYRXVyb3BlYW4gSUNFLVRFTCBwcm9qZWN0MSMwIQYDVQQLExpWMy1DZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTBZMAoGBFUIAQECAgIAA0sAMEgCQQCAPuuuR6n+ +EFQLgYucK4KrOmE2ZYvzc5+srHoVpxOPtMS6ow+8pViNzLGTMZ6BnowZYYb6UnNU +0Zd2IufHn0HNAgMBAAGjgZcwgZQwHQYDVR0OBBYEFIr3yNUOx3ro1yJw4AuJ1bbs +ZbzPMA4GA1UdDwEB/wQEAwIB9jBSBgNVHREESzBJhipodHRwOi8vd3d3LmRhcm1z +dGFkdC5nbWQuZGUvaWNlLXRlbC9ldXJvY2GBG2ljZS10ZWwtY2FAZGFybXN0YWR0 +LmdtZC5kZTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBAUAA0EAdmlh27fP +iwae2IyWU9JNqCOmA0TojySlwISoS3fULSt9N5Fn8izOAjFMa8zO8mimERGrfYi4 +fiKfJQZgvXkwPQ== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/ICE-user.pem b/sample-app/protex_tutorial/OpenSSL/certs/ICE-user.pem new file mode 100644 index 0000000..28065fd --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/ICE-user.pem @@ -0,0 +1,63 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt + Validity + Not Before: Apr 2 17:35:59 1997 GMT + Not After : Apr 2 17:35:59 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt, CN=USER + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:a8:a8:53:63:49:1b:93:c3:c3:0b:6c:88:11:55: + de:7e:6a:e2:f9:52:a0:dc:69:25:c4:c8:bf:55:e1: + 31:a8:ce:e4:a9:29:85:99:8a:15:9a:de:f6:2f:e1: + b4:50:5f:5e:04:75:a6:f4:76:dc:3c:0e:39:dc:3a: + be:3e:a4:61:8b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Authority Key Identifier: + 0...~r..:..B.44fu......3 + X509v3 Subject Key Identifier: + ...... .*...1.*....... + X509v3 Key Usage: critical + .... + X509v3 Certificate Policies: critical + 0.0...*...0....... + X509v3 Subject Alternative Name: + 0:..user@darmstadt.gmd.de.!http://www.darmstadt.gmd.de/~user + X509v3 Issuer Alternative Name: + 0....gmdca@gmd.de..http://www.gmd.de..saturn.darmstadt.gmd.de.\1!0...U. +..European ICE-TEL project1#0!..U....V3-Certification Authority1.0...U....Darmstadt..141.12.62.26 + X509v3 Basic Constraints: critical + 0. + X509v3 CRL Distribution Points: + 0.0.......gmdca@gmd.de + Signature Algorithm: md5WithRSAEncryption + 69:0c:e1:b7:a7:f2:d8:fb:e8:69:c0:13:cd:37:ad:21:06:22: + 4d:e8:c6:db:f1:04:0b:b7:e0:b3:d6:0c:81:03:ce:c3:6a:3e: + c7:e7:24:24:a4:92:64:c2:83:83:06:42:53:0e:6f:09:1e:84: + 9a:f7:6f:63:9b:94:99:83:d6:a4 +-----BEGIN CERTIFICATE----- +MIIDTzCCAvmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBcMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MRIwEAYDVQQHEwlEYXJtc3RhZHQwHhcNOTcwNDAyMTczNTU5WhcN +OTgwNDAyMTczNTU5WjBrMSEwHwYDVQQKExhFdXJvcGVhbiBJQ0UtVEVMIHByb2pl +Y3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24gQXV0aG9yaXR5MRIwEAYDVQQH +EwlEYXJtc3RhZHQxDTALBgNVBAMTBFVTRVIwWTAKBgRVCAEBAgICAANLADBIAkEA +qKhTY0kbk8PDC2yIEVXefmri+VKg3GklxMi/VeExqM7kqSmFmYoVmt72L+G0UF9e +BHWm9HbcPA453Dq+PqRhiwIDAQABo4IBmDCCAZQwHwYDVR0jBBgwFoAUfnLy+DqG +nEKINDRmdcPU/NGiETMwHQYDVR0OBBYEFJfc4B8gjSoRmLUx4Sq/ucIYiMrPMA4G +A1UdDwEB/wQEAwIB8DAcBgNVHSABAf8EEjAQMAYGBCoDBAUwBgYECQgHBjBDBgNV +HREEPDA6gRV1c2VyQGRhcm1zdGFkdC5nbWQuZGWGIWh0dHA6Ly93d3cuZGFybXN0 +YWR0LmdtZC5kZS9+dXNlcjCBsQYDVR0SBIGpMIGmgQxnbWRjYUBnbWQuZGWGEWh0 +dHA6Ly93d3cuZ21kLmRlghdzYXR1cm4uZGFybXN0YWR0LmdtZC5kZaRcMSEwHwYD +VQQKExhFdXJvcGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MRIwEAYDVQQHEwlEYXJtc3RhZHSHDDE0MS4xMi42 +Mi4yNjAMBgNVHRMBAf8EAjAAMB0GA1UdHwQWMBQwEqAQoA6BDGdtZGNhQGdtZC5k +ZTANBgkqhkiG9w0BAQQFAANBAGkM4ben8tj76GnAE803rSEGIk3oxtvxBAu34LPW +DIEDzsNqPsfnJCSkkmTCg4MGQlMObwkehJr3b2OblJmD1qQ= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/ICE.crl b/sample-app/protex_tutorial/OpenSSL/certs/ICE.crl new file mode 100644 index 0000000..21939e8 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/ICE.crl @@ -0,0 +1,9 @@ +-----BEGIN X509 CRL----- +MIIBNDCBnjANBgkqhkiG9w0BAQIFADBFMSEwHwYDVQQKExhFdXJvcGVhbiBJQ0Ut +VEVMIFByb2plY3QxIDAeBgNVBAsTF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5Fw05 +NzA2MDkxNDQyNDNaFw05NzA3MDkxNDQyNDNaMCgwEgIBChcNOTcwMzAzMTQ0MjU0 +WjASAgEJFw05NjEwMDIxMjI5MjdaMA0GCSqGSIb3DQEBAgUAA4GBAH4vgWo2Tej/ +i7kbiw4Imd30If91iosjClNpBFwvwUDBclPEeMuYimHbLOk4H8Nofc0fw11+U/IO +KSNouUDcqG7B64oY7c4SXKn+i1MWOb5OJiWeodX3TehHjBlyWzoNMWCnYA8XqFP1 +mOKp8Jla1BibEZf14+/HqCi2hnZUiEXh +-----END X509 CRL----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/a99c5886.0 b/sample-app/protex_tutorial/OpenSSL/certs/a99c5886.0 new file mode 100644 index 0000000..69f5c1c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/a99c5886.0 @@ -0,0 +1,19 @@ +subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority +issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority +notBefore=941104185834Z +notAfter =991103185834Z +-----BEGIN X509 CERTIFICATE----- + +MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw +HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy +Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05 +OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT +ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o +975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/ +touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE +7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j +9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI +0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb +MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU= +-----END X509 CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/adbec561.0 b/sample-app/protex_tutorial/OpenSSL/certs/adbec561.0 new file mode 100644 index 0000000..fa99159 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/adbec561.0 @@ -0,0 +1,48 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 0 (0x0) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority + Validity + Not Before: Apr 2 17:33:36 1997 GMT + Not After : Apr 2 17:33:36 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:80:3e:eb:ae:47:a9:fe:10:54:0b:81:8b:9c:2b: + 82:ab:3a:61:36:65:8b:f3:73:9f:ac:ac:7a:15:a7: + 13:8f:b4:c4:ba:a3:0f:bc:a5:58:8d:cc:b1:93:31: + 9e:81:9e:8c:19:61:86:fa:52:73:54:d1:97:76:22: + e7:c7:9f:41:cd + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + ........z.."p......e.. + X509v3 Key Usage: critical + .... + X509v3 Subject Alternative Name: + 0I.*http://www.darmstadt.gmd.de/ice-tel/euroca..ice-tel-ca@darmstadt.gmd.de + X509v3 Basic Constraints: critical + 0.... + Signature Algorithm: md5WithRSAEncryption + 76:69:61:db:b7:cf:8b:06:9e:d8:8c:96:53:d2:4d:a8:23:a6: + 03:44:e8:8f:24:a5:c0:84:a8:4b:77:d4:2d:2b:7d:37:91:67: + f2:2c:ce:02:31:4c:6b:cc:ce:f2:68:a6:11:11:ab:7d:88:b8: + 7e:22:9f:25:06:60:bd:79:30:3d +-----BEGIN CERTIFICATE----- +MIICFjCCAcCgAwIBAgIBADANBgkqhkiG9w0BAQQFADBIMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MB4XDTk3MDQwMjE3MzMzNloXDTk4MDQwMjE3MzMzNlowSDEhMB8G +A1UEChMYRXVyb3BlYW4gSUNFLVRFTCBwcm9qZWN0MSMwIQYDVQQLExpWMy1DZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTBZMAoGBFUIAQECAgIAA0sAMEgCQQCAPuuuR6n+ +EFQLgYucK4KrOmE2ZYvzc5+srHoVpxOPtMS6ow+8pViNzLGTMZ6BnowZYYb6UnNU +0Zd2IufHn0HNAgMBAAGjgZcwgZQwHQYDVR0OBBYEFIr3yNUOx3ro1yJw4AuJ1bbs +ZbzPMA4GA1UdDwEB/wQEAwIB9jBSBgNVHREESzBJhipodHRwOi8vd3d3LmRhcm1z +dGFkdC5nbWQuZGUvaWNlLXRlbC9ldXJvY2GBG2ljZS10ZWwtY2FAZGFybXN0YWR0 +LmdtZC5kZTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBAUAA0EAdmlh27fP +iwae2IyWU9JNqCOmA0TojySlwISoS3fULSt9N5Fn8izOAjFMa8zO8mimERGrfYi4 +fiKfJQZgvXkwPQ== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/b5f329fa.0 b/sample-app/protex_tutorial/OpenSSL/certs/b5f329fa.0 new file mode 100644 index 0000000..d8bdd8c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/b5f329fa.0 @@ -0,0 +1,18 @@ +subject=/C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority +notBefore=Jan 29 00:00:00 1996 GMT +notAfter=Jan 7 23:59:59 2004 GMT +-----BEGIN CERTIFICATE----- +MIICPTCCAaYCEQC6WslMBTuS1qe2307QU5INMA0GCSqGSIb3DQEBAgUAMF8xCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh +c3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05 +NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD +VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMiBQdWJsaWMgUHJp +bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEAtlqLow1qI4OAa885h/QhEzMGTCWi7VUSl8WngLn6g8EgoPovFQ18 +oWBrfnks+gYPOq72G2+x0v8vKFJfg31LxHq3+GYfgFT8t8KOWUoUV0bRmpO+QZED +uxWAk1zr58wIbD8+s0r8/0tsI9VQgiZEGY4jw3HqGSRHBJ51v8imAB8CAwEAATAN +BgkqhkiG9w0BAQIFAAOBgQC2AB+TV6QHp0DOZUA/VV7t7/pUSaUw1iF8YYfug5ML +v7Qz8pisnwa/TqjOFIFMywROWMPPX+5815pvy0GKt3+BuP+EYcYnQ2UdDOyxAArd +G6S7x3ggKLKi3TaVLuFUT79guXdoEZkj6OpS6KoATmdOu5C1RZtG644W78QzWzM9 +1Q== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/c33a80d4.0 b/sample-app/protex_tutorial/OpenSSL/certs/c33a80d4.0 new file mode 100644 index 0000000..51285e3 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/c33a80d4.0 @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy +dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t +MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB +MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG +A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp +b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl +cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv +bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE +VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ +ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR +uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI +hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM +pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/ddc328ff.0 b/sample-app/protex_tutorial/OpenSSL/certs/ddc328ff.0 new file mode 100644 index 0000000..27df192 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/ddc328ff.0 @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm +MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx +MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3 +dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl +cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3 +DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91 +yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX +L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj +EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG +7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e +QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ +qdq5snUb9kLy78fyGPmJvKP/iiMucEc= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/dsa-ca.pem b/sample-app/protex_tutorial/OpenSSL/certs/dsa-ca.pem new file mode 100644 index 0000000..9eb08f3 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/dsa-ca.pem @@ -0,0 +1,43 @@ +-----BEGIN DSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,C5B6C7CC9E1FE2C0 + +svCXBcBRhMuU22UXOfiKZA+thmz6KYXpt1Yg5Rd+TYQcQ1MdvNy0B0tkP1SxzDq0 +Xh1eMeTML9/9/0rKakgNXXXbpi5RB8t6BmwRSyej89F7nn1mtR3qzoyPRpp15SDl +Tn67C+2v+HDF3MFk88hiNCYkNbcmi7TWvChsl8N1r7wdZwtIox56yXdgxw6ZIpa/ +par0oUCzN7fiavPgCWz1kfPNSaBQSdxwH7TZi5tMHAr0J3C7a7QRnZfE09R59Uqr +zslrq+ndIw1BZAxoY0SlBu+iFOVaBVlwToC4AsHkv7j7l8ITtr7f42YbBa44D9TO +uOhONmkk/v3Fso4RaOEzdKZC+hnmmzvHs6TiTWm6yzJgSFwyOUK0eGmKEeVxpcH5 +rUOlHOwzen+FFtocZDZAfdFnb7QY7L/boQvyA5A+ZbRG4DUpmBQeQsSaICHM5Rxx +1QaLF413VNPXTLPbW0ilSc2H8x2iZTIVKfd33oSO6NhXPtSYQgfecEF4BvNHY5c4 +HovjT4mckbK95bcBzoCHu43vuSQkmZzdYo/ydSZt6zoPavbBLueTpgSbdXiDi827 +MVqOsYxGCb+kez0FoDSTgw== +-----END DSA PRIVATE KEY----- +-----BEGIN CERTIFICATE REQUEST----- +MIICUjCCAhECAQAwUjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx +ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDELMAkGA1UEAxMCQ0Ew +ggG0MIIBKQYFKw4DAgwwggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaW +sxXgUy6P4FmCc5A+dTGZR3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5m +rmuINvvsKNzC16W75Sw5JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHk +cJVbUM1JAhUA9wcx7fpsBgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVo +bzDjaeHls12YuyiGSPzemQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqR +CZ228U2cVA9YBu5JdAfOVX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxB +F5WS6wG1c6Vqftgy7Q4CuAOBhAACgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuH +vSLw9YUrJahcBHmbpvt494lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUq +AylOVFJJJXuirVJ+o+0TtOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u +3enxhqnDGaAAMAkGBSsOAwIbBQADMAAwLQIVAJGVuFsG/0DBuSZ0jF7ypdU0/G0v +AhQfeF5BoMMDbX/kidUVpQ6gadPlZA== +-----END CERTIFICATE REQUEST----- +-----BEGIN CERTIFICATE----- +MIIBrjCCAWwCAQswCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK +U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww +CgYDVQQDEwNQQ0EwHhcNOTcwNjE1MDIxNDI5WhcNOTcwNzE1MDIxNDI5WjBSMQsw +CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu +ZXQgV2lkZ2l0cyBQdHkgTHRkMQswCQYDVQQDEwJDQTCBkjAJBgUrDgMCDAUAA4GE +AAKBgBqmWXqKrP1etkWWTYYJVwH4qKHFacfsi4e9IvD1hSslqFwEeZum+3j3iUXi +ALnDdY8z69cmh9u6yTgahAQSxA0wNpqHibj25SoDKU5UUkkle6KtUn6j7RO04UMh +MQCX5hllquJc4Pu105I6X1Esw8Lr51ocpL17ry7d6fGGqcMZMAkGBSsOAwIbBQAD +MQAwLgIVAJ4wtQsANPxHo7Q4IQZYsL12SKdbAhUAjJ9n38zxT+iai2164xS+LIfa +C1Q= +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/certs/dsa-pca.pem b/sample-app/protex_tutorial/OpenSSL/certs/dsa-pca.pem new file mode 100644 index 0000000..e3641ad --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/dsa-pca.pem @@ -0,0 +1,49 @@ +-----BEGIN DSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,F80EEEBEEA7386C4 + +GZ9zgFcHOlnhPoiSbVi/yXc9mGoj44A6IveD4UlpSEUt6Xbse3Fr0KHIUyQ3oGnS +mClKoAp/eOTb5Frhto85SzdsxYtac+X1v5XwdzAMy2KowHVk1N8A5jmE2OlkNPNt +of132MNlo2cyIRYaa35PPYBGNCmUm7YcYS8O90YtkrQZZTf4+2C4kllhMcdkQwkr +FWSWC8YOQ7w0LHb4cX1FejHHom9Nd/0PN3vn3UyySvfOqoR7nbXkrpHXmPIr0hxX +RcF0aXcV/CzZ1/nfXWQf4o3+oD0T22SDoVcZY60IzI0oIc3pNCbDV3uKNmgekrFd +qOUJ+QW8oWp7oefRx62iBfIeC8DZunohMXaWAQCU0sLQOR4yEdeUCnzCSywe0bG1 +diD0KYaEe+Yub1BQH4aLsBgDjardgpJRTQLq0DUvw0/QGO1irKTJzegEDNVBKrVn +V4AHOKT1CUKqvGNRP1UnccUDTF6miOAtaj/qpzra7sSk7dkGBvIEeFoAg84kfh9h +hVvF1YyzC9bwZepruoqoUwke/WdNIR5ymOVZ/4Liw0JdIOcq+atbdRX08niqIRkf +dsZrUj4leo3zdefYUQ7w4N2Ns37yDFq7 +-----END DSA PRIVATE KEY----- +-----BEGIN CERTIFICATE REQUEST----- +MIICVTCCAhMCAQAwUzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx +ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEMMAoGA1UEAxMDUENB +MIIBtTCCASkGBSsOAwIMMIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2G +lrMV4FMuj+BZgnOQPnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7O +Zq5riDb77Cjcwtelu+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR +5HCVW1DNSQIVAPcHMe36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnl +aG8w42nh5bNdmLsohkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6 +kQmdtvFNnFQPWAbuSXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15Als +QReVkusBtXOlan7YMu0OArgDgYUAAoGBAKbtuR5AdW+ICjCFe2ixjUiJJzM2IKwe +6NZEMXg39+HQ1UTPTmfLZLps+rZfolHDXuRKMXbGFdSF0nXYzotPCzi7GauwEJTZ +yr27ZZjA1C6apGSQ9GzuwNvZ4rCXystVEagAS8OQ4H3D4dWS17Zg31ICb5o4E5r0 +z09o/Uz46u0VoAAwCQYFKw4DAhsFAAMxADAuAhUArRubTxsbIXy3AhtjQ943AbNB +nSICFQCu+g1iW3jwF+gOcbroD4S/ZcvB3w== +-----END CERTIFICATE REQUEST----- +-----BEGIN CERTIFICATE----- +MIIC0zCCApECAQAwCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK +U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww +CgYDVQQDEwNQQ0EwHhcNOTcwNjE0MjI1NDQ1WhcNOTcwNzE0MjI1NDQ1WjBTMQsw +CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu +ZXQgV2lkZ2l0cyBQdHkgTHRkMQwwCgYDVQQDEwNQQ0EwggG1MIIBKQYFKw4DAgww +ggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaWsxXgUy6P4FmCc5A+dTGZ +R3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5mrmuINvvsKNzC16W75Sw5 +JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHkcJVbUM1JAhUA9wcx7fps +BgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVobzDjaeHls12YuyiGSPze +mQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqRCZ228U2cVA9YBu5JdAfO +VX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxBF5WS6wG1c6Vqftgy7Q4C +uAOBhQACgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk +umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A +29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUwCQYFKw4D +AhsFAAMxADAuAhUAvtv6AkMolix1Jvy3UnVEIUqdCUICFQC+jq8P49mwrY9oJ24n +5rKUjNBhSg== +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-CA.pem b/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-CA.pem new file mode 100644 index 0000000..7565236 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-CA.pem @@ -0,0 +1,59 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority + Validity + Not Before: Apr 2 17:35:53 1997 GMT + Not After : Apr 2 17:35:53 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:82:75:ba:f6:d1:60:b5:f9:15:b3:6a:dd:29:8f: + 8b:a4:6f:1a:88:e0:50:43:40:0b:79:41:d5:d3:16: + 44:7d:74:65:17:42:06:52:0b:e9:50:c8:10:cd:24: + e2:ae:8d:22:30:73:e6:b4:b7:93:1f:e5:6e:a2:ae: + 49:11:a5:c9:45 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Authority Key Identifier: + 0.........z.."p......e.. + X509v3 Subject Key Identifier: + ..~r..:..B.44fu......3 + X509v3 Key Usage: critical + .... + X509v3 Certificate Policies: critical + 0.0...*... + X509v3 Subject Alternative Name: + 0!..secude-support@darmstadt.gmd.de + X509v3 Issuer Alternative Name: + 0I..ice-tel-ca@darmstadt.gmd.de.*http://www.darmstadt.gmd.de/ice-tel/euroca + X509v3 Basic Constraints: critical + 0.... + X509v3 CRL Distribution Points: + 0200...,.*http://www.darmstadt.gmd.de/ice-tel/euroca + Signature Algorithm: md5WithRSAEncryption + 17:a2:88:b7:99:5a:05:41:e4:13:34:67:e6:1f:3e:26:ec:4b: + 69:f9:3e:28:22:be:9d:1c:ab:41:6f:0c:00:85:fe:45:74:f6: + 98:f0:ce:9b:65:53:4a:50:42:c7:d4:92:bd:d7:a2:a8:3d:98: + 88:73:cd:60:28:79:a3:fc:48:7a +-----BEGIN CERTIFICATE----- +MIICzDCCAnagAwIBAgIBATANBgkqhkiG9w0BAQQFADBIMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MB4XDTk3MDQwMjE3MzU1M1oXDTk4MDQwMjE3MzU1M1owXDEhMB8G +A1UEChMYRXVyb3BlYW4gSUNFLVRFTCBwcm9qZWN0MSMwIQYDVQQLExpWMy1DZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTESMBAGA1UEBxMJRGFybXN0YWR0MFkwCgYEVQgB +AQICAgADSwAwSAJBAIJ1uvbRYLX5FbNq3SmPi6RvGojgUENAC3lB1dMWRH10ZRdC +BlIL6VDIEM0k4q6NIjBz5rS3kx/lbqKuSRGlyUUCAwEAAaOCATgwggE0MB8GA1Ud +IwQYMBaAFIr3yNUOx3ro1yJw4AuJ1bbsZbzPMB0GA1UdDgQWBBR+cvL4OoacQog0 +NGZ1w9T80aIRMzAOBgNVHQ8BAf8EBAMCAfYwFAYDVR0gAQH/BAowCDAGBgQqAwQF +MCoGA1UdEQQjMCGBH3NlY3VkZS1zdXBwb3J0QGRhcm1zdGFkdC5nbWQuZGUwUgYD +VR0SBEswSYEbaWNlLXRlbC1jYUBkYXJtc3RhZHQuZ21kLmRlhipodHRwOi8vd3d3 +LmRhcm1zdGFkdC5nbWQuZGUvaWNlLXRlbC9ldXJvY2EwDwYDVR0TAQH/BAUwAwEB +/zA7BgNVHR8ENDAyMDCgLqAshipodHRwOi8vd3d3LmRhcm1zdGFkdC5nbWQuZGUv +aWNlLXRlbC9ldXJvY2EwDQYJKoZIhvcNAQEEBQADQQAXooi3mVoFQeQTNGfmHz4m +7Etp+T4oIr6dHKtBbwwAhf5FdPaY8M6bZVNKUELH1JK916KoPZiIc81gKHmj/Eh6 +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-root.pem b/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-root.pem new file mode 100644 index 0000000..fa99159 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-root.pem @@ -0,0 +1,48 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 0 (0x0) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority + Validity + Not Before: Apr 2 17:33:36 1997 GMT + Not After : Apr 2 17:33:36 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:80:3e:eb:ae:47:a9:fe:10:54:0b:81:8b:9c:2b: + 82:ab:3a:61:36:65:8b:f3:73:9f:ac:ac:7a:15:a7: + 13:8f:b4:c4:ba:a3:0f:bc:a5:58:8d:cc:b1:93:31: + 9e:81:9e:8c:19:61:86:fa:52:73:54:d1:97:76:22: + e7:c7:9f:41:cd + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Subject Key Identifier: + ........z.."p......e.. + X509v3 Key Usage: critical + .... + X509v3 Subject Alternative Name: + 0I.*http://www.darmstadt.gmd.de/ice-tel/euroca..ice-tel-ca@darmstadt.gmd.de + X509v3 Basic Constraints: critical + 0.... + Signature Algorithm: md5WithRSAEncryption + 76:69:61:db:b7:cf:8b:06:9e:d8:8c:96:53:d2:4d:a8:23:a6: + 03:44:e8:8f:24:a5:c0:84:a8:4b:77:d4:2d:2b:7d:37:91:67: + f2:2c:ce:02:31:4c:6b:cc:ce:f2:68:a6:11:11:ab:7d:88:b8: + 7e:22:9f:25:06:60:bd:79:30:3d +-----BEGIN CERTIFICATE----- +MIICFjCCAcCgAwIBAgIBADANBgkqhkiG9w0BAQQFADBIMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MB4XDTk3MDQwMjE3MzMzNloXDTk4MDQwMjE3MzMzNlowSDEhMB8G +A1UEChMYRXVyb3BlYW4gSUNFLVRFTCBwcm9qZWN0MSMwIQYDVQQLExpWMy1DZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eTBZMAoGBFUIAQECAgIAA0sAMEgCQQCAPuuuR6n+ +EFQLgYucK4KrOmE2ZYvzc5+srHoVpxOPtMS6ow+8pViNzLGTMZ6BnowZYYb6UnNU +0Zd2IufHn0HNAgMBAAGjgZcwgZQwHQYDVR0OBBYEFIr3yNUOx3ro1yJw4AuJ1bbs +ZbzPMA4GA1UdDwEB/wQEAwIB9jBSBgNVHREESzBJhipodHRwOi8vd3d3LmRhcm1z +dGFkdC5nbWQuZGUvaWNlLXRlbC9ldXJvY2GBG2ljZS10ZWwtY2FAZGFybXN0YWR0 +LmdtZC5kZTAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBAUAA0EAdmlh27fP +iwae2IyWU9JNqCOmA0TojySlwISoS3fULSt9N5Fn8izOAjFMa8zO8mimERGrfYi4 +fiKfJQZgvXkwPQ== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-user.pem b/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-user.pem new file mode 100644 index 0000000..28065fd --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE-user.pem @@ -0,0 +1,63 @@ +Certificate: + Data: + Version: 3 (0x2) + Serial Number: 1 (0x1) + Signature Algorithm: md5WithRSAEncryption + Issuer: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt + Validity + Not Before: Apr 2 17:35:59 1997 GMT + Not After : Apr 2 17:35:59 1998 GMT + Subject: O=European ICE-TEL project, OU=V3-Certification Authority, L=Darmstadt, CN=USER + Subject Public Key Info: + Public Key Algorithm: rsa + RSA Public Key: (512 bit) + Modulus (512 bit): + 00:a8:a8:53:63:49:1b:93:c3:c3:0b:6c:88:11:55: + de:7e:6a:e2:f9:52:a0:dc:69:25:c4:c8:bf:55:e1: + 31:a8:ce:e4:a9:29:85:99:8a:15:9a:de:f6:2f:e1: + b4:50:5f:5e:04:75:a6:f4:76:dc:3c:0e:39:dc:3a: + be:3e:a4:61:8b + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Authority Key Identifier: + 0...~r..:..B.44fu......3 + X509v3 Subject Key Identifier: + ...... .*...1.*....... + X509v3 Key Usage: critical + .... + X509v3 Certificate Policies: critical + 0.0...*...0....... + X509v3 Subject Alternative Name: + 0:..user@darmstadt.gmd.de.!http://www.darmstadt.gmd.de/~user + X509v3 Issuer Alternative Name: + 0....gmdca@gmd.de..http://www.gmd.de..saturn.darmstadt.gmd.de.\1!0...U. +..European ICE-TEL project1#0!..U....V3-Certification Authority1.0...U....Darmstadt..141.12.62.26 + X509v3 Basic Constraints: critical + 0. + X509v3 CRL Distribution Points: + 0.0.......gmdca@gmd.de + Signature Algorithm: md5WithRSAEncryption + 69:0c:e1:b7:a7:f2:d8:fb:e8:69:c0:13:cd:37:ad:21:06:22: + 4d:e8:c6:db:f1:04:0b:b7:e0:b3:d6:0c:81:03:ce:c3:6a:3e: + c7:e7:24:24:a4:92:64:c2:83:83:06:42:53:0e:6f:09:1e:84: + 9a:f7:6f:63:9b:94:99:83:d6:a4 +-----BEGIN CERTIFICATE----- +MIIDTzCCAvmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBcMSEwHwYDVQQKExhFdXJv +cGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5MRIwEAYDVQQHEwlEYXJtc3RhZHQwHhcNOTcwNDAyMTczNTU5WhcN +OTgwNDAyMTczNTU5WjBrMSEwHwYDVQQKExhFdXJvcGVhbiBJQ0UtVEVMIHByb2pl +Y3QxIzAhBgNVBAsTGlYzLUNlcnRpZmljYXRpb24gQXV0aG9yaXR5MRIwEAYDVQQH +EwlEYXJtc3RhZHQxDTALBgNVBAMTBFVTRVIwWTAKBgRVCAEBAgICAANLADBIAkEA +qKhTY0kbk8PDC2yIEVXefmri+VKg3GklxMi/VeExqM7kqSmFmYoVmt72L+G0UF9e +BHWm9HbcPA453Dq+PqRhiwIDAQABo4IBmDCCAZQwHwYDVR0jBBgwFoAUfnLy+DqG +nEKINDRmdcPU/NGiETMwHQYDVR0OBBYEFJfc4B8gjSoRmLUx4Sq/ucIYiMrPMA4G +A1UdDwEB/wQEAwIB8DAcBgNVHSABAf8EEjAQMAYGBCoDBAUwBgYECQgHBjBDBgNV +HREEPDA6gRV1c2VyQGRhcm1zdGFkdC5nbWQuZGWGIWh0dHA6Ly93d3cuZGFybXN0 +YWR0LmdtZC5kZS9+dXNlcjCBsQYDVR0SBIGpMIGmgQxnbWRjYUBnbWQuZGWGEWh0 +dHA6Ly93d3cuZ21kLmRlghdzYXR1cm4uZGFybXN0YWR0LmdtZC5kZaRcMSEwHwYD +VQQKExhFdXJvcGVhbiBJQ0UtVEVMIHByb2plY3QxIzAhBgNVBAsTGlYzLUNlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MRIwEAYDVQQHEwlEYXJtc3RhZHSHDDE0MS4xMi42 +Mi4yNjAMBgNVHRMBAf8EAjAAMB0GA1UdHwQWMBQwEqAQoA6BDGdtZGNhQGdtZC5k +ZTANBgkqhkiG9w0BAQQFAANBAGkM4ben8tj76GnAE803rSEGIk3oxtvxBAu34LPW +DIEDzsNqPsfnJCSkkmTCg4MGQlMObwkehJr3b2OblJmD1qQ= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE.crl b/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE.crl new file mode 100644 index 0000000..21939e8 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/expired/ICE.crl @@ -0,0 +1,9 @@ +-----BEGIN X509 CRL----- +MIIBNDCBnjANBgkqhkiG9w0BAQIFADBFMSEwHwYDVQQKExhFdXJvcGVhbiBJQ0Ut +VEVMIFByb2plY3QxIDAeBgNVBAsTF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5Fw05 +NzA2MDkxNDQyNDNaFw05NzA3MDkxNDQyNDNaMCgwEgIBChcNOTcwMzAzMTQ0MjU0 +WjASAgEJFw05NjEwMDIxMjI5MjdaMA0GCSqGSIb3DQEBAgUAA4GBAH4vgWo2Tej/ +i7kbiw4Imd30If91iosjClNpBFwvwUDBclPEeMuYimHbLOk4H8Nofc0fw11+U/IO +KSNouUDcqG7B64oY7c4SXKn+i1MWOb5OJiWeodX3TehHjBlyWzoNMWCnYA8XqFP1 +mOKp8Jla1BibEZf14+/HqCi2hnZUiEXh +-----END X509 CRL----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/f3e90025.0 b/sample-app/protex_tutorial/OpenSSL/certs/f3e90025.0 new file mode 100644 index 0000000..8e28b39 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/f3e90025.0 @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM +MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT +DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx +CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv +amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB +iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt +U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw +zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd +BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8 +/DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi +lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA +S7ELuYGtmYgYm9NZOIr7yU0= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/f73e89fd.0 b/sample-app/protex_tutorial/OpenSSL/certs/f73e89fd.0 new file mode 100644 index 0000000..5de48bf --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/f73e89fd.0 @@ -0,0 +1,17 @@ +subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority +notBefore=Nov 9 00:00:00 1994 GMT +notAfter=Jan 7 23:59:59 2010 GMT +-----BEGIN CERTIFICATE----- +MIICNDCCAaECEAKtZn5ORf5eV288mBle3cAwDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxIDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYD +VQQLEyVTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk0 +MTEwOTAwMDAwMFoXDTEwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxIDAeBgNV +BAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2Vy +dmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGbMA0GCSqGSIb3DQEBAQUAA4GJ +ADCBhQJ+AJLOesGugz5aqomDV6wlAXYMra6OLDfO6zV4ZFQD5YRAUcm/jwjiioII +0haGN1XpsSECrXZogZoFokvJSyVmIlZsiAeP94FZbYQHZXATcXY+m3dM41CJVphI +uR2nKRoTLkoRWZweFdVJVCxzOmmCsZc5nG1wZ0jl3S3WyB57AgMBAAEwDQYJKoZI +hvcNAQECBQADfgBl3X7hsuyw4jrg7HFGmhkRuNPHoLQDQCYCPgmc4RKz0Vr2N6W3 +YQO2WxZpO8ZECAyIUwxrl0nHPjXcbLm7qt9cuzovk2C2qUtN8iD3zV9/ZHuO3ABc +1/p3yjkWWW8O6tO1g39NTUJWdrTJXwT4OPjr0l91X817/OWOgHz8UA== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/factory.pem b/sample-app/protex_tutorial/OpenSSL/certs/factory.pem new file mode 100644 index 0000000..8e28b39 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/factory.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM +MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT +DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx +CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv +amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB +iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt +U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw +zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd +BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8 +/DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi +lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA +S7ELuYGtmYgYm9NZOIr7yU0= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/nortelCA.pem b/sample-app/protex_tutorial/OpenSSL/certs/nortelCA.pem new file mode 100644 index 0000000..207f34a --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/nortelCA.pem @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE----- +MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN +BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w +HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0 +IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL +MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls +aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww +GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL +ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc +zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0 +YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq +hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF +cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W +YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w== +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/certs/rsa-cca.pem b/sample-app/protex_tutorial/OpenSSL/certs/rsa-cca.pem new file mode 100644 index 0000000..69f5c1c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/rsa-cca.pem @@ -0,0 +1,19 @@ +subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority +issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority +notBefore=941104185834Z +notAfter =991103185834Z +-----BEGIN X509 CERTIFICATE----- + +MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw +HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy +Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05 +OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT +ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o +975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/ +touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE +7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j +9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI +0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb +MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU= +-----END X509 CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/rsa-ssca.pem b/sample-app/protex_tutorial/OpenSSL/certs/rsa-ssca.pem new file mode 100644 index 0000000..c940321 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/rsa-ssca.pem @@ -0,0 +1,19 @@ +subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority +issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority +notBefore=941109235417Z +notAfter =991231235417Z +-----BEGIN X509 CERTIFICATE----- + +MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw +HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl +IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda +Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0 +YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB +roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12 +aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc +HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A +iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7 +suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h +cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk= +-----END X509 CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/thawteCb.pem b/sample-app/protex_tutorial/OpenSSL/certs/thawteCb.pem new file mode 100644 index 0000000..27df192 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/thawteCb.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm +MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx +MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3 +dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl +cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3 +DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91 +yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX +L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj +EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG +7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e +QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ +qdq5snUb9kLy78fyGPmJvKP/iiMucEc= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/thawteCp.pem b/sample-app/protex_tutorial/OpenSSL/certs/thawteCp.pem new file mode 100644 index 0000000..51285e3 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/thawteCp.pem @@ -0,0 +1,19 @@ +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy +dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t +MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB +MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG +A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp +b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl +cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv +bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE +VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ +ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR +uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI +hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM +pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/timCA.pem b/sample-app/protex_tutorial/OpenSSL/certs/timCA.pem new file mode 100644 index 0000000..9c8d5bf --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/timCA.pem @@ -0,0 +1,16 @@ +Tims test GCI CA + +-----BEGIN CERTIFICATE----- +MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD +VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 +cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD +cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow +gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC +cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl +dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN +AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw +OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF +AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA +TfdbFZtAAD2Hx9jUtY3tfdrJOb8= +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/certs/tjhCA.pem b/sample-app/protex_tutorial/OpenSSL/certs/tjhCA.pem new file mode 100644 index 0000000..67bee1b --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/tjhCA.pem @@ -0,0 +1,15 @@ +-----BEGIN CERTIFICATE----- +MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD +VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 +cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O +IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB +VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1 +NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH +EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT +I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta +RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ +KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR +Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG +9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4 +WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/vsign1.pem b/sample-app/protex_tutorial/OpenSSL/certs/vsign1.pem new file mode 100644 index 0000000..277894d --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/vsign1.pem @@ -0,0 +1,17 @@ +subject=/C=US/O=VeriSign, Inc./OU=Class 1 Public Primary Certification Authority +notBefore=Jan 29 00:00:00 1996 GMT +notAfter=Jan 7 23:59:59 2020 GMT +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEDJQM89Q0VbzXIGtZVxPyCUwDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAxIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTIwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0f +zGVuDLDQVoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHi +TkVWaR94AoDa3EeRKbs2yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0G +CSqGSIb3DQEBAgUAA4GBAEtEZmBoZOSYG/OwcuaViXzde7OVwB0u2NgZ0C00PcZQ +mhCGjKo/O6gE/DdSlcPZydvN8oYGxLEb8IKIMEKOF1AcZHq4PplJdJf8rAJD+5YM +VgQlDHx8h50kp9jwMim1pN9dokzFFjKoQvZFprY2ueC/ZTaTwtLXa9zeWdaiNfhF +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/vsign2.pem b/sample-app/protex_tutorial/OpenSSL/certs/vsign2.pem new file mode 100644 index 0000000..d8bdd8c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/vsign2.pem @@ -0,0 +1,18 @@ +subject=/C=US/O=VeriSign, Inc./OU=Class 2 Public Primary Certification Authority +notBefore=Jan 29 00:00:00 1996 GMT +notAfter=Jan 7 23:59:59 2004 GMT +-----BEGIN CERTIFICATE----- +MIICPTCCAaYCEQC6WslMBTuS1qe2307QU5INMA0GCSqGSIb3DQEBAgUAMF8xCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh +c3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05 +NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD +VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMiBQdWJsaWMgUHJp +bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEAtlqLow1qI4OAa885h/QhEzMGTCWi7VUSl8WngLn6g8EgoPovFQ18 +oWBrfnks+gYPOq72G2+x0v8vKFJfg31LxHq3+GYfgFT8t8KOWUoUV0bRmpO+QZED +uxWAk1zr58wIbD8+s0r8/0tsI9VQgiZEGY4jw3HqGSRHBJ51v8imAB8CAwEAATAN +BgkqhkiG9w0BAQIFAAOBgQC2AB+TV6QHp0DOZUA/VV7t7/pUSaUw1iF8YYfug5ML +v7Qz8pisnwa/TqjOFIFMywROWMPPX+5815pvy0GKt3+BuP+EYcYnQ2UdDOyxAArd +G6S7x3ggKLKi3TaVLuFUT79guXdoEZkj6OpS6KoATmdOu5C1RZtG644W78QzWzM9 +1Q== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/vsign3.pem b/sample-app/protex_tutorial/OpenSSL/certs/vsign3.pem new file mode 100644 index 0000000..aa5bb4c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/vsign3.pem @@ -0,0 +1,18 @@ +subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority +notBefore=Jan 29 00:00:00 1996 GMT +notAfter=Jan 7 23:59:59 2004 GMT +-----BEGIN CERTIFICATE----- +MIICPTCCAaYCEQDknv3zOugOz6URPhmkJAIyMA0GCSqGSIb3DQEBAgUAMF8xCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xh +c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05 +NjAxMjkwMDAwMDBaFw0wNDAxMDcyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYD +VQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJp +bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEAyVxZnvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqo +RAWq7AMfeH+ek7maAKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4 +rCNfcCk2pMmG57GaIMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATAN +BgkqhkiG9w0BAQIFAAOBgQBhcOwvP579K+ZoVCGwZ3kIDCCWMYoNer62Jt95LCJp +STbjl3diYaIy13pUITa6Ask05yXaRDWw0lyAXbOU+Pms7qRgdSoflUkjsUp89LNH +ciFbfperVKxi513srpvSybIk+4Kt6WcVS7qqpvCXoPawl1cAyAw8CaCCBLpB2veZ +pA== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/vsignss.pem b/sample-app/protex_tutorial/OpenSSL/certs/vsignss.pem new file mode 100644 index 0000000..5de48bf --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/vsignss.pem @@ -0,0 +1,17 @@ +subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority +notBefore=Nov 9 00:00:00 1994 GMT +notAfter=Jan 7 23:59:59 2010 GMT +-----BEGIN CERTIFICATE----- +MIICNDCCAaECEAKtZn5ORf5eV288mBle3cAwDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxIDAeBgNVBAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYD +VQQLEyVTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk0 +MTEwOTAwMDAwMFoXDTEwMDEwNzIzNTk1OVowXzELMAkGA1UEBhMCVVMxIDAeBgNV +BAoTF1JTQSBEYXRhIFNlY3VyaXR5LCBJbmMuMS4wLAYDVQQLEyVTZWN1cmUgU2Vy +dmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGbMA0GCSqGSIb3DQEBAQUAA4GJ +ADCBhQJ+AJLOesGugz5aqomDV6wlAXYMra6OLDfO6zV4ZFQD5YRAUcm/jwjiioII +0haGN1XpsSECrXZogZoFokvJSyVmIlZsiAeP94FZbYQHZXATcXY+m3dM41CJVphI +uR2nKRoTLkoRWZweFdVJVCxzOmmCsZc5nG1wZ0jl3S3WyB57AgMBAAEwDQYJKoZI +hvcNAQECBQADfgBl3X7hsuyw4jrg7HFGmhkRuNPHoLQDQCYCPgmc4RKz0Vr2N6W3 +YQO2WxZpO8ZECAyIUwxrl0nHPjXcbLm7qt9cuzovk2C2qUtN8iD3zV9/ZHuO3ABc +1/p3yjkWWW8O6tO1g39NTUJWdrTJXwT4OPjr0l91X817/OWOgHz8UA== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/certs/vsigntca.pem b/sample-app/protex_tutorial/OpenSSL/certs/vsigntca.pem new file mode 100644 index 0000000..05acf76 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/certs/vsigntca.pem @@ -0,0 +1,18 @@ +subject=/O=VeriSign, Inc/OU=www.verisign.com/repository/TestCPS Incorp. By Ref. Liab. LTD./OU=For VeriSign authorized testing only. No assurances (C)VS1997 +notBefore=Mar 4 00:00:00 1997 GMT +notAfter=Mar 4 23:59:59 2025 GMT +-----BEGIN CERTIFICATE----- +MIICTTCCAfcCEEdoCqpuXxnoK27q7d58Qc4wDQYJKoZIhvcNAQEEBQAwgakxFjAU +BgNVBAoTDVZlcmlTaWduLCBJbmMxRzBFBgNVBAsTPnd3dy52ZXJpc2lnbi5jb20v +cmVwb3NpdG9yeS9UZXN0Q1BTIEluY29ycC4gQnkgUmVmLiBMaWFiLiBMVEQuMUYw +RAYDVQQLEz1Gb3IgVmVyaVNpZ24gYXV0aG9yaXplZCB0ZXN0aW5nIG9ubHkuIE5v +IGFzc3VyYW5jZXMgKEMpVlMxOTk3MB4XDTk3MDMwNDAwMDAwMFoXDTI1MDMwNDIz +NTk1OVowgakxFjAUBgNVBAoTDVZlcmlTaWduLCBJbmMxRzBFBgNVBAsTPnd3dy52 +ZXJpc2lnbi5jb20vcmVwb3NpdG9yeS9UZXN0Q1BTIEluY29ycC4gQnkgUmVmLiBM +aWFiLiBMVEQuMUYwRAYDVQQLEz1Gb3IgVmVyaVNpZ24gYXV0aG9yaXplZCB0ZXN0 +aW5nIG9ubHkuIE5vIGFzc3VyYW5jZXMgKEMpVlMxOTk3MFwwDQYJKoZIhvcNAQEB +BQADSwAwSAJBAMak6xImJx44jMKcbkACy5/CyMA2fqXK4PlzTtCxRq5tFkDzne7s +cI8oFK/J+gFZNE3bjidDxf07O3JOYG9RGx8CAwEAATANBgkqhkiG9w0BAQQFAANB +ADT523tENOKrEheZFpsJx1UUjPrG7TwYc/C4NBHrZI4gZJcKVFIfNulftVS6UMYW +ToLEMaUojc3DuNXHG21PDG8= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/client.pem b/sample-app/protex_tutorial/OpenSSL/client.pem new file mode 100644 index 0000000..307910e --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/client.pem @@ -0,0 +1,24 @@ +issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) +subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Client test cert (512 bit) +-----BEGIN CERTIFICATE----- +MIIB6TCCAVICAQIwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV +BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD +VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU2WhcNOTgwNjA5 +MTM1NzU2WjBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG +A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGkNsaWVudCB0ZXN0IGNl +cnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALtv55QyzG6i2Plw +Z1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexmq/R4KedLjFEIYjocDui+IXs62NNt +XrT8odkCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBwtMmI7oGUG8nKmftQssATViH5 +NRRtoEw07DxJp/LfatHdrhqQB73eGdL5WILZJXk46Xz2e9WMSUjVCSYhdKxtflU3 +UR2Ajv1Oo0sTNdfz0wDqJNirLNtzyhhsaq8qMTrLwXrCP31VxBiigFSQSUFnZyTE +9TKwhS4GlwbtCfxSKQ== +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIIBOwIBAAJBALtv55QyzG6i2PlwZ1pah7++Gv8L5j6Hnyr/uTZE1NLG0ABDDexm +q/R4KedLjFEIYjocDui+IXs62NNtXrT8odkCAwEAAQJAbwXq0vJ/+uyEvsNgxLko +/V86mGXQ/KrSkeKlL0r4ENxjcyeMAGoKu6J9yMY7+X9+Zm4nxShNfTsf/+Freoe1 +HQIhAPOSm5Q1YI+KIsII2GeVJx1U69+wnd71OasIPakS1L1XAiEAxQAW+J3/JWE0 +ftEYakbhUOKL8tD1OaFZS71/5GdG7E8CIQCefUMmySSvwd6kC0VlATSWbW+d+jp/ +nWmM1KvqnAo5uQIhALqEADu5U1Wvt8UN8UDGBRPQulHWNycuNV45d3nnskWPAiAw +ueTyr6WsZ5+SD8g/Hy3xuvF3nPmJRH+rwvVihlcFOg== +-----END RSA PRIVATE KEY----- diff --git a/sample-app/protex_tutorial/OpenSSL/dh1024.pem b/sample-app/protex_tutorial/OpenSSL/dh1024.pem new file mode 100644 index 0000000..81d43f6 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/dh1024.pem @@ -0,0 +1,5 @@ +-----BEGIN DH PARAMETERS----- +MIGHAoGBAJf2QmHKtQXdKCjhPx1ottPb0PMTBH9A6FbaWMsTuKG/K3g6TG1Z1fkq +/Gz/PWk/eLI9TzFgqVAuPvr3q14a1aZeVUMTgo2oO5/y2UHe6VaJ+trqCTat3xlx +/mNbIK9HA2RgPC3gWfVLZQrY+gz3ASHHR5nXWHEyvpuZm7m3h+irAgEC +-----END DH PARAMETERS----- diff --git a/sample-app/protex_tutorial/OpenSSL/dsa-ca.pem b/sample-app/protex_tutorial/OpenSSL/dsa-ca.pem new file mode 100644 index 0000000..9eb08f3 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/dsa-ca.pem @@ -0,0 +1,43 @@ +-----BEGIN DSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,C5B6C7CC9E1FE2C0 + +svCXBcBRhMuU22UXOfiKZA+thmz6KYXpt1Yg5Rd+TYQcQ1MdvNy0B0tkP1SxzDq0 +Xh1eMeTML9/9/0rKakgNXXXbpi5RB8t6BmwRSyej89F7nn1mtR3qzoyPRpp15SDl +Tn67C+2v+HDF3MFk88hiNCYkNbcmi7TWvChsl8N1r7wdZwtIox56yXdgxw6ZIpa/ +par0oUCzN7fiavPgCWz1kfPNSaBQSdxwH7TZi5tMHAr0J3C7a7QRnZfE09R59Uqr +zslrq+ndIw1BZAxoY0SlBu+iFOVaBVlwToC4AsHkv7j7l8ITtr7f42YbBa44D9TO +uOhONmkk/v3Fso4RaOEzdKZC+hnmmzvHs6TiTWm6yzJgSFwyOUK0eGmKEeVxpcH5 +rUOlHOwzen+FFtocZDZAfdFnb7QY7L/boQvyA5A+ZbRG4DUpmBQeQsSaICHM5Rxx +1QaLF413VNPXTLPbW0ilSc2H8x2iZTIVKfd33oSO6NhXPtSYQgfecEF4BvNHY5c4 +HovjT4mckbK95bcBzoCHu43vuSQkmZzdYo/ydSZt6zoPavbBLueTpgSbdXiDi827 +MVqOsYxGCb+kez0FoDSTgw== +-----END DSA PRIVATE KEY----- +-----BEGIN CERTIFICATE REQUEST----- +MIICUjCCAhECAQAwUjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx +ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDELMAkGA1UEAxMCQ0Ew +ggG0MIIBKQYFKw4DAgwwggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaW +sxXgUy6P4FmCc5A+dTGZR3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5m +rmuINvvsKNzC16W75Sw5JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHk +cJVbUM1JAhUA9wcx7fpsBgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVo +bzDjaeHls12YuyiGSPzemQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqR +CZ228U2cVA9YBu5JdAfOVX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxB +F5WS6wG1c6Vqftgy7Q4CuAOBhAACgYAapll6iqz9XrZFlk2GCVcB+KihxWnH7IuH +vSLw9YUrJahcBHmbpvt494lF4gC5w3WPM+vXJofbusk4GoQEEsQNMDaah4m49uUq +AylOVFJJJXuirVJ+o+0TtOFDITEAl+YZZariXOD7tdOSOl9RLMPC6+daHKS9e68u +3enxhqnDGaAAMAkGBSsOAwIbBQADMAAwLQIVAJGVuFsG/0DBuSZ0jF7ypdU0/G0v +AhQfeF5BoMMDbX/kidUVpQ6gadPlZA== +-----END CERTIFICATE REQUEST----- +-----BEGIN CERTIFICATE----- +MIIBrjCCAWwCAQswCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK +U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww +CgYDVQQDEwNQQ0EwHhcNOTcwNjE1MDIxNDI5WhcNOTcwNzE1MDIxNDI5WjBSMQsw +CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu +ZXQgV2lkZ2l0cyBQdHkgTHRkMQswCQYDVQQDEwJDQTCBkjAJBgUrDgMCDAUAA4GE +AAKBgBqmWXqKrP1etkWWTYYJVwH4qKHFacfsi4e9IvD1hSslqFwEeZum+3j3iUXi +ALnDdY8z69cmh9u6yTgahAQSxA0wNpqHibj25SoDKU5UUkkle6KtUn6j7RO04UMh +MQCX5hllquJc4Pu105I6X1Esw8Lr51ocpL17ry7d6fGGqcMZMAkGBSsOAwIbBQAD +MQAwLgIVAJ4wtQsANPxHo7Q4IQZYsL12SKdbAhUAjJ9n38zxT+iai2164xS+LIfa +C1Q= +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/dsa-pca.pem b/sample-app/protex_tutorial/OpenSSL/dsa-pca.pem new file mode 100644 index 0000000..e3641ad --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/dsa-pca.pem @@ -0,0 +1,49 @@ +-----BEGIN DSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,F80EEEBEEA7386C4 + +GZ9zgFcHOlnhPoiSbVi/yXc9mGoj44A6IveD4UlpSEUt6Xbse3Fr0KHIUyQ3oGnS +mClKoAp/eOTb5Frhto85SzdsxYtac+X1v5XwdzAMy2KowHVk1N8A5jmE2OlkNPNt +of132MNlo2cyIRYaa35PPYBGNCmUm7YcYS8O90YtkrQZZTf4+2C4kllhMcdkQwkr +FWSWC8YOQ7w0LHb4cX1FejHHom9Nd/0PN3vn3UyySvfOqoR7nbXkrpHXmPIr0hxX +RcF0aXcV/CzZ1/nfXWQf4o3+oD0T22SDoVcZY60IzI0oIc3pNCbDV3uKNmgekrFd +qOUJ+QW8oWp7oefRx62iBfIeC8DZunohMXaWAQCU0sLQOR4yEdeUCnzCSywe0bG1 +diD0KYaEe+Yub1BQH4aLsBgDjardgpJRTQLq0DUvw0/QGO1irKTJzegEDNVBKrVn +V4AHOKT1CUKqvGNRP1UnccUDTF6miOAtaj/qpzra7sSk7dkGBvIEeFoAg84kfh9h +hVvF1YyzC9bwZepruoqoUwke/WdNIR5ymOVZ/4Liw0JdIOcq+atbdRX08niqIRkf +dsZrUj4leo3zdefYUQ7w4N2Ns37yDFq7 +-----END DSA PRIVATE KEY----- +-----BEGIN CERTIFICATE REQUEST----- +MIICVTCCAhMCAQAwUzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx +ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEMMAoGA1UEAxMDUENB +MIIBtTCCASkGBSsOAwIMMIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2G +lrMV4FMuj+BZgnOQPnUxmUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7O +Zq5riDb77Cjcwtelu+UsOSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR +5HCVW1DNSQIVAPcHMe36bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnl +aG8w42nh5bNdmLsohkj83pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6 +kQmdtvFNnFQPWAbuSXQHzlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15Als +QReVkusBtXOlan7YMu0OArgDgYUAAoGBAKbtuR5AdW+ICjCFe2ixjUiJJzM2IKwe +6NZEMXg39+HQ1UTPTmfLZLps+rZfolHDXuRKMXbGFdSF0nXYzotPCzi7GauwEJTZ +yr27ZZjA1C6apGSQ9GzuwNvZ4rCXystVEagAS8OQ4H3D4dWS17Zg31ICb5o4E5r0 +z09o/Uz46u0VoAAwCQYFKw4DAhsFAAMxADAuAhUArRubTxsbIXy3AhtjQ943AbNB +nSICFQCu+g1iW3jwF+gOcbroD4S/ZcvB3w== +-----END CERTIFICATE REQUEST----- +-----BEGIN CERTIFICATE----- +MIIC0zCCApECAQAwCQYFKw4DAhsFADBTMQswCQYDVQQGEwJBVTETMBEGA1UECBMK +U29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMQww +CgYDVQQDEwNQQ0EwHhcNOTcwNjE0MjI1NDQ1WhcNOTcwNzE0MjI1NDQ1WjBTMQsw +CQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50ZXJu +ZXQgV2lkZ2l0cyBQdHkgTHRkMQwwCgYDVQQDEwNQQ0EwggG1MIIBKQYFKw4DAgww +ggEeAoGBAKc/boW/QWopffCfRxkwkJoJHdpqMx7FPYaWsxXgUy6P4FmCc5A+dTGZ +R3pS+4Xk2aZ7OJtoioSbh8YetX6GS1NbWc9xZRmIbs5mrmuINvvsKNzC16W75Sw5 +JkvamnAYlTeVEFYj9hXtugRe3jlP/bdDH7WkZW/NgBHkcJVbUM1JAhUA9wcx7fps +BgPVhYocrJxl51BmZW8CgYBN30wDppGK9RlvUEYlmeVobzDjaeHls12YuyiGSPze +mQQ/X4gMnHMkDSBduSqaPxiWJ+Rih8F7dGJT/GEnqHqRCZ228U2cVA9YBu5JdAfO +VX4jzhb2ytxaYQF+yXG1TfbcNCmHaPZeIJOz2/XkCWxBF5WS6wG1c6Vqftgy7Q4C +uAOBhQACgYEApu25HkB1b4gKMIV7aLGNSIknMzYgrB7o1kQxeDf34dDVRM9OZ8tk +umz6tl+iUcNe5EoxdsYV1IXSddjOi08LOLsZq7AQlNnKvbtlmMDULpqkZJD0bO7A +29nisJfKy1URqABLw5DgfcPh1ZLXtmDfUgJvmjgTmvTPT2j9TPjq7RUwCQYFKw4D +AhsFAAMxADAuAhUAvtv6AkMolix1Jvy3UnVEIUqdCUICFQC+jq8P49mwrY9oJ24n +5rKUjNBhSg== +-----END CERTIFICATE----- + diff --git a/sample-app/protex_tutorial/OpenSSL/dsa1024.pem b/sample-app/protex_tutorial/OpenSSL/dsa1024.pem new file mode 100644 index 0000000..082dec3 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/dsa1024.pem @@ -0,0 +1,9 @@ +-----BEGIN DSA PARAMETERS----- +MIIBHgKBgQCnP26Fv0FqKX3wn0cZMJCaCR3aajMexT2GlrMV4FMuj+BZgnOQPnUx +mUd6UvuF5NmmezibaIqEm4fGHrV+hktTW1nPcWUZiG7OZq5riDb77Cjcwtelu+Us +OSZL2ppwGJU3lRBWI/YV7boEXt45T/23Qx+1pGVvzYAR5HCVW1DNSQIVAPcHMe36 +bAYD1YWKHKycZedQZmVvAoGATd9MA6aRivUZb1BGJZnlaG8w42nh5bNdmLsohkj8 +3pkEP1+IDJxzJA0gXbkqmj8YlifkYofBe3RiU/xhJ6h6kQmdtvFNnFQPWAbuSXQH +zlV+I84W9srcWmEBfslxtU323DQph2j2XiCTs9v15AlsQReVkusBtXOlan7YMu0O +Arg= +-----END DSA PARAMETERS----- diff --git a/sample-app/protex_tutorial/OpenSSL/dsa512.pem b/sample-app/protex_tutorial/OpenSSL/dsa512.pem new file mode 100644 index 0000000..5f86d1a --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/dsa512.pem @@ -0,0 +1,6 @@ +-----BEGIN DSA PARAMETERS----- +MIGdAkEAnRtpjibb8isRcBmG9hnI+BnyGFOURgbQYlAzSwI8UjADizv5X9EkBk97 +TLqqQJv9luQ3M7stWtdaEUBmonZ9MQIVAPtT71C0QJIxVoZTeuiLIppJ+3GPAkEA +gz6I5cWJc847bAFJv7PHnwrqRJHlMKrZvltftxDXibeOdPvPKR7rqCxUUbgQ3qDO +L8wka5B33qJoplISogOdIA== +-----END DSA PARAMETERS----- diff --git a/sample-app/protex_tutorial/OpenSSL/dsap.pem b/sample-app/protex_tutorial/OpenSSL/dsap.pem new file mode 100644 index 0000000..d4dfdb3 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/dsap.pem @@ -0,0 +1,6 @@ +-----BEGIN DSA PARAMETERS----- +MIGcAkEA+ZiKEvZmc9MtnaFZh4NiZ3oZS4J1PHvPrm9MXj5ntVheDPkdmBDTncya +GAJcMjwsyB/GvLDGd6yGCw/8eF+09wIVAK3VagOxGd/Q4Af5NbxR5FB7CXEjAkA2 +t/q7HgVLi0KeKvcDG8BRl3wuy7bCvpjgtWiJc/tpvcuzeuAayH89UofjAGueKjXD +ADiRffvSdhrNw5dkqdql +-----END DSA PARAMETERS----- diff --git a/sample-app/protex_tutorial/OpenSSL/pca-key.pem b/sample-app/protex_tutorial/OpenSSL/pca-key.pem new file mode 100644 index 0000000..20029ab --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/pca-key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg +wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ +vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB +AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc +z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz +xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7 +HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD +yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS +xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj +7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG +h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL +QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q +hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc= +-----END RSA PRIVATE KEY----- diff --git a/sample-app/protex_tutorial/OpenSSL/pca-req.pem b/sample-app/protex_tutorial/OpenSSL/pca-req.pem new file mode 100644 index 0000000..33f1553 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/pca-req.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBmjCCAQMCAQAwXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx +GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAo +MTAyNCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfj +Irkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUX +MRsp22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3 +vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAEzz +IG8NnfpnPTQSCN5zJhOfy6p9AcDyQzuJirYv1HR/qoYWalPh/U2uiK0lAim7qMcv +wOlK3I7A8B7/4dLqvIqgtUj9b1WT8zIrnwdvJI4osLI2BY+c1pVlp174DHLMol1L +Cl1e3N5BTm7lCitTYjuUhsw6hiA8IcdNKDo6sktV +-----END CERTIFICATE REQUEST----- diff --git a/sample-app/protex_tutorial/OpenSSL/privkey.pem b/sample-app/protex_tutorial/OpenSSL/privkey.pem new file mode 100644 index 0000000..0af4647 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/privkey.pem @@ -0,0 +1,18 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,BA26229A1653B7FF + +6nhWG8PKhTPO/s3ZvjUa6226NlKdvPDZFsNXOOoSUs9ejxpb/aj5huhs6qRYzsz9 +Year47uaAZYhGD0vAagnNiBnYmjWEpN9G/wQxG7pgZThK1ZxDi63qn8aQ8UjuGHo +F6RpnnBQIAnWTWqr/Qsybtc5EoNkrj/Cpx0OfbSr6gZsFBCxwX1R1hT3/mhJ45f3 +XMofY32Vdfx9/vtw1O7HmlHXQnXaqnbd9/nn1EpvFJG9+UjPoW7gV4jCOLuR4deE +jS8hm+cpkwXmFtk3VGjT9tQXPpMv3JpYfBqgGQoMAJ5Toq0DWcHi6Wg08PsD8lgy +vmTioPsRg+JGkJkJ8GnusgLpQdlQJbjzd7wGE6ElUFLfOxLo8bLlRHoriHNdWYhh +JjY0LyeTkovcmWxVjImc6ZyBz5Ly4t0BYf1gq3OkjsV91Q1taBxnhiavfizqMCAf +PPB3sLQnlXG77TOXkNxpqbZfEYrVZW2Nsqqdn8s07Uj4IMONZyq2odYKWFPMJBiM +POYwXjMAOcmFMTHYsVlhcUJuV6LOuipw/FEbTtPH/MYMxLe4zx65dYo1rb4iLKLS +gMtB0o/Wl4Xno3ZXh1ucicYnV2J7NpVcjVq+3SFiCRu2SrSkZHZ23EPS13Ec6fcz +8X/YGA2vTJ8MAOozAzQUwHQYvLk7bIoQVekqDq4p0AZQbhdspHpArCk0Ifqqzg/v +Uyky/zZiQYanzDenTSRVI/8wac3olxpU8QvbySxYqmbkgq6bTpXJfYFQfnAttEsC +dA4S5UFgyOPZluxCAM4yaJF3Ft6neutNwftuJQMbgCUi9vYg2tGdSw== +-----END RSA PRIVATE KEY----- diff --git a/sample-app/protex_tutorial/OpenSSL/req.pem b/sample-app/protex_tutorial/OpenSSL/req.pem new file mode 100644 index 0000000..5537df6 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/req.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBlzCCAVcCAQAwXjELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUx +ITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEXMBUGA1UEAxMORXJp +YyB0aGUgWW91bmcwge8wgaYGBSsOAwIMMIGcAkEA+ZiKEvZmc9MtnaFZh4NiZ3oZ +S4J1PHvPrm9MXj5ntVheDPkdmBDTncyaGAJcMjwsyB/GvLDGd6yGCw/8eF+09wIV +AK3VagOxGd/Q4Af5NbxR5FB7CXEjAkA2t/q7HgVLi0KeKvcDG8BRl3wuy7bCvpjg +tWiJc/tpvcuzeuAayH89UofjAGueKjXDADiRffvSdhrNw5dkqdqlA0QAAkEAtUSo +84OekjitKGVjxLu0HvXck29pu+foad53vPKXAsuJdACj88BPqZ91Y9PIJf1GUh38 +CuiHWi7z3cEDfZCyCKAAMAkGBSsOAwIbBQADLwAwLAIUTg8amKVBE9oqC5B75dDQ +Chy3LdQCFHKodGEj3LjuTzdm/RTe2KZL9Uzf +-----END CERTIFICATE REQUEST----- diff --git a/sample-app/protex_tutorial/OpenSSL/rsa8192.pem b/sample-app/protex_tutorial/OpenSSL/rsa8192.pem new file mode 100644 index 0000000..946a6e5 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/rsa8192.pem @@ -0,0 +1,101 @@ +-----BEGIN RSA PRIVATE KEY----- + +MIISKAIBAAKCBAEAiQ2f1X6Bte1DKD0OoCBKEikzPW+5w3oXk3WwnE97Wxzy6wJZ +ebbZC3CZKKBnJeBMrysPf+lK+9+fP6Vm8bp1wvbcSIA59BDrX6irFSuM/bdnkbuF +MFlDjt+uVrxwoyqfPi2IPot1HQg3l5mdyBqcTWvbOnU2L9HZxJfPUCjfzdTMPrMY +55/A20XL7tlV2opEfwhy3uVlveQBM0DnZ3MUQfrk+lRRNWv7yE4ScbOfER9fjvOm +yJc3ZbOa3e+AMGGU9OqJ/fyOl0SGYyP2k23omy/idBV4uOs8QWdnAvq8UOzDdua3 +tuf5Tn17XBurPJ8juwyPBNispkwwn8BjxAZVPhwUIcxFBg339IxJ9cW0WdVy4nNA +LWo/8Ahlf+kZNnFNGCPFytU9gGMLMhab9w/rLrwa9qNe4L8Fmu1JxONn1WfhMOKE +aFmycf2olJsYLgUIGYZrjnYu0p/7P3yhTOv8JIhmK+SzmA/I0xiQoF84rpaQzH2d +PvxICOA9oQSowou0gLuBSZWm6LiXirg1DZCziU46v33ErQlWM1dSyNaUSzihcV59 +mVD0nmzboXH75lGiyiZlp8cLbozzoCwvk9rYqpUGSBzbAy0ECCpabGpzO2Ug+oDi +71e5z4WMpeoR4IS8MaOG/GsJnwaXhiB/gNYfK+8pRADVk5StEAZDE2alSuCbDs0z +d9zYr4/em5T9VZsLetxRE7pm/Es9yELuViz8/Tm0/8MVdmNYc/xZU1t6qYYFdyQ2 +wlGDTiNPsjR8yXCkmBjKwqnuleu1X6LaZu3VPhEkXGcyFAquQUkSiMv0Yu74qAe0 +bQ2v+jjZzP6AM9LUo89cW4Kd8SGD96BdNlAVPNMXoBcIOsZBwsOtETBd4KAyvkXE +Ob17u+PLl4UPnSxm9ypKZunUNFRPxtKUyjySYnvlGL+kTjAXrIrZwKJqIn0uhnfa +Ck3o7bU6yVMK22ODxy2/Vi3E0P6k5JLwnrF0VIOBqGhts66qo6mWDP8l6MZHARFd +pU+nofssVmr8tLKmMmjYGMM5GmKIXRNBs0ksTwFnKRs9AmpE5owC8tTSVdTAkGuS +os7QwLvyvNzq7BGJiVr0Iy3Dhsl1vzR35acNOrCsDl3DcCQONKJ2sVXV4pD3dBah +mG3sR/jHgjasffJJ35uiGoAua9dbT7HG/+D0z1SHYaVqH8zO4VZSOnGJh/P9rtxx +cckFDbiag/JMWig2lbnCjebTtp/BcUsK3TNaDOb7vb0LvbAeRJadd1EFu6PSlH3K +LykSUPm4UedvUU3cWjqkSY5lITFJkVaIYOv/EljYtK7p7kFZFTaEwMAWxgsXU3pQ +tTzVmq1gZ4vXPwcUq0zK50Frq0F7SQc21ZsunwIDAQABAoIEADuQAkDEpBausJsS +PgL1RXuzECPJJJCBxTE+2qx0FoY4hJICCWTORHGmU8nGPE3Ht0wBiNDsULw6KXl9 +psmzYW6D3qRbpdQebky6fu/KZ5H0XTyGpJGomaXELH5hkwo2gdKB805LSXB+m7p0 +9o96kSdMkpBLVGtf5iZ8W4rY2LsZmlI9f7taQHSLVt/M8HTz1mTnBRU92QO3zZW6 +xVa+OrWaFl18u3ZeIaSh2X40tBK68cqstXVD0r2OWuXNKobcQeJW8/XABzBShZ0c +ihL0lzyqiN4uXrLu+Nbr22b+FU2OODy6dGk3U6/69NvI4piMCPlHsfhHOnFjd1ZW +RIVywyUlCtLNdcn11CchuRro+0J3c2Ba+i9Cl9r3qzT11xFEGF8/XLyUBBCB+uGf +1dR/xJQhCA7cXWWLXyI/semxcvTaGpImP6kiIl1MAjHjXZTSdvyw4JmfXyYGhSjI +P0mw3Xn7FXxJ/os9gOfNKz2nZHjr0q4sgWRYO+4vllkeL0GteZrg4oVaVpmZb7LH +77afhodLylhijlEtV5skfkPujbBLQk6E5Ez3U/huEt2NLg6guADmwxMxfBRliZO4 +4Ex/td4cuggpEj3FGJV74qRvdvj/MF/uF7IxC/3WapPIsFBFH4zrJsUYt6u3L68I +/KC/bfioDeUR/8ANw1DNh+UsnPV3GJIwDkIJKdppi2uXPahJyJQQ8Inps53nn8Gg +GifS+HnOXNgMoKOJnZ9IDGjXpfjIs8dJNrGfDHF0mH30N2WARq2v/a3cNUC+f8Bq +HSKQ9YrZopktMunsut8u7ZYbTmjIqJpXCaM0CCrSlzSMTDHFSj2tzLk6+qnxeGxB +ZwIdShbdeK+0ETG91lE1e9RPQs/uXQP9+uCHJV0YpqQcA6pkCLYJfYpoSMu/Bafy +AgfVZz6l5tyEnV0wCcbopsQShc1k9xtTbYNF1h9AQHknj6zeDW4iZMvmVeh3RovT +52OA2R8oLyauF+QaG6x2wUjEx13SJlaBarJZ4seZIOJ+a8+oNzKsbgokXc2cyC9p +5FAZz1OsOb68o93qD1Xvl7bY97fq2q55L7G1XHPPLtZE5lGiLGDtnAuwY8UPrdpr +7Mv2yIxB7xVGurXyHb5PvusR88XED6HMPfLBG/55ENHTal7G5mRix+IWSBAIkxA5 +KZ0j8r5Ng4+wELZhqFQai39799bIAyiV6CEz4kyDXlo0kSSexp8o4iz5sPq5vp6h +cCb7rdRw7uRnbXrHmXahxoB+ibXaurgV/6B2yurrU/UFoxEp2sHp8LXZGfF6ztY1 +dMhSQAACK2vGy5yNagbkTHLgVaHicG5zavJBqzCE+lbPlCqhOUQPdOIwvjHNjdS/ +DL3WV/ECggIBAMbW65wPk/i43nSyeZeYwcHtR1SUJqDXavYfBPC0VRhKz+7DVMFw +Nwnocn6gITABc445W1yl7U3uww+LGuDlSlFnd8WuiXpVYud9/jeNu6Mu4wvNsnWr +f4f4ua8CcS03GmqmcbROD2Z6by1AblCZ2UL1kv9cUX1FLVjPP1ESAGKoePt3BmZQ +J1uJfK8HilNT8dcUlj/5CBi2uHxttDhoG0sxXE/SVsG9OD/Pjme0mj7gdzc6Ztd+ +TALuvpNQR4pRzfo5XWDZBcEYntcEE3PxYJB1+vnZ8509ew5/yLHTbLjFxIcx71zY +fhH0gM36Sz7mz37r0+E/QkRkc5bVIDC4LDnWmjpAde6QUx0d218ShNx6sJo4kt5c +Dd7tEVx8nuX8AIZYgwsOb382anLyFRkkmEdK3gRvwQ6SWR36Ez5L7/mHWODpLAX5 +mVBKSG4/ccFbc633/g0xHw0Nwajir/klckdakuYPlwF0yAxJSKDLhmNctDhRmxjC +YP+fISkl5oTvFRzJH6HEyNu8M3ybRvmpPIjM5J5JpnB2IYbohYBR+T6/97C1DKrd +mzL5PjlrWm0c1/d7LlDoP65fOShDMmj2zCiBAHHOM0Alokx+v5LmMd8NJumZIwGJ +Rt5OpeMOhowz6j1AjYxYgV7PmJL6Ovpfb775od/aLaUbbwHz2uWIvfF7AoICAQCw +c7NaO7oJVLJClhYw6OCvjT6oqtgNVWaennnDiJgzY9lv5HEgV0MAG0eYuB3hvj+w +Y1P9DJxP1D+R+cshYrAFg8yU/3kaYVNI0Bl3ygX0eW1b/0HZTdocs+8kM/9PZQDR +WrKQoU5lHvqRt99dXlD4NWGI2YQtzdZ8iet9QLqnjwRZabgE96mF01qKisMnFcsh +KjT7ieheU4J15TZj/mdZRNK126d7e3q/rNj73e5EJ9tkYLcolSr4gpknUMJULSEi +JH1/Qx7C/mTAMRsN5SkOthnGq0djCNWfPv/3JV0H67Uf5krFlnwLebrgfTYoPPdo +yO7iBUNJzv6Qh22malLp4P8gzACkD7DGlSTnoB5cLwcjmDGg+i9WrUBbOiVTeQfZ +kOj1o+Tz35ndpq/DDUVlqliB9krcxva+QHeJPH53EGI+YVg1nD+s/vUDZ3mQMGX9 +DQou2L8uU6RnWNv/BihGcL8QvS4Ty6QyPOUPpD3zc70JQAEcQk9BxQNaELgJX0IN +22cYn22tYvElew9G41OpDqzBRcfbdJmKXQ2HcroShutYJQRGUpAXHk24fy6JVkIU +ojF5U6cwextMja1ZIIZgh9eugIRUeIE7319nQNDzuXWjRCcoBLA25P7wnpHWDRpz +D9ovXCIvdja74lL5psqobV6L5+fbLPkSgXoImKR0LQKCAgAIC9Jk8kxumCyIVGCP +PeM5Uby9M3GMuKrfYsn0Y5e97+kSJF1dpojTodBgR2KQar6eVrvXt+8uZCcIjfx8 +dUrYmHNEUJfHl4T1ESgkX1vkcpVFeQFruZDjk7EP3+1sgvpSroGTZkVBRFsTXbQZ +FuCv0Pgt1TKG+zGmklxhj3TsiRy8MEjWAxBUp++ftZJnZNI4feDGnfEx7tLwVhAg +6DWSiWDO6hgQpvOLwX5lu+0x9itc1MQsnDO/OqIDnBAJDN5k7cVVkfKlqbVjxgpz +eqUJs3yAd81f44kDQTCB4ahYocgeIGsrOqd/WoGL1EEPPo/O9wQP7VtlIRt8UwuG +bS18+a4sBUfAa56xYu/pnPo7YcubsgZfcSIujzFQqMpVTClJRnOnEuJ4J1+PXzRz +XAO9fs4VJ+CMEmgAyonUz4Xadxulnknlw//sO9VKgM69oFHCDHL/XamAAbqAdwvf +7R/+uy+Ol7romC0wMhb6SsIZazrvvH2mNtduAKZ638nAP1x/WbQp+6iVG7yJok7w +82Q7tO7baOePTXh12Rrt4mNPor0HLYxhra4GFgfqkumJ2Mz0esuZAozxJXFOq8ly +beo9CVtXP5zbT6qNpeNismX6PLICaev8t+1iOZSE56WSLtefuuj/cOVrTMNDz1Rr +pUkEVV2zjUSjlcScM538A9iL2QKCAgBLbBk0r6T0ihRsK9UucMxhnYEz/Vq+UEu9 +70Vi1AciqEJv9nh4d3Q3HnH7EHANZxG4Jqzm1DYYVUQa9GfkTFeq88xFv/GW2hUM +YY8RSfRDrIeXNEOETCe37x2AHw25dRXlZtw+wARPau91y9+Y/FCl18NqCHfcUEin +ERjsf/eI2bPlODAlR2tZvZ7M60VBdqpN8cmV3zvI3e88z43xLfQlDyr1+v7a5Evy +lEJnXlSTI2o+vKxtl103vjMSwA1gh63K90gBVsJWXQDZueOzi8mB9UqNRfcMmOEe +4YHttTXPxeu0x+4cCRfam9zKShsVFgI28vRQ/ijl6qmbQ5gV8wqf18GV1j1L4z0P +lP6iVynDA4MMrug/w9DqPsHsfK0pwekeETfSj4y0xVXyjWZBfHG2ZBrS6mDTf+RG +LC4sJgR0hjdILLnUqIX7PzuhieBHRrjBcopwvcryVWRHnI7kslAS0+yHjiWc5oW3 +x5mtlum4HzelNYuD9cAE/95P6CeSMfp9CyIE/KSX4VvsRm6gQVkoQRKMxnQIFQ3w +O5gl1l88vhjoo2HxYScgCp70BsDwiUNTqIR3NM+ZBHYFweVf3Gwz5LzHZT2rEZtD +6VXRP75Q/2wOLnqCO4bK4BUs6sqxcQZmOldruPkPynrY0oPfHHExjxZDvQu4/r80 +Ls3n0L8yvQKCAgEAnYWS6EikwaQNpJEfiUnOlglgFz4EE1eVkrDbBY4J3oPU+doz +DrqmsvgpSZIAfd2MUbkN4pOMsMTjbeIYWDnZDa1RoctKs3FhwFPHwAjQpznab4mn +Bp81FMHM40qyb0NaNuFRwghdXvoQvBBX1p8oEnFzDRvTiuS/vTPTA8KDY8IeRp8R +oGzKHpfziNwq/URpqj7pwi9odNjGZvR2IwYw9jCLPIqaEbMoSOdI0mg4MoYyqP4q +nm7d4wqSDwrYxiXZ6f3nYpkhEY1lb0Wbksp1ig8sKSF4nDZRGK1RSfE+6gjBp94H +X/Wog6Zb6NC9ZpusTiDLvuIUXcyUJvmHiWjSNqiTv8jurlwEsgSwhziEQfqLrtdV +QI3PRMolBkD1iCk+HFE53r05LMf1bp3r4MS+naaQrLbIrl1kgDNGwVdgS+SCM7Bg +TwEgE67iOb2iIoUpon/NyP4LesMzvdpsu2JFlfz13PmmQ34mFI7tWvOb3NA5DP3c +46C6SaWI0TD9B11nJbHGTYN3Si9n0EBgoDJEXUKeh3km9O47dgvkSug4WzhYsvrE +rMlMLtKfp2w8HlMZpsUlToNCx6CI+tJrohzcs3BAVAbjFAXRKWGijB1rxwyDdHPv +I+/wJTNaRNPQ1M0SwtEL/zJd21y3KSPn4eL+GP3efhlDSjtlDvZqkdAUsU8= +-----END RSA PRIVATE KEY----- + diff --git a/sample-app/protex_tutorial/OpenSSL/s1024key.pem b/sample-app/protex_tutorial/OpenSSL/s1024key.pem new file mode 100644 index 0000000..19e0403 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/s1024key.pem @@ -0,0 +1,15 @@ +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQCzEfU8E+ZGTGtHXV5XhvM2Lg32fXUIjydXb34BGVPX6oN7+aNV +S9eWayvW/+9/vUb0aCqilJrpFesgItV2T8VhhjOE++XUz46uNpcMU7wHMEAXUufP +pztpFm8ZEk2tFKvadkSSoN8lb11juvZVkSkPlB65pFhSe4QKSp6J4HrkYwIDAQAB +AoGBAKy8jvb0Lzby8q11yNLf7+78wCVdYi7ugMHcYA1JVFK8+zb1WfSm44FLQo/0 +dSChAjgz36TTexeLODPYxleJndjVcOMVzsLJjSM8dLpXsTS4FCeMbhw2s2u+xqKY +bbPWfk+HOTyJjfnkcC5Nbg44eOmruq0gSmBeUXVM5UntlTnxAkEA7TGCA3h7kx5E +Bl4zl2pc3gPAGt+dyfk5Po9mGJUUXhF5p2zueGmYWW74TmOWB1kzt4QRdYMzFePq +zfDNXEa1CwJBAMFErdY0xp0UJ13WwBbUTk8rujqQdHtjw0klhpbuKkjxu2hN0wwM +6p0D9qxF7JHaghqVRI0fAW/EE0OzdHMR9QkCQQDNR26dMFXKsoPu+vItljj/UEGf +QG7gERiQ4yxaFBPHgdpGo0kT31eh9x9hQGDkxTe0GNG/YSgCRvm8+C3TMcKXAkBD +dhGn36wkUFCddMSAM4NSJ1VN8/Z0y5HzCmI8dM3VwGtGMUQlxKxwOl30LEQzdS5M +0SWojNYXiT2gOBfBwtbhAkEAhafl5QEOIgUz+XazS/IlZ8goNKdDVfYgK3mHHjvv +nY5G+AuGebdNkXJr4KSWxDcN+C2i47zuj4QXA16MAOandA== +-----END RSA PRIVATE KEY----- diff --git a/sample-app/protex_tutorial/OpenSSL/s1024req.pem b/sample-app/protex_tutorial/OpenSSL/s1024req.pem new file mode 100644 index 0000000..bb75e7e --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/s1024req.pem @@ -0,0 +1,11 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBojCCAQsCAQAwZDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQx +GjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMSQwIgYDVQQDExtTZXJ2ZXIgdGVz +dCBjZXJ0ICgxMDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALMR +9TwT5kZMa0ddXleG8zYuDfZ9dQiPJ1dvfgEZU9fqg3v5o1VL15ZrK9b/73+9RvRo +KqKUmukV6yAi1XZPxWGGM4T75dTPjq42lwxTvAcwQBdS58+nO2kWbxkSTa0Uq9p2 +RJKg3yVvXWO69lWRKQ+UHrmkWFJ7hApKnongeuRjAgMBAAEwDQYJKoZIhvcNAQEE +BQADgYEAStHlk4pBbwiNeQ2/PKTPPXzITYC8Gn0XMbrU94e/6JIKiO7aArq9Espq +nrBSvC14dHcNl6NNvnkEKdQ7hAkcACfBbnOXA/oQvMBd4GD78cH3k0jVDoVUEjil +frLfWlckW6WzpTktt0ZPDdAjJCmKVh0ABHimi7Bo9FC3wIGIe5M= +-----END CERTIFICATE REQUEST----- diff --git a/sample-app/protex_tutorial/OpenSSL/s512-key.pem b/sample-app/protex_tutorial/OpenSSL/s512-key.pem new file mode 100644 index 0000000..0e3ff2d --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/s512-key.pem @@ -0,0 +1,9 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIBPAIBAAJBAJ+zw4Qnlf8SMVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVD +TGiXav6ooKXfX3j/7tdkuD8Ey2//Kv7+ue0CAwEAAQJAN6W31vDEP2DjdqhzCDDu +OA4NACqoiFqyblo7yc2tM4h4xMbC3Yx5UKMN9ZkCtX0gzrz6DyF47bdKcWBzNWCj +gQIhANEoojVt7hq+SQ6MCN6FTAysGgQf56Q3TYoJMoWvdiXVAiEAw3e3rc+VJpOz +rHuDo6bgpjUAAXM+v3fcpsfZSNO6V7kCIQCtbVjanpUwvZkMI9by02oUk9taki3b +PzPfAfNPYAbCJQIhAJXNQDWyqwn/lGmR11cqY2y9nZ1+5w3yHGatLrcDnQHxAiEA +vnlEGo8K85u+KwIOimM48ZG8oTk7iFdkqLJR1utT3aU= +-----END RSA PRIVATE KEY----- diff --git a/sample-app/protex_tutorial/OpenSSL/s512-req.pem b/sample-app/protex_tutorial/OpenSSL/s512-req.pem new file mode 100644 index 0000000..ea314be --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/s512-req.pem @@ -0,0 +1,8 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIBGzCBxgIBADBjMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEa +MBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxIzAhBgNVBAMTGlNlcnZlciB0ZXN0 +IGNlcnQgKDUxMiBiaXQpMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJ+zw4Qnlf8S +MVIPFe9GEcStgOY2Ww/dgNdhjeD8ckUJNP5VZkVDTGiXav6ooKXfX3j/7tdkuD8E +y2//Kv7+ue0CAwEAATANBgkqhkiG9w0BAQQFAANBAAB+uQi+qwn6qRSHB8EUTvsm +5TNTHzYDeN39nyIbZNX2s0se3Srn2Bxft5YCwD3moFZ9QoyDHxE0h6qLX5yjD+8= +-----END CERTIFICATE REQUEST----- diff --git a/sample-app/protex_tutorial/OpenSSL/server2.pem b/sample-app/protex_tutorial/OpenSSL/server2.pem new file mode 100644 index 0000000..8bb6641 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/server2.pem @@ -0,0 +1,376 @@ +issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) +subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Server test cert (1024 bit) +-----BEGIN CERTIFICATE----- +MIICLjCCAZcCAQEwDQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCQVUxEzARBgNV +BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYD +VQQDExJUZXN0IENBICgxMDI0IGJpdCkwHhcNOTcwNjA5MTM1NzU0WhcNOTgwNjA5 +MTM1NzU0WjBkMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFuZDEaMBgG +A1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxJDAiBgNVBAMTG1NlcnZlciB0ZXN0IGNl +cnQgKDEwMjQgYml0KTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAsxH1PBPm +RkxrR11eV4bzNi4N9n11CI8nV29+ARlT1+qDe/mjVUvXlmsr1v/vf71G9GgqopSa +6RXrICLVdk/FYYYzhPvl1M+OrjaXDFO8BzBAF1Lnz6c7aRZvGRJNrRSr2nZEkqDf +JW9dY7r2VZEpD5QeuaRYUnuECkqeieB65GMCAwEAATANBgkqhkiG9w0BAQQFAAOB +gQCWsOta6C0wiVzXz8wPmJKyTrurMlgUss2iSuW9366iwofZddsNg7FXniMzkIf6 +dp7jnmWZwKZ9cXsNUS2o4OL07qOk2HOywC0YsNZQsOBu1CBTYYkIefDiKFL1zQHh +8lwwNd4NP+OE3NzUNkCfh4DnFfg9WHkXUlD5UpxNRJ4gJA== +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIICXgIBAAKBgQCzEfU8E+ZGTGtHXV5XhvM2Lg32fXUIjydXb34BGVPX6oN7+aNV +S9eWayvW/+9/vUb0aCqilJrpFesgItV2T8VhhjOE++XUz46uNpcMU7wHMEAXUufP +pztpFm8ZEk2tFKvadkSSoN8lb11juvZVkSkPlB65pFhSe4QKSp6J4HrkYwIDAQAB +AoGBAKy8jvb0Lzby8q11yNLf7+78wCVdYi7ugMHcYA1JVFK8+zb1WfSm44FLQo/0 +dSChAjgz36TTexeLODPYxleJndjVcOMVzsLJjSM8dLpXsTS4FCeMbhw2s2u+xqKY +bbPWfk+HOTyJjfnkcC5Nbg44eOmruq0gSmBeUXVM5UntlTnxAkEA7TGCA3h7kx5E +Bl4zl2pc3gPAGt+dyfk5Po9mGJUUXhF5p2zueGmYWW74TmOWB1kzt4QRdYMzFePq +zfDNXEa1CwJBAMFErdY0xp0UJ13WwBbUTk8rujqQdHtjw0klhpbuKkjxu2hN0wwM +6p0D9qxF7JHaghqVRI0fAW/EE0OzdHMR9QkCQQDNR26dMFXKsoPu+vItljj/UEGf +QG7gERiQ4yxaFBPHgdpGo0kT31eh9x9hQGDkxTe0GNG/YSgCRvm8+C3TMcKXAkBD +dhGn36wkUFCddMSAM4NSJ1VN8/Z0y5HzCmI8dM3VwGtGMUQlxKxwOl30LEQzdS5M +0SWojNYXiT2gOBfBwtbhAkEAhafl5QEOIgUz+XazS/IlZ8goNKdDVfYgK3mHHjvv +nY5G+AuGebdNkXJr4KSWxDcN+C2i47zuj4QXA16MAOandA== +-----END RSA PRIVATE KEY----- +subject=/C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA +issuer= /C=US/O=AT&T Bell Laboratories/OU=Prototype Research CA +notBefore=950413210656Z +notAfter =970412210656Z +-----BEGIN X509 CERTIFICATE----- + +MIICCDCCAXECAQAwDQYJKoZIhvcNAQEEBQAwTjELMAkGA1UEBhMCVVMxHzAdBgNV +BAoUFkFUJlQgQmVsbCBMYWJvcmF0b3JpZXMxHjAcBgNVBAsUFVByb3RvdHlwZSBS +ZXNlYXJjaCBDQTAeFw05NTA0MTMyMTA2NTZaFw05NzA0MTIyMTA2NTZaME4xCzAJ +BgNVBAYTAlVTMR8wHQYDVQQKFBZBVCZUIEJlbGwgTGFib3JhdG9yaWVzMR4wHAYD +VQQLFBVQcm90b3R5cGUgUmVzZWFyY2ggQ0EwgZwwDQYJKoZIhvcNAQEBBQADgYoA +MIGGAoGAebOmgtSCl+wCYZc86UGYeTLY8cjmW2P0FN8ToT/u2pECCoFdrlycX0OR +3wt0ZhpFXLVNeDnHwEE9veNUih7pCL2ZBFqoIoQkB1lZmXRiVtjGonz8BLm/qrFM +YHb0lme/Ol+s118mwKVxnn6bSAeI/OXKhLaVdYZWk+aEaxEDkVkCAQ8wDQYJKoZI +hvcNAQEEBQADgYEAAZMG14lZmZ8bahkaHaTV9dQf4p2FZiQTFwHP9ZyGsXPC+LT5 +dG5iTaRmyjNIJdPWohZDl97kAci79aBndvuEvRKOjLHs3WRGBIwERnAcnY9Mz8u/ +zIHK23PjYVxGGaZd669OJwD0CYyqH22HH9nFUGaoJdsv39ChW0NRdLE9+y8= +-----END X509 CERTIFICATE----- +issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) +subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test CA (1024 bit) +-----BEGIN CERTIFICATE----- +MIICJjCCAY8CAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV +BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD +VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTc0M1oXDTAxMDYw +OTEzNTc0M1owWzELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY +BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRswGQYDVQQDExJUZXN0IENBICgxMDI0 +IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKO7o8t116VP6cgybTsZ +DCZhr95nYlZuya3aCi1IKoztqwWnjbmDFIriOqGFPrZQ+moMETC9D59iRW/dFXSv +1F65ka/XY2hLh9exCCo7XuUcDs53Qp3bI3AmMqHjgzE8oO3ajyJAzJkTTOUecQU2 +mw/gI4tMM0LqWMQS7luTy4+xAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAM7achv3v +hLQJcv/65eGEpBXM40ZDVoFQFFJWaY5p883HTqLB1x4FdzsXHH0QKBTcKpWwqyu4 +YDm3fb8oDugw72bCzfyZK/zVZPR/hVlqI/fvU109Qoc+7oPvIXWky71HfcK6ZBCA +q30KIqGM/uoM60INq97qjDmCJapagcNBGQs= +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQCju6PLddelT+nIMm07GQwmYa/eZ2JWbsmt2gotSCqM7asFp425 +gxSK4jqhhT62UPpqDBEwvQ+fYkVv3RV0r9ReuZGv12NoS4fXsQgqO17lHA7Od0Kd +2yNwJjKh44MxPKDt2o8iQMyZE0zlHnEFNpsP4COLTDNC6ljEEu5bk8uPsQIDAQAB +AoGAVZmpFZsDZfr0l2S9tLLwpjRWNOlKATQkno6q2WesT0eGLQufTciY+c8ypfU6 +hyio8r5iUl/VhhdjhAtKx1mRpiotftHo/eYf8rtsrnprOnWG0bWjLjtIoMbcxGn2 +J3bN6LJmbJMjDs0eJ3KnTu646F3nDUw2oGAwmpzKXA1KAP0CQQDRvQhxk2D3Pehs +HvG665u2pB5ipYQngEFlZO7RHJZzJOZEWSLuuMqaF/7pTfA5jiBvWqCgJeCRRInL +21ru4dlPAkEAx9jj7BgKn5TYnMoBSSe0afjsV9oApVpN1Nacb1YDtCwy+scp3++s +nFxlv98wxIlSdpwMUn+AUWfjiWR7Tu/G/wJBAJ/KjwZIrFVxewP0x2ILYsTRYLzz +MS4PDsO7FB+I0i7DbBOifXS2oNSpd3I0CNMwrxFnUHzynpbOStVfN3ZL5w0CQQCa +pwFahxBRhkJKsxhjoFJBX9yl75JoY4Wvm5Tbo9ih6UJaRx3kqfkN14L2BKYcsZgb +KY9vmDOYy6iNfjDeWTfJAkBkfPUb8oTJ/nSP5zN6sqGxSY4krc4xLxpRmxoJ8HL2 +XfhqXkTzbU13RX9JJ/NZ8vQN9Vm2NhxRGJocQkmcdVtJ +-----END RSA PRIVATE KEY----- +-----BEGIN X509 CERTIFICATE----- +MIICYDCCAiACAgEoMAkGBSsOAwINBQAwfDELMAkGA1UEBhMCVVMxNjA0BgNVBAoT +LU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZ +MBcGA1UECxMQVGVzdCBFbnZpcm9ubWVudDEaMBgGA1UECxMRRFNTLU5BU0EtUGls +b3QtQ0EwHhcNOTYwMjI2MTYzMjQ1WhcNOTcwMjI1MTYzMjQ1WjB8MQswCQYDVQQG +EwJVUzE2MDQGA1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFk +bWluaXN0cmF0aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MRowGAYDVQQL +ExFEU1MtTkFTQS1QaWxvdC1DQTCB8jAJBgUrDgMCDAUAA4HkADCB4AJBAMA/ssKb +hPNUG7ZlASfVwEJU21O5OyF/iyBzgHI1O8eOhJGUYO8cc8wDMjR508Mr9cp6Uhl/ +ZB7FV5GkLNEnRHYCQQDUEaSg45P2qrDwixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLb +bn3QK74T2IxY1yY+kCNq8XrIqf5fJJzIH0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3 +fVd0geUCQQCzCFUQAh+ZkEmp5804cs6ZWBhrUAfnra8lJItYo9xPcXgdIfLfibcX +R71UsyO77MRD7B0+Ag2tq794IleCVcEEMAkGBSsOAwINBQADLwAwLAIUUayDfreR +Yh2WeU86/pHNdkUC1IgCFEfxe1f0oMpxJyrJ5XIxTi7vGdoK +-----END X509 CERTIFICATE----- +-----BEGIN X509 CERTIFICATE----- + +MIICGTCCAdgCAwCqTDAJBgUrDgMCDQUAMHwxCzAJBgNVBAYTAlVTMTYwNAYDVQQK +Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x +GTAXBgNVBAsTEFRlc3QgRW52aXJvbm1lbnQxGjAYBgNVBAsTEURTUy1OQVNBLVBp +bG90LUNBMB4XDTk2MDUxNDE3MDE0MVoXDTk3MDUxNDE3MDE0MVowMzELMAkGA1UE +BhMCQVUxDzANBgNVBAoTBk1pbmNvbTETMBEGA1UEAxMKRXJpYyBZb3VuZzCB8jAJ +BgUrDgMCDAUAA4HkADCB4AJBAKbfHz6vE6pXXMTpswtGUec2tvnfLJUsoxE9qs4+ +ObZX7LmLvragNPUeiTJx7UOWZ5DfBj6bXLc8eYne0lP1g3ACQQDUEaSg45P2qrDw +ixTRhFhmWz5Nvc4lRFQ/42XPcchiJBLbbn3QK74T2IxY1yY+kCNq8XrIqf5fJJzI +H0J/xUP3AhUAsg2wsQHfDGYk/BOSulX3fVd0geUCQQCzCFUQAh+ZkEmp5804cs6Z +WBhrUAfnra8lJItYo9xPcXgdIfLfibcXR71UsyO77MRD7B0+Ag2tq794IleCVcEE +MAkGBSsOAwINBQADMAAwLQIUWsuuJRE3VT4ueWkWMAJMJaZjj1ECFQCYY0zX4bzM +LC7obsrHD8XAHG+ZRG== +-----END X509 CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICTTCCAbagAwIBAgIBADANBgkqhkiG9w0BAQQFADBMMQswCQYDVQQGEwJHQjEM +MAoGA1UEChMDVUNMMRgwFgYDVQQLEw9JQ0UtVEVMIFByb2plY3QxFTATBgNVBAMT +DFRydXN0RmFjdG9yeTAeFw05NzA0MjIxNDM5MTRaFw05ODA0MjIxNDM5MTRaMEwx +CzAJBgNVBAYTAkdCMQwwCgYDVQQKEwNVQ0wxGDAWBgNVBAsTD0lDRS1URUwgUHJv +amVjdDEVMBMGA1UEAxMMVHJ1c3RGYWN0b3J5MIGcMAoGBFUIAQECAgQAA4GNADCB +iQKBgQCEieR8NcXkUW1f0G6aC6u0i8q/98JqS6RxK5YmHIGKCkuTWAUjzLfUa4dt +U9igGCjTuxaDqlzEim+t/02pmiBZT9HaX++35MjQPUWmsChcYU5WyzGErXi+rQaw +zlwS73zM8qiPj/97lXYycWhgL0VaiDSPxRXEUdWoaGruom4mNQIDAQABo0IwQDAd +BgNVHQ4EFgQUHal1LZr7oVg5z6lYzrhTgZRCmcUwDgYDVR0PAQH/BAQDAgH2MA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAfaggfl6FZoioecjv0dq8 +/DXo/u11iMZvXn08gjX/zl2b4wtPbShOSY5FhkSm8GeySasz+/Nwb/uzfnIhokWi +lfPZHtlCWtXbIy/TN51eJyq04ceDCQDWvLC2enVg9KB+GJ34b5c5VaPRzq8MBxsA +S7ELuYGtmYgYm9NZOIr7yU0= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIB6jCCAZQCAgEtMA0GCSqGSIb3DQEBBAUAMIGAMQswCQYDVQQGEwJVUzE2MDQG +A1UEChMtTmF0aW9uYWwgQWVyb25hdXRpY3MgYW5kIFNwYWNlIEFkbWluaXN0cmF0 +aW9uMRkwFwYDVQQLExBUZXN0IEVudmlyb25tZW50MR4wHAYDVQQLExVNRDUtUlNB +LU5BU0EtUGlsb3QtQ0EwHhcNOTYwNDMwMjIwNTAwWhcNOTcwNDMwMjIwNTAwWjCB +gDELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu +ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEZMBcGA1UECxMQVGVzdCBFbnZpcm9ubWVu +dDEeMBwGA1UECxMVTUQ1LVJTQS1OQVNBLVBpbG90LUNBMFkwCgYEVQgBAQICAgAD +SwAwSAJBALmmX5+GqAvcrWK13rfDrNX9UfeA7f+ijyBgeFQjYUoDpFqapw4nzQBL +bAXug8pKkRwa2Zh8YODhXsRWu2F/UckCAwEAATANBgkqhkiG9w0BAQQFAANBAH9a +OBA+QCsjxXgnSqHx04gcU8S49DVUb1f2XVoLnHlIb8RnX0k5O6mpHT5eti9bLkiW +GJNMJ4L0AJ/ac+SmHZc= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIICajCCAdMCBDGA0QUwDQYJKoZIhvcNAQEEBQAwfTELMAkGA1UEBhMCQ2ExDzAN +BgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmlsaXR5IEFjY2VwdGVkMR8w +HQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRwwGgYDVQQDExNFbnRydXN0 +IERlbW8gV2ViIENBMB4XDTk2MDQyNjEzMzUwMVoXDTA2MDQyNjEzMzUwMVowfTEL +MAkGA1UEBhMCQ2ExDzANBgNVBAcTBk5lcGVhbjEeMBwGA1UECxMVTm8gTGlhYmls +aXR5IEFjY2VwdGVkMR8wHQYDVQQKExZGb3IgRGVtbyBQdXJwb3NlcyBPbmx5MRww +GgYDVQQDExNFbnRydXN0IERlbW8gV2ViIENBMIGdMA0GCSqGSIb3DQEBAQUAA4GL +ADCBhwKBgQCaroS7O1DA0hm4IefNYU1cx/nqOmzEnk291d1XqznDeF4wEgakbkCc +zTKxK791yNpXG5RmngqH7cygDRTHZJ6mfCRn0wGC+AI00F2vYTGqPGRQL1N3lZT0 +YDKFC0SQeMMjFIZ1aeQigroFQnHo0VB3zWIMpNkka8PY9lxHZAmWwQIBAzANBgkq +hkiG9w0BAQQFAAOBgQBAx0UMVA1s54lMQyXjMX5kj99FJN5itb8bK1Rk+cegPQPF +cWO9SEWyEjjBjIkjjzAwBkaEszFsNGxemxtXvwjIm1xEUMTVlPEWTs2qnDvAUA9W +YqhWbhH0toGT36236QAsqCZ76rbTRVSSX2BHyJwJMG2tCRv7kRJ//NIgxj3H4w== +-----END CERTIFICATE----- + +issuer= /C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) +subject=/C=AU/ST=Queensland/O=CryptSoft Pty Ltd/CN=Test PCA (1024 bit) +-----BEGIN CERTIFICATE----- +MIICJzCCAZACAQAwDQYJKoZIhvcNAQEEBQAwXDELMAkGA1UEBhMCQVUxEzARBgNV +BAgTClF1ZWVuc2xhbmQxGjAYBgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYD +VQQDExNUZXN0IFBDQSAoMTAyNCBiaXQpMB4XDTk3MDYwOTEzNTczN1oXDTAxMDYw +OTEzNTczN1owXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY +BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy +NCBiaXQpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCdoWk/3+WcMlfjIrkg +40ketmnQaEogQe1LLcuOJV6rKfUSAsPgwgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp +22Jp85PmemiDzyUIStwk72qhp1imbANZvlmlCFKiQrjUyuDfu4TABmn+kkt3vR1Y +BEOGt+IFye1UBVSATVdRJ2UVhwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBABNA1u/S +Cg/LJZWb7GliiKJsvuhxlE4E5JxQF2zMub/CSNbF97//tYSyj96sxeFQxZXbcjm9 +xt6mr/xNLA4szNQMJ4P+L7b5e/jC5DSqlwS+CUYJgaFs/SP+qJoCSu1bR3IM9XWO +cRBpDmcBbYLkSyB92WURvsZ1LtjEcn+cdQVI +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg +wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ +vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB +AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc +z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz +xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7 +HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD +yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS +xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj +7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG +h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL +QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q +hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc= +-----END RSA PRIVATE KEY----- +subject=/C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority +issuer= /C=US/O=RSA Data Security, Inc./OU=Commercial Certification Authority +notBefore=941104185834Z +notAfter =991103185834Z +-----BEGIN X509 CERTIFICATE----- + +MIICIzCCAZACBQJBAAAWMA0GCSqGSIb3DQEBAgUAMFwxCzAJBgNVBAYTAlVTMSAw +HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVy +Y2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDQxODU4MzRaFw05 +OTExMDMxODU4MzRaMFwxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0YSBT +ZWN1cml0eSwgSW5jLjErMCkGA1UECxMiQ29tbWVyY2lhbCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCk+4Fie84QJ93o +975sbsZwmdu41QUDaSiCnHJ/lj+O7Kwpkj+KFPhCdr69XQO5kNTQvAayUTNfxMK/ +touPmbZiImDd298ggrTKoi8tUO2UMt7gVY3UaOLgTNLNBRYulWZcYVI4HlGogqHE +7yXpCuaLK44xZtn42f29O2nZ6wIDAQABMA0GCSqGSIb3DQEBAgUAA34AdrW2EP4j +9/dZYkuwX5zBaLxJu7NJbyFHXSudVMQAKD+YufKKg5tgf+tQx6sFEC097TgCwaVI +0v5loMC86qYjFmZsGySp8+x5NRhPJsjjr1BKx6cxa9B8GJ1Qv6km+iYrRpwUqbtb +MJhCKLVLU7tDCZJAuqiqWqTGtotXTcU= +-----END X509 CERTIFICATE----- +subject=/C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority +issuer= /C=US/O=RSA Data Security, Inc./OU=Secure Server Certification Authority +notBefore=941109235417Z +notAfter =991231235417Z +-----BEGIN X509 CERTIFICATE----- + +MIICKTCCAZYCBQJBAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw +HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl +IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NDExMDkyMzU0MTda +Fw05OTEyMzEyMzU0MTdaMF8xCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdSU0EgRGF0 +YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJlIFNlcnZlciBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCBmzANBgkqhkiG9w0BAQEFAAOBiQAwgYUCfgCSznrB +roM+WqqJg1esJQF2DK2ujiw3zus1eGRUA+WEQFHJv48I4oqCCNIWhjdV6bEhAq12 +aIGaBaJLyUslZiJWbIgHj/eBWW2EB2VwE3F2Ppt3TONQiVaYSLkdpykaEy5KEVmc +HhXVSVQsczppgrGXOZxtcGdI5d0t1sgeewIDAQABMA0GCSqGSIb3DQEBAgUAA34A +iNHReSHO4ovo+MF9NFM/YYPZtgs4F7boviGNjwC4i1N+RGceIr2XJ+CchcxK9oU7 +suK+ktPlDemvXA4MRpX/oRxePug2WHpzpgr4IhFrwwk4fia7c+8AvQKk8xQNMD9h +cHsg/jKjn7P0Z1LctO6EjJY2IN6BCINxIYoPnqk= +-----END X509 CERTIFICATE----- +subject=/C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc + /OU=Certification Services Division/CN=Thawte Server CA + /Email=server-certs@thawte.com +issuer= /C=ZA/SP=Western Cape/L=Cape Town/O=Thawte Consulting cc + /OU=Certification Services Division/CN=Thawte Server CA + /Email=server-certs@thawte.com +-----BEGIN CERTIFICATE----- +MIIC+TCCAmICAQAwDQYJKoZIhvcNAQEEBQAwgcQxCzAJBgNVBAYTAlpBMRUwEwYD +VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU +VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy +dmljZXMgRGl2aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkq +hkiG9w0BCQEWF3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMB4XDTk2MDcyNzE4MDc1 +N1oXDTk4MDcyNzE4MDc1N1owgcQxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0 +ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMUVGhhd3RlIENv +bnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 +aXNpb24xGTAXBgNVBAMTEFRoYXd0ZSBTZXJ2ZXIgQ0ExJjAkBgkqhkiG9w0BCQEW +F3NlcnZlci1jZXJ0c0B0aGF3dGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB +iQKBgQDTpFBuyP9Wa+bPXbbqDGh1R6KqwtqEJfyo9EdR2oW1IHSUhh4PdcnpCGH1 +Bm0wbhUZAulSwGLbTZme4moMRDjN/r7jZAlwxf6xaym2L0nIO9QnBCUQly/nkG3A +KEKZ10xD3sP1IW1Un13DWOHA5NlbsLjctHvfNjrCtWYiEtaHDQIDAQABMA0GCSqG +SIb3DQEBBAUAA4GBAIsvn7ifX3RUIrvYXtpI4DOfARkTogwm6o7OwVdl93yFhDcX +7h5t0XZ11MUAMziKdde3rmTvzUYIUCYoY5b032IwGMTvdiclK+STN6NP2m5nvFAM +qJT5gC5O+j/jBuZRQ4i0AMYQr5F4lT8oBJnhgafw6PL8aDY2vMHGSPl9+7uf +-----END CERTIFICATE----- + +-----BEGIN CERTIFICATE----- +MIIDDTCCAnYCAQAwDQYJKoZIhvcNAQEEBQAwgc4xCzAJBgNVBAYTAlpBMRUwEwYD +VQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU +VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2Vy +dmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBD +QTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTAeFw05 +NjA3MjcxODA3MTRaFw05ODA3MjcxODA3MTRaMIHOMQswCQYDVQQGEwJaQTEVMBMG +A1UECBMMV2VzdGVybiBDYXBlMRIwEAYDVQQHEwlDYXBlIFRvd24xHTAbBgNVBAoT +FFRoYXd0ZSBDb25zdWx0aW5nIGNjMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNl +cnZpY2VzIERpdmlzaW9uMSEwHwYDVQQDExhUaGF3dGUgUHJlbWl1bSBTZXJ2ZXIg +Q0ExKDAmBgkqhkiG9w0BCQEWGXByZW1pdW0tc2VydmVyQHRoYXd0ZS5jb20wgZ8w +DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANI2NmqL18JbntqBQWKPOO5JBFXW0O8c +G5UWR+8YSDU6UvQragaPOy/qVuOvho2eF/eetGV1Ak3vywmiIVHYm9Bn0LoNkgYU +c9STy5cqAJxcTgy8+hVS/PJEbtoRSm4Iny8t4/mqOoZztkZTWMiJBb2DEbhzP6oH +jfRCTedAnRw3AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAutFIgTRZVYerIZfL9lvR +w9Eifvvo5KTZ3h+Bj+VzNnyw4Qc/IyXkPOu6SIiH9LQ3sCmWBdxpe+qr4l77rLj2 +GYuMtESFfn1XVALzkYgC7JcPuTOjMfIiMByt+uFf8AV8x0IW/Qkuv+hEQcyM9vxK +3VZdLbCVIhNoEsysrxCpxcI= +-----END CERTIFICATE----- +Tims test GCI CA + +-----BEGIN CERTIFICATE----- +MIIB8DCCAZoCAQAwDQYJKoZIhvcNAQEEBQAwgYIxCzAJBgNVBAYTAkFVMRMwEQYD +VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 +cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2RldmVsb3BtZW50MRkwFwYDVQQDExBD +cnlwdFNvZnQgRGV2IENBMB4XDTk3MDMyMjEzMzQwNFoXDTk4MDMyMjEzMzQwNFow +gYIxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhC +cmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxFDASBgNVBAsTC2Rl +dmVsb3BtZW50MRkwFwYDVQQDExBDcnlwdFNvZnQgRGV2IENBMFwwDQYJKoZIhvcN +AQEBBQADSwAwSAJBAOAOAqogG5QwAmLhzyO4CoRnx/wVy4NZP4dxJy83O1EnL0rw +OdsamJKvPOLHgSXo3gDu9uVyvCf/QJmZAmC5ml8CAwEAATANBgkqhkiG9w0BAQQF +AANBADRRS/GVdd7rAqRW6SdmgLJduOU2yq3avBu99kRqbp9A/dLu6r6jU+eP4oOA +TfdbFZtAAD2Hx9jUtY3tfdrJOb8= +-----END CERTIFICATE----- + +-----BEGIN CERTIFICATE----- +MIICVjCCAgACAQAwDQYJKoZIhvcNAQEEBQAwgbUxCzAJBgNVBAYTAkFVMRMwEQYD +VQQIEwpRdWVlbnNsYW5kMREwDwYDVQQHEwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5 +cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsTI1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9O +IEFVVEhPUklUSUVTMTQwMgYDVQQDEytaRVJPIFZBTFVFIENBIC0gREVNT05TVFJB +VElPTiBQVVJQT1NFUyBPTkxZMB4XDTk3MDQwMzEzMjI1NFoXDTk4MDQwMzEzMjI1 +NFowgbUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIEwpRdWVlbnNsYW5kMREwDwYDVQQH +EwhCcmlzYmFuZTEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxLDAqBgNVBAsT +I1dPUlRITEVTUyBDRVJUSUZJQ0FUSU9OIEFVVEhPUklUSUVTMTQwMgYDVQQDEyta +RVJPIFZBTFVFIENBIC0gREVNT05TVFJBVElPTiBQVVJQT1NFUyBPTkxZMFwwDQYJ +KoZIhvcNAQEBBQADSwAwSAJBAOZ7T7yqP/tyspcko3yPY1y0Cm2EmwNvzW4QgVXR +Fjs3HmJ4xtSpXdo6mwcGezL3Abt/aQXaxv9PU8xt+Jr0OFUCAwEAATANBgkqhkiG +9w0BAQQFAANBAOQpYmGgyCqCy1OljgJhCqQOu627oVlHzK1L+t9vBaMfn40AVUR4 +WzQVWO31KTgi5vTK1U+3h46fgUWqQ0h+6rU= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIAwgKADAgECAgEAMA0GCSqGSIb3DQEBBAUAMGIxETAPBgNVBAcTCEludGVybmV0 +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xh +c3MgMSBDQSAtIEluZGl2aWR1YWwgU3Vic2NyaWJlcjAeFw05NjA0MDgxMDIwMjda +Fw05NzA0MDgxMDIwMjdaMGIxETAPBgNVBAcTCEludGVybmV0MRcwFQYDVQQKEw5W +ZXJpU2lnbiwgSW5jLjE0MDIGA1UECxMrVmVyaVNpZ24gQ2xhc3MgMSBDQSAtIElu +ZGl2aWR1YWwgU3Vic2NyaWJlcjCAMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2 +FKbPTdAFDdjKI9BvqrQpkmOOLPhvltcunXZLEbE2jVfJw/0cxrr+Hgi6M8qV6r7j +W80GqLd5HUQq7XPysVKDaBBwZJHXPmv5912dFEObbpdFmIFH0S3L3bty10w/cari +QPJUObwW7s987LrbP2wqsxaxhhKdrpM01bjV0Pc+qQIDAQABAAAAADANBgkqhkiG +9w0BAQQFAAOBgQA+1nJryNt8VBRjRr07ArDAV/3jAH7GjDc9jsrxZS68ost9v06C +TvTNKGL+LISNmFLXl+JXhgGB0JZ9fvyYzNgHQ46HBUng1H6voalfJgS2KdEo50wW +8EFZYMDkT1k4uynwJqkVN2QJK/2q4/A/VCov5h6SlM8Affg2W+1TLqvqkwAA +-----END CERTIFICATE----- + + subject=/L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber + issuer= /L=Internet/O=VeriSign, Inc./OU=VeriSign Class 2 CA - Individual Subscriber + +-----BEGIN CERTIFICATE----- +MIIEkzCCA/ygAwIBAgIRANDTUpSRL3nTFeMrMayFSPAwDQYJKoZIhvcNAQECBQAw +YjERMA8GA1UEBxMISW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQw +MgYDVQQLEytWZXJpU2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3Jp +YmVyMB4XDTk2MDYwNDAwMDAwMFoXDTk4MDYwNDIzNTk1OVowYjERMA8GA1UEBxMI +SW50ZXJuZXQxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQLEytWZXJp +U2lnbiBDbGFzcyAyIENBIC0gSW5kaXZpZHVhbCBTdWJzY3JpYmVyMIGfMA0GCSqG +SIb3DQEBAQUAA4GNADCBiQKBgQC6A+2czKGRcYMfm8gdnk+0de99TDDzsqo0v5nb +RsbUmMcdRQ7nsMbRWe0SAb/9QoLTZ/cJ0iOBqdrkz7UpqqKarVoTSdlSMVM92tWp +3bJncZHQD1t4xd6lQVdI1/T6R+5J0T1ukOdsI9Jmf+F28S6g3R3L1SFwiHKeZKZv +z+793wIDAQABo4ICRzCCAkMwggIpBgNVHQMBAf8EggIdMIICGTCCAhUwggIRBgtg +hkgBhvhFAQcBATCCAgAWggGrVGhpcyBjZXJ0aWZpY2F0ZSBpbmNvcnBvcmF0ZXMg +YnkgcmVmZXJlbmNlLCBhbmQgaXRzIHVzZSBpcyBzdHJpY3RseSBzdWJqZWN0IHRv +LCB0aGUgVmVyaVNpZ24gQ2VydGlmaWNhdGlvbiBQcmFjdGljZSBTdGF0ZW1lbnQg +KENQUyksIGF2YWlsYWJsZSBhdDogaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL0NQ +Uy0xLjA7IGJ5IEUtbWFpbCBhdCBDUFMtcmVxdWVzdHNAdmVyaXNpZ24uY29tOyBv +ciBieSBtYWlsIGF0IFZlcmlTaWduLCBJbmMuLCAyNTkzIENvYXN0IEF2ZS4sIE1v +dW50YWluIFZpZXcsIENBIDk0MDQzIFVTQSBUZWwuICsxICg0MTUpIDk2MS04ODMw +IENvcHlyaWdodCAoYykgMTk5NiBWZXJpU2lnbiwgSW5jLiAgQWxsIFJpZ2h0cyBS +ZXNlcnZlZC4gQ0VSVEFJTiBXQVJSQU5USUVTIERJU0NMQUlNRUQgYW5kIExJQUJJ +TElUWSBMSU1JVEVELqAOBgxghkgBhvhFAQcBAQGhDgYMYIZIAYb4RQEHAQECMC8w +LRYraHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JlcG9zaXRvcnkvQ1BTLTEuMDAU +BglghkgBhvhCAQEBAf8EBAMCAgQwDQYJKoZIhvcNAQECBQADgYEApRJRkNBqLLgs +53IR/d18ODdLOWMTZ+QOOxBrq460iBEdUwgF8vmPRX1ku7UiDeNzaLlurE6eFqHq +2zPyK5j60zfTLVJMWKcQWwTJLjHtXrW8pxhNtFc6Fdvy5ZkHnC/9NIl7/t4U6WqB +p4y+p7SdMIkEwIZfds0VbnQyX5MRUJY= +-----END CERTIFICATE----- + + subject=/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority + issuer= /C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority +-----BEGIN CERTIFICATE----- +MIICMTCCAZoCBQKhAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw +FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMg +UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa +Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln +biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyVxZ +nvIbigEUtBDfBEDb41evakVAj4QMC9Ez2dkRz+4CWB8l9yqoRAWq7AMfeH+ek7ma +AKojfdashaJjRcdyJ8z0TMZ1cdI5709C8HXfCpDGjiBvmA/4rCNfcCk2pMmG57Ga +IMtTpYXnPb59mv4kRTPcdhXtD6JxZExlLoFoRacCAwEAATANBgkqhkiG9w0BAQIF +AAOBgQB1Zmw+0c2B27X4LzZRtvdCvM1Cr9wO+hVs+GeTVzrrtpLotgHKjLeOQ7RJ +Zfk+7r11Ri7J/CVdqMcvi5uPaM+0nJcYwE3vH9mvgrPmZLiEXIqaB1JDYft0nls6 +NvxMsvwaPxUupVs8G5DsiCnkWRb5zget7Ond2tIxik/W2O8XjQ== +-----END CERTIFICATE----- + subject=/C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority + issuer= /C=US/O=VeriSign, Inc./OU=Class 4 Public Primary Certification Authority +-----BEGIN CERTIFICATE----- +MIICMTCCAZoCBQKmAAABMA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMRcw +FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMg +UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NjAxMjkwMDAwMDBa +Fw05OTEyMzEyMzU5NTlaMF8xCzAJBgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2ln +biwgSW5jLjE3MDUGA1UECxMuQ2xhc3MgNCBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LJ1 +9njQrlpQ9OlQqZ+M1++RlHDo0iSQdomF1t+s5gEXMoDwnZNHvJplnR+Xrr/phnVj +IIm9gFidBAydqMEk6QvlMXi9/C0MN2qeeIDpRnX57aP7E3vIwUzSo+/1PLBij0pd +O92VZ48TucE81qcmm+zDO3rZTbxtm+gVAePwR6kCAwEAATANBgkqhkiG9w0BAQIF +AAOBgQBT3dPwnCR+QKri/AAa19oM/DJhuBUNlvP6Vxt/M3yv6ZiaYch6s7f/sdyZ +g9ysEvxwyR84Qu1E9oAuW2szaayc01znX1oYx7EteQSWQZGZQbE8DbqEOcY7l/Am +yY7uvcxClf8exwI/VAx49byqYHwCaejcrOICdmHEPgPq0ook0Q== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/set/set-g-ca.pem b/sample-app/protex_tutorial/OpenSSL/set/set-g-ca.pem new file mode 100644 index 0000000..78499f0 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/set/set-g-ca.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDeDCCAuGgAwIBAgIgYCYUeg8NJ9kO1q3z6vGCkAmPRfu5+Nur0FyGF79MADMw +DQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCVVMxFDASBgNVBAoTC0JDQTEwMTcx +MTA0MSAwHgYDVQQDExdCcmFuZCBOYW1lOlByb2R1Y3QgVHlwZTAeFw05NjEwMjIw +MDAwMDBaFw05NjExMjEyMzU5NTlaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKEwtQ +Q0ExMDIxMTgyODEgMB4GA1UEAxMXQnJhbmQgTmFtZTpQcm9kdWN0IFR5cGUwgZ8w +DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJyi5V7l1HohY6hN/2N9x6mvWeMy8rD1 +6lfXjgmiuGmhpaszWYaalesMcS2OGuG8Lq3PkaSzpVzqASKfIOjxLMsdpYyYJRub +vRPDWi3xd8wlp9xUwWHKqn+ki8mPo0yN4eONwZZ4rcZr6K+tWd+5EJZSjuENJoQ/ +SRRmGRzdcS7XAgMBAAGjggFXMIIBUzBUBgNVHSMETTBLoSekJTAjMQswCQYDVQQG +EwJVUzEUMBIGA1UEChMLUkNBMTAxMTE4MjmCIGApUs14Ad7t9VTGq2PpV8DylPQ7 +aATM2mor7lc1fWvZMA4GA1UdDwEB/wQEAwIBBjAuBgNVHRABAf8EJDAigA8xOTk2 +MTAyMjAxMjIwMFqBDzE5OTYxMTIxMjM1OTU5WjAbBgNVHSABAf8EETAPMA0GC2CG +SAGG+EUBBwEBMBIGA1UdEwEB/wQIMAYBAf8CAQAwDwYEho1vAwEB/wQEAwICBDB5 +BgSGjW8HAQH/BG4wbDAkAgEAMAkGBSsOAwIaBQAEFDJmNzRiMWFmNGZjYzA2MGY3 +Njc2Ew90ZXJzZSBzdGF0ZW1lbnSAF2h0dHA6Ly93d3cudmVyaXNpZ24uY29tgRpn +ZXRzZXQtY2VudGVyQHZlcmlzaWduLmNvbTANBgkqhkiG9w0BAQUFAAOBgQBn19R2 +AgGvpJDmfXrHTDdCoYyMkaP2MPzw0hFRwh+wqnw0/pqUXa7MrLXMqtD3rUyOWaNR +9fYpJZd0Bh/1OeIc2+U+VNfUovLLuZ8nNemdxyq2KMYnHtnh7UdO7atZ+PFLVu8x +a+J2Mtj8MGy12CJNTJcjLSrJ/1f3AuVrwELjlQ== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/set/set-m-ca.pem b/sample-app/protex_tutorial/OpenSSL/set/set-m-ca.pem new file mode 100644 index 0000000..0e74caf --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/set/set-m-ca.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDeDCCAuGgAwIBAgIgEGvcf5aUnufALdVMa/dmPdflq1CoORGeK5DUwbqhVYcw +DQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCVVMxFDASBgNVBAoTC0JDQTEwMTcx +MTA0MSAwHgYDVQQDExdCcmFuZCBOYW1lOlByb2R1Y3QgVHlwZTAeFw05NjEwMjIw +MDAwMDBaFw05NjExMjEyMzU5NTlaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKEwtN +Q0ExMDIxMTgyNzEgMB4GA1UEAxMXQnJhbmQgTmFtZTpQcm9kdWN0IFR5cGUwgZ8w +DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALuWwr63YrT1GIZpYKfIeiVFHESG/FZO +7RAJKml/p12ZyZ7D5YPP4BBXVsa1H8e8arR1LKC4rdCArrtKKlBeBiMo9+NB+u35 +FnLnTmfzM4iZ2Syw35DXY8+Xn/LM7RJ1RG+vMNcTqpoUg7QPye7flq2Pt7vVROPn +SZxPyVxmILe3AgMBAAGjggFXMIIBUzBUBgNVHSMETTBLoSekJTAjMQswCQYDVQQG +EwJVUzEUMBIGA1UEChMLUkNBMTAxMTE4MjmCIGApUs14Ad7t9VTGq2PpV8DylPQ7 +aATM2mor7lc1fWvZMA4GA1UdDwEB/wQEAwIBBjAuBgNVHRABAf8EJDAigA8xOTk2 +MTAyMjAxMjEwMFqBDzE5OTYxMTIxMjM1OTU5WjAbBgNVHSABAf8EETAPMA0GC2CG +SAGG+EUBBwEBMBIGA1UdEwEB/wQIMAYBAf8CAQAwDwYEho1vAwEB/wQEAwIDCDB5 +BgSGjW8HAQH/BG4wbDAkAgEAMAkGBSsOAwIaBQAEFDJmNzRiMWFmNGZjYzA2MGY3 +Njc2Ew90ZXJzZSBzdGF0ZW1lbnSAF2h0dHA6Ly93d3cudmVyaXNpZ24uY29tgRpn +ZXRzZXQtY2VudGVyQHZlcmlzaWduLmNvbTANBgkqhkiG9w0BAQUFAAOBgQApaj0W +GgyR47URZEZ7z83yivvnVErqtodub/nR1fMgJ4bDC0ofjA0SzXBP1/3eDq9VkPuS +EKUw9BpM2XrSUKhJ6F1CbBjWpM0M7GC1nTSxMxmV+XL+Ab/Gn2SwozUApWtht29/ +x9VLB8qsi6wN2aOsVdQMl5iVCjGQYfEkyuoIgA== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/set/set_b_ca.pem b/sample-app/protex_tutorial/OpenSSL/set/set_b_ca.pem new file mode 100644 index 0000000..eba7d5c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/set/set_b_ca.pem @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID1zCCAr+gAwIBAgIgYClSzXgB3u31VMarY+lXwPKU9DtoBMzaaivuVzV9a9kw +DQYJKoZIhvcNAQEFBQAwIzELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1JDQTEwMTEx +ODI5MB4XDTk2MTAxNzAwMDAwMFoXDTk2MTExNjIzNTk1OVowRTELMAkGA1UEBhMC +VVMxFDASBgNVBAoTC0JDQTEwMTcxMTA0MSAwHgYDVQQDExdCcmFuZCBOYW1lOlBy +b2R1Y3QgVHlwZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApPewvR0BwV02 +9E12ic48pMY/aMB6SkMEWPDx2hURr0DKYGJ6qMvzZn2pSfaVH1BqDtK6oK4Ye5Mj +ItywwQIdXXO9Ut8+TLnvtzq9ByCJ0YThjZJBc7ZcpJxSV7QAoBON/lzxZuAVq3+L +3uc39MgRwmBpRllZEpWrkojxs6166X0CAwEAAaOCAVcwggFTMFQGA1UdIwRNMEuh +J6QlMCMxCzAJBgNVBAYTAlVTMRQwEgYDVQQKEwtSQ0ExMDExMTgyOYIgVqenwCYv +mmxUIvi9gUMCa+uJGJ60mZecw9HrISXnLaYwDgYDVR0PAQH/BAQDAgEGMC4GA1Ud +EAEB/wQkMCKADzE5OTYxMDE3MTc1NzAwWoEPMTk5NjExMTYyMzU5NTlaMBsGA1Ud +IAEB/wQRMA8wDQYLYIZIAYb4RQEHAQEwEgYDVR0TAQH/BAgwBgEB/wIBATAPBgSG +jW8DAQH/BAQDAgABMHkGBIaNbwcBAf8EbjBsMCQCAQAwCQYFKw4DAhoFAAQUMmY3 +NGIxYWY0ZmNjMDYwZjc2NzYTD3RlcnNlIHN0YXRlbWVudIAXaHR0cDovL3d3dy52 +ZXJpc2lnbi5jb22BGmdldHNldC1jZW50ZXJAdmVyaXNpZ24uY29tMA0GCSqGSIb3 +DQEBBQUAA4IBAQAWoMS8Aj2sO0LDxRoMcnWTKY8nd8Jw2vl2Mgsm+0qCvcndICM5 +43N0y9uHlP8WeCZULbFz95gTL8mfP/QTu4EctMUkQgRHJnx80f0XSF3HE/X6zBbI +9rit/bF6yP1mhkdss/vGanReDpki7q8pLx+VIIcxWst/366HP3dW1Fb7ECW/WmVV +VMN93f/xqk9I4sXchVZcVKQT3W4tzv+qQvugrEi1dSEkbAy1CITEAEGiaFhGUyCe +WPox3guRXaEHoINNeajGrISe6d//alsz5EEroBoLnM2ryqWfLAtRsf4rjNzTgklw +lbiz0fw7bNkXKp5ZVr0wlnOjQnoSM6dTI0AV +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/set/set_c_ca.pem b/sample-app/protex_tutorial/OpenSSL/set/set_c_ca.pem new file mode 100644 index 0000000..48b2cbd --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/set/set_c_ca.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDeDCCAuGgAwIBAgIgOnl8J6lAYNDdTWtIojWCGnloNf4ufHjOZ4Fkxwg5xOsw +DQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCVVMxFDASBgNVBAoTC0JDQTEwMTcx +MTA0MSAwHgYDVQQDExdCcmFuZCBOYW1lOlByb2R1Y3QgVHlwZTAeFw05NjEwMjIw +MDAwMDBaFw05NjExMjEyMzU5NTlaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKEwtD +Q0ExMDIxMTYxNjEgMB4GA1UEAxMXQnJhbmQgTmFtZTpQcm9kdWN0IFR5cGUwgZ8w +DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANA3a9+U8oXU3Dv1wJf8g0A7HjCRZAXc +Y8E4OLOdye5aUssxifCE05qTPVqHMXo6cnCYcfroMdURhjQlswyTGtjQybgUnXjp +pchw+V4D1DkN0ThErrMCh9ZFSykC0lUhQTRLESvbIb4Gal/HMAFAF5sj0GoOFi2H +RRj7gpzBIU3xAgMBAAGjggFXMIIBUzBUBgNVHSMETTBLoSekJTAjMQswCQYDVQQG +EwJVUzEUMBIGA1UEChMLUkNBMTAxMTE4MjmCIGApUs14Ad7t9VTGq2PpV8DylPQ7 +aATM2mor7lc1fWvZMA4GA1UdDwEB/wQEAwIBBjAuBgNVHRABAf8EJDAigA8xOTk2 +MTAyMjAxMTAwMFqBDzE5OTYxMTIxMjM1OTU5WjAbBgNVHSABAf8EETAPMA0GC2CG +SAGG+EUBBwEBMBIGA1UdEwEB/wQIMAYBAf8CAQAwDwYEho1vAwEB/wQEAwIEEDB5 +BgSGjW8HAQH/BG4wbDAkAgEAMAkGBSsOAwIaBQAEFDJmNzRiMWFmNGZjYzA2MGY3 +Njc2Ew90ZXJzZSBzdGF0ZW1lbnSAF2h0dHA6Ly93d3cudmVyaXNpZ24uY29tgRpn +ZXRzZXQtY2VudGVyQHZlcmlzaWduLmNvbTANBgkqhkiG9w0BAQUFAAOBgQBteLaZ +u/TASC64UWPfhxYAUdys9DQ1pG/J1qPWNTkjOmpXFvW+7l/3nkxyRPgUoFNwx1e7 +XVVPr6zhy8LaaXppwfIZvVryzAUdbtijiUf/MO0hvV3w7e9NlCVProdU5H9EvCXr ++IV8rH8fdEkirIVyw0JGHkuWhkmtS1HEwai9vg== +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/set/set_d_ct.pem b/sample-app/protex_tutorial/OpenSSL/set/set_d_ct.pem new file mode 100644 index 0000000..9f8c7d8 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/set/set_d_ct.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDdjCCAt+gAwIBAgIgRU5t24v72xVDpZ4iHpyoOAQaQmfio1yhTZAOkBfT2uUw +DQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCVVMxFDASBgNVBAoTC0NDQTEwMjEx +NjE2MSAwHgYDVQQDExdCcmFuZCBOYW1lOlByb2R1Y3QgVHlwZTAeFw05NjEwMjQw +MDAwMDBaFw05NjExMjMyMzU5NTlaMG4xCzAJBgNVBAYTAlVTMRAwDgYDVQQKEwdC +cmFuZElEMSYwJAYDVQQLEx1Jc3N1aW5nIEZpbmFuY2lhbCBJbnN0aXR1dGlvbjEl +MCMGA1UEAxMcR2lYb0t0VjViN1V0MHZKa2hkSG5RYmNzc2JrPTBcMA0GCSqGSIb3 +DQEBAQUAA0sAMEgCQQDIUxgpNB1aoSW585WErtN8WInCRWCqDj3RGT2mJye0F4SM +/iT5ywdWMasmw18vpEpDlMypfZnRkUAdfyHcRABVAgMBAAGjggFwMIIBbDB2BgNV +HSMEbzBtoUmkRzBFMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLQkNBMTAxNzExMDQx +IDAeBgNVBAMTF0JyYW5kIE5hbWU6UHJvZHVjdCBUeXBlgiA6eXwnqUBg0N1Na0ii +NYIaeWg1/i58eM5ngWTHCDnE6zAOBgNVHQ8BAf8EBAMCB4AwLgYDVR0QAQH/BCQw +IoAPMTk5NjEwMjQwMTA0MDBagQ8xOTk2MTEyMzIzNTk1OVowGAYDVR0gBBEwDzAN +BgtghkgBhvhFAQcBATAMBgNVHRMBAf8EAjAAMA8GBIaNbwMBAf8EBAMCB4AweQYE +ho1vBwEB/wRuMGwwJAIBADAJBgUrDgMCGgUABBQzOTgyMzk4NzIzNzg5MTM0OTc4 +MhMPdGVyc2Ugc3RhdGVtZW50gBdodHRwOi8vd3d3LnZlcmlzaWduLmNvbYEaZ2V0 +c2V0LWNlbnRlckB2ZXJpc2lnbi5jb20wDQYJKoZIhvcNAQEFBQADgYEAVHCjhxeD +mIFSkm3DpQAq7pGfcAFPWvSM9I9bK8qeFT1M5YQ+5fbPqaWlNcQlGKIe3cHd4+0P +ndL5lb6UBhhA0kTzEYA38+HtBxPe/lokCv0bYfyWY9asUmvfbUrTYta0yjN7ixnV +UqvxxHQHOAwhf6bcc7xNHapOxloWzGUU0RQ= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/set/set_root.pem b/sample-app/protex_tutorial/OpenSSL/set/set_root.pem new file mode 100644 index 0000000..8dd104f --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/set/set_root.pem @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIgVqenwCYvmmxUIvi9gUMCa+uJGJ60mZecw9HrISXnLaYw +DQYJKoZIhvcNAQEFBQAwIzELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1JDQTEwMTEx +ODI5MB4XDTk2MTAxMjAwMDAwMFoXDTk2MTExMTIzNTk1OVowIzELMAkGA1UEBhMC +VVMxFDASBgNVBAoTC1JDQTEwMTExODI5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAukca0PVUGFIYX7EyrShi+dVi9GTNzG0V2Wtdw6DqFzKfedba/KpE +zqnRDV/wRZlBn3oXPS6kNCFiBPRV9mEFXI7y2W+q8/vPurjRDIXMsqQ+dAhKwf4q +rofJBTiET4NUN0YTtpx6aYuoVubjiOgKdbqnUArxAWWP2Dkco17ipEYyUtd4sTAe +/xKR02AHpbYGYPSHjMDS/nzUJ7uX4d51phs0rt7If48ExJSnDV/KoHMfm42mdmH2 +g23005qdHKY3UXeh10tZmb3QtGTSvF6OqpRZ+e9/ALklu7ZcIjqbb944ci4QWemb +ZNWiDFrWWUoO1k942BI/iZ8Fh8pETYSDBQIDAQABo4GGMIGDMA4GA1UdDwEB/wQE +AwIBBjAuBgNVHRABAf8EJDAigA8xOTk2MTAxMjAxMzQwMFqBDzE5OTYxMTExMjM1 +OTU5WjAbBgNVHSABAf8EETAPMA0GC2CGSAGG+EUBBwEBMBIGA1UdEwEB/wQIMAYB +Af8CAQIwEAYEho1vAwEB/wQFAwMHAIAwDQYJKoZIhvcNAQEFBQADggEBAK4tntea +y+ws7PdULwfqAS5osaoNvw73uBn5lROTpx91uhQbJyf0oZ3XG9GUuHZBpqG9qmr9 +vIL40RsvRpNMYgaNHKTxF716yx6rZmruAYZsrE3SpV63tQJCckKLPSge2E5uDhSQ +O8UjusG+IRT9fKMXUHLv4OmZPOQVOSl1qTCN2XoJFqEPtC3Y9P4YR4xHL0P2jb1l +DLdIbruuh+6omH+0XUZd5fKnQZTTi6gjl0iunj3wGnkcqGZtwr3j87ONiB/8tDwY +vz8ceII4YYdX12PrNzn+fu3R5rChvPW4/ah/SaYQ2VQ0AupaIF4xrNJ/gLYYw0YO +bxCrVJLd8tu9WgA= +-----END CERTIFICATE----- diff --git a/sample-app/protex_tutorial/OpenSSL/times/090/586-100.nt b/sample-app/protex_tutorial/OpenSSL/times/090/586-100.nt new file mode 100644 index 0000000..297ec3e --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/090/586-100.nt @@ -0,0 +1,32 @@ +SSLeay 0.9.0 08-Apr-1998 +built on Wed Apr 8 12:47:17 EST 1998 +options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish( +ptr2) +C flags:cl /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN +-DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 92.25k 256.80k 347.01k 380.40k 390.31k +mdc2 240.72k 251.10k 252.00k 250.80k 251.40k +md5 1013.61k 5651.94k 11831.61k 16294.89k 17901.43k +hmac(md5) 419.50k 2828.07k 7770.11k 13824.34k 17091.70k +sha1 524.31k 2721.45k 5216.15k 6766.10k 7308.42k +rmd160 462.09k 2288.59k 4260.77k 5446.44k 5841.65k +rc4 7895.90k 10326.73k 10555.43k 10728.22k 10429.44k +des cbc 2036.86k 2208.92k 2237.68k 2237.20k 2181.35k +des ede3 649.92k 739.42k 749.07k 748.86k 738.27k +idea cbc 823.19k 885.10k 894.92k 896.45k 891.87k +rc2 cbc 792.63k 859.00k 867.45k 868.96k 865.30k +rc5-32/12 cbc 3502.26k 4026.79k 4107.23k 4121.76k 4073.72k +blowfish cbc 3752.96k 4026.79k 4075.31k 3965.87k 3892.26k +cast cbc 2566.27k 2807.43k 2821.79k 2792.48k 2719.34k + sign verify sign/s verify/s +rsa 512 bits 0.0179s 0.0020s 56.0 501.7 +rsa 1024 bits 0.0950s 0.0060s 10.5 166.6 +rsa 2048 bits 0.6299s 0.0209s 1.6 47.8 +rsa 4096 bits 4.5870s 0.0787s 0.2 12.7 + sign verify sign/s verify/s +dsa 512 bits 0.0180s 0.0339s 55.6 29.5 +dsa 1024 bits 0.0555s 0.1076s 18.0 9.3 +dsa 2048 bits 0.1971s 0.3918s 5.1 2.6 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/486-50.nt b/sample-app/protex_tutorial/OpenSSL/times/091/486-50.nt new file mode 100644 index 0000000..84820d9 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/486-50.nt @@ -0,0 +1,30 @@ +486-50 NT 4.0 + +SSLeay 0.9.1a 06-Jul-1998 +built on Sat Jul 18 18:03:20 EST 1998 +options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) +C flags:cl /MD /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM /Fdout32 +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 28.77k 80.30k 108.50k 118.98k 122.47k +mdc2 51.52k 54.06k 54.54k 54.65k 54.62k +md5 304.39k 1565.04k 3061.54k 3996.10k 4240.10k +hmac(md5) 119.53k 793.23k 2061.29k 3454.95k 4121.76k +sha1 127.51k 596.93k 1055.54k 1313.84k 1413.18k +rmd160 128.50k 572.49k 1001.03k 1248.01k 1323.63k +rc4 1224.40k 1545.11k 1590.29k 1600.20k 1576.90k +des cbc 448.19k 503.45k 512.30k 513.30k 508.23k +des ede3 148.66k 162.48k 163.68k 163.94k 164.24k +idea cbc 194.18k 211.10k 212.99k 213.18k 212.64k +rc2 cbc 245.78k 271.01k 274.12k 274.38k 273.52k +rc5-32/12 cbc 1252.48k 1625.20k 1700.03k 1711.12k 1677.18k +blowfish cbc 725.16k 828.26k 850.01k 846.99k 833.79k +cast cbc 643.30k 717.22k 739.48k 741.57k 735.33k + sign verify sign/s verify/s +rsa 512 bits 0.0904s 0.0104s 11.1 96.2 +rsa 1024 bits 0.5968s 0.0352s 1.7 28.4 +rsa 2048 bits 3.8860s 0.1017s 0.3 9.8 + sign verify sign/s verify/s +dsa 512 bits 0.1006s 0.1249s 9.9 8.0 +dsa 1024 bits 0.3306s 0.4093s 3.0 2.4 +dsa 2048 bits 0.9454s 1.1707s 1.1 0.9 diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/586-100.lnx b/sample-app/protex_tutorial/OpenSSL/times/091/586-100.lnx new file mode 100644 index 0000000..92892a6 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/586-100.lnx @@ -0,0 +1,32 @@ +Pentium 100mhz, linux + +SSLeay 0.9.0a 14-Apr-1998 +built on Fri Apr 17 08:47:07 EST 1998 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 56.65k 153.88k 208.47k 229.03k 237.57k +mdc2 189.59k 204.95k 206.93k 208.90k 209.56k +md5 1019.48k 5882.41k 12085.42k 16376.49k 18295.47k +hmac(md5) 415.86k 2887.85k 7891.29k 13894.66k 17446.23k +sha1 540.68k 2791.96k 5289.30k 6813.01k 7432.87k +rmd160 298.37k 1846.87k 3869.10k 5273.94k 5892.78k +rc4 7870.87k 10438.10k 10857.13k 10729.47k 10788.86k +des cbc 1960.60k 2226.37k 2241.88k 2054.83k 2181.80k +des ede3 734.44k 739.69k 779.43k 750.25k 772.78k +idea cbc 654.07k 711.00k 716.89k 718.51k 720.90k +rc2 cbc 648.83k 701.91k 708.61k 708.95k 709.97k +rc5-32/12 cbc 3504.71k 4054.76k 4131.41k 4105.56k 4134.23k +blowfish cbc 3762.25k 4313.79k 4460.54k 4356.78k 4317.18k +cast cbc 2755.01k 3038.91k 3076.44k 3027.63k 2998.27k + sign verify sign/s verify/s +rsa 512 bits 0.0195s 0.0019s 51.4 519.9 +rsa 1024 bits 0.1000s 0.0059s 10.0 168.2 +rsa 2048 bits 0.6406s 0.0209s 1.6 47.8 +rsa 4096 bits 4.6100s 0.0787s 0.2 12.7 + sign verify sign/s verify/s +dsa 512 bits 0.0188s 0.0360s 53.1 27.8 +dsa 1024 bits 0.0570s 0.1126s 17.5 8.9 +dsa 2048 bits 0.1990s 0.3954s 5.0 2.5 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/68000.bsd b/sample-app/protex_tutorial/OpenSSL/times/091/68000.bsd new file mode 100644 index 0000000..a3a14e8 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/68000.bsd @@ -0,0 +1,32 @@ +Motorolla 68020 20mhz, NetBSD + +SSLeay 0.9.0t 29-May-1998 +built on Fri Jun 5 12:42:23 EST 1998 +options:bn(64,32) md2(char) rc4(idx,int) des(idx,cisc,16,long) idea(int) blowfish(idx) +C flags:gcc -DTERMIOS -O3 -fomit-frame-pointer -Wall -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 2176.00 5994.67 8079.73 8845.18 9077.01 +mdc2 5730.67 6122.67 6167.66 6176.51 6174.87 +md5 29.10k 127.31k 209.66k 250.50k 263.99k +hmac(md5) 12.33k 73.02k 160.17k 228.04k 261.15k +sha1 11.27k 49.37k 84.31k 102.40k 109.23k +rmd160 11.69k 48.62k 78.76k 93.15k 98.41k +rc4 117.96k 148.94k 152.57k 153.09k 152.92k +des cbc 27.13k 30.06k 30.38k 30.38k 30.53k +des ede3 10.51k 10.94k 11.01k 11.01k 11.01k +idea cbc 26.74k 29.23k 29.45k 29.60k 29.74k +rc2 cbc 34.27k 39.39k 40.03k 40.07k 40.16k +rc5-32/12 cbc 64.31k 83.18k 85.70k 86.70k 87.09k +blowfish cbc 48.86k 59.18k 60.07k 60.42k 60.78k +cast cbc 42.67k 50.01k 50.86k 51.20k 51.37k + sign verify sign/s verify/s +rsa 512 bits 0.7738s 0.0774s 1.3 12.9 +rsa 1024 bits 4.3967s 0.2615s 0.2 3.8 +rsa 2048 bits 29.5200s 0.9664s 0.0 1.0 + sign verify sign/s verify/s +dsa 512 bits 0.7862s 0.9709s 1.3 1.0 +dsa 1024 bits 2.5375s 3.1625s 0.4 0.3 +dsa 2048 bits 9.2150s 11.8200s 0.1 0.1 + + diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/686-200.lnx b/sample-app/protex_tutorial/OpenSSL/times/091/686-200.lnx new file mode 100644 index 0000000..bb857d4 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/686-200.lnx @@ -0,0 +1,32 @@ +Pentium Pro 200mhz, linux + +SSLeay 0.9.0d 26-Apr-1998 +built on Sun Apr 26 10:25:33 EST 1998 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 130.58k 364.54k 499.24k 545.79k 561.66k +mdc2 526.68k 579.72k 588.37k 588.80k 589.82k +md5 1917.71k 11434.69k 22512.21k 29495.30k 32677.89k +hmac(md5) 749.18k 5264.83k 14227.20k 25018.71k 31760.38k +sha1 1343.83k 6436.29k 11702.78k 14664.70k 15829.67k +rmd160 1038.05k 5138.77k 8985.51k 10985.13k 11799.21k +rc4 14891.04k 21334.06k 22376.79k 22579.54k 22574.42k +des cbc 4131.97k 4568.31k 4645.29k 4631.21k 4572.73k +des ede3 1567.17k 1631.13k 1657.32k 1653.08k 1643.86k +idea cbc 2427.23k 2671.21k 2716.67k 2723.84k 2733.40k +rc2 cbc 1629.90k 1767.38k 1788.50k 1797.12k 1799.51k +rc5-32/12 cbc 10290.55k 13161.60k 13744.55k 14011.73k 14123.01k +blowfish cbc 5896.42k 6920.77k 7122.01k 7151.62k 7146.15k +cast cbc 6037.71k 6935.19k 7101.35k 7145.81k 7116.12k + sign verify sign/s verify/s +rsa 512 bits 0.0070s 0.0007s 142.6 1502.9 +rsa 1024 bits 0.0340s 0.0019s 29.4 513.3 +rsa 2048 bits 0.2087s 0.0066s 4.8 151.3 +rsa 4096 bits 1.4700s 0.0242s 0.7 41.2 + sign verify sign/s verify/s +dsa 512 bits 0.0064s 0.0121s 156.1 82.9 +dsa 1024 bits 0.0184s 0.0363s 54.4 27.5 +dsa 2048 bits 0.0629s 0.1250s 15.9 8.0 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/alpha064.osf b/sample-app/protex_tutorial/OpenSSL/times/091/alpha064.osf new file mode 100644 index 0000000..a8e7fdf --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/alpha064.osf @@ -0,0 +1,32 @@ +Alpha EV4.5 (21064) 275mhz, OSF1 V4.0 +SSLeay 0.9.0g 01-May-1998 +built on Mon May 4 17:26:09 CST 1998 +options:bn(64,64) md2(int) rc4(ptr,int) des(idx,cisc,4,long) idea(int) blowfish(idx) +C flags:cc -tune host -O4 -readonly_strings +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 119.58k 327.48k 443.28k 480.09k 495.16k +mdc2 436.67k 456.35k 465.42k 466.57k 469.01k +md5 1459.34k 6566.46k 11111.91k 13375.30k 14072.60k +hmac(md5) 597.90k 3595.45k 8180.88k 12099.49k 13884.46k +sha1 707.01k 3253.09k 6131.73k 7798.23k 8439.67k +rmd160 618.57k 2729.07k 4711.33k 5825.16k 6119.23k +rc4 8796.43k 9393.62k 9548.88k 9378.77k 9472.57k +des cbc 2165.97k 2514.90k 2586.27k 2572.93k 2639.08k +des ede3 945.44k 1004.03k 1005.96k 1017.33k 1020.85k +idea cbc 1498.81k 1629.11k 1637.28k 1625.50k 1641.11k +rc2 cbc 1866.00k 2044.92k 2067.12k 2064.00k 2068.96k +rc5-32/12 cbc 4366.97k 5521.32k 5687.50k 5729.16k 5736.96k +blowfish cbc 3997.31k 4790.60k 4937.84k 4954.56k 5024.85k +cast cbc 2900.19k 3673.30k 3803.73k 3823.93k 3890.25k + sign verify sign/s verify/s +rsa 512 bits 0.0069s 0.0006s 144.2 1545.8 +rsa 1024 bits 0.0304s 0.0018s 32.9 552.6 +rsa 2048 bits 0.1887s 0.0062s 5.3 161.4 +rsa 4096 bits 1.3667s 0.0233s 0.7 42.9 + sign verify sign/s verify/s +dsa 512 bits 0.0067s 0.0123s 149.6 81.1 +dsa 1024 bits 0.0177s 0.0332s 56.6 30.1 +dsa 2048 bits 0.0590s 0.1162s 16.9 8.6 + + diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/alpha164.lnx b/sample-app/protex_tutorial/OpenSSL/times/091/alpha164.lnx new file mode 100644 index 0000000..c994662 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/alpha164.lnx @@ -0,0 +1,32 @@ +Alpha EV5.6 (21164A) 533mhz, Linux 2.0.32 + +SSLeay 0.9.0p 22-May-1998 +built on Sun May 27 14:23:38 GMT 2018 +options:bn(64,64) md2(int) rc4(ptr,int) des(idx,risc1,16,long) idea(int) blowfish(idx) +C flags:gcc -O3 +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 295.78k 825.34k 1116.42k 1225.10k 1262.65k +mdc2 918.16k 1017.55k 1032.18k 1034.24k 1035.60k +md5 3574.93k 15517.05k 25482.67k 30434.31k 32210.51k +hmac(md5) 1261.54k 7757.15k 18025.46k 27081.21k 31653.27k +sha1 2251.89k 10056.84k 16990.19k 20651.04k 21973.29k +rmd160 1615.49k 7017.13k 11601.11k 13875.62k 14690.31k +rc4 22435.16k 24476.40k 24349.95k 23042.36k 24581.53k +des cbc 5198.38k 6559.04k 6775.43k 6827.87k 6875.82k +des ede3 2257.73k 2602.18k 2645.60k 2657.12k 2670.59k +idea cbc 3694.42k 4125.61k 4180.74k 4193.28k 4192.94k +rc2 cbc 4642.47k 5323.85k 5415.42k 5435.86k 5434.03k +rc5-32/12 cbc 9705.26k 13277.79k 13843.46k 13989.66k 13987.57k +blowfish cbc 7861.28k 10852.34k 11447.98k 11616.97k 11667.54k +cast cbc 6718.13k 8599.98k 8967.17k 9070.81k 9099.28k + sign verify sign/s verify/s +rsa 512 bits 0.0018s 0.0002s 555.9 6299.5 +rsa 1024 bits 0.0081s 0.0005s 123.3 2208.7 +rsa 2048 bits 0.0489s 0.0015s 20.4 648.5 +rsa 4096 bits 0.3402s 0.0057s 2.9 174.7 + sign verify sign/s verify/s +dsa 512 bits 0.0019s 0.0032s 529.0 310.2 +dsa 1024 bits 0.0047s 0.0086s 214.1 115.7 +dsa 2048 bits 0.0150s 0.0289s 66.7 34.6 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/alpha164.osf b/sample-app/protex_tutorial/OpenSSL/times/091/alpha164.osf new file mode 100644 index 0000000..df712c6 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/alpha164.osf @@ -0,0 +1,31 @@ +Alpha EV5.6 (21164A) 400mhz, OSF1 V4.0 + +SSLeay 0.9.0 10-Apr-1998 +built on Sun Apr 19 07:54:37 EST 1998 +options:bn(64,64) md2(int) rc4(ptr,int) des(ptr,risc2,4,int) idea(int) blowfish(idx) +C flags:cc -O4 -tune host -fast +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 276.30k 762.07k 1034.35k 1134.07k 1160.53k +mdc2 814.99k 845.83k 849.09k 850.33k 849.24k +md5 2468.43k 10945.27k 17963.48k 21430.89k 22544.38k +hmac(md5) 1002.48k 6023.98k 13430.99k 19344.17k 22351.80k +sha1 1984.93k 8882.47k 14856.47k 17878.70k 18955.10k +rmd160 1286.96k 5595.52k 9167.00k 10957.74k 11582.30k +rc4 15948.15k 16710.29k 16793.20k 17929.50k 18474.56k +des cbc 3416.04k 4149.37k 4296.25k 4328.89k 4327.57k +des ede3 1540.14k 1683.36k 1691.14k 1705.90k 1705.22k +idea cbc 2795.87k 3192.93k 3238.13k 3238.17k 3256.66k +rc2 cbc 3529.00k 4069.93k 4135.79k 4135.25k 4160.07k +rc5-32/12 cbc 7212.35k 9849.71k 10260.91k 10423.38k 10439.99k +blowfish cbc 6061.75k 8363.50k 8706.80k 8779.40k 8784.55k +cast cbc 5401.75k 6433.31k 6638.18k 6662.40k 6702.80k + sign verify sign/s verify/s +rsa 512 bits 0.0022s 0.0002s 449.6 4916.2 +rsa 1024 bits 0.0105s 0.0006s 95.3 1661.2 +rsa 2048 bits 0.0637s 0.0020s 15.7 495.6 +rsa 4096 bits 0.4457s 0.0075s 2.2 132.7 + sign verify sign/s verify/s +dsa 512 bits 0.0028s 0.0048s 362.2 210.4 +dsa 1024 bits 0.0064s 0.0123s 155.2 81.6 +dsa 2048 bits 0.0201s 0.0394s 49.7 25.4 diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/r10000.irx b/sample-app/protex_tutorial/OpenSSL/times/091/r10000.irx new file mode 100644 index 0000000..237ee5d --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/r10000.irx @@ -0,0 +1,37 @@ +MIPS R10000 32kI+32kD 180mhz, IRIX 6.4 + +Using crypto/bn/mips3.s + +This is built for n32, which is faster for all benchmarks than the n64 +compilation model + +SSLeay 0.9.0b 19-Apr-1998 +built on Sat Apr 25 12:43:14 EST 1998 +options:bn(64,64) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) blowfish(ptr) +C flags:cc -use_readonly_const -O2 -DTERMIOS -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 126.38k 349.38k 472.67k 517.01k 529.81k +mdc2 501.64k 545.87k 551.80k 553.64k 554.41k +md5 1825.77k 7623.64k 12630.47k 15111.74k 16012.09k +hmac(md5) 780.81k 4472.86k 9667.22k 13802.67k 15777.89k +sha1 1375.52k 6213.91k 11037.30k 13682.01k 14714.09k +rmd160 856.72k 3454.40k 5598.33k 6689.94k 7073.48k +rc4 11260.93k 13311.50k 13360.05k 13322.17k 13364.39k +des cbc 2770.78k 3055.42k 3095.18k 3092.48k 3103.03k +des ede3 1023.22k 1060.58k 1063.81k 1070.37k 1064.54k +idea cbc 3029.09k 3334.30k 3375.29k 3375.65k 3380.64k +rc2 cbc 2307.45k 2470.72k 2501.25k 2500.68k 2500.55k +rc5-32/12 cbc 6770.91k 8629.89k 8909.58k 9009.64k 9044.95k +blowfish cbc 4796.53k 5598.20k 5717.14k 5755.11k 5749.86k +cast cbc 3986.20k 4426.17k 4465.04k 4476.84k 4475.08k + sign verify sign/s verify/s +rsa 512 bits 0.0034s 0.0003s 296.1 3225.4 +rsa 1024 bits 0.0139s 0.0008s 71.8 1221.8 +rsa 2048 bits 0.0815s 0.0026s 12.3 380.3 +rsa 4096 bits 0.5656s 0.0096s 1.8 103.7 + sign verify sign/s verify/s +dsa 512 bits 0.0034s 0.0061s 290.8 164.9 +dsa 1024 bits 0.0084s 0.0161s 119.1 62.3 +dsa 2048 bits 0.0260s 0.0515s 38.5 19.4 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/r3000.ult b/sample-app/protex_tutorial/OpenSSL/times/091/r3000.ult new file mode 100644 index 0000000..ecd3390 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/r3000.ult @@ -0,0 +1,32 @@ +MIPS R3000 64kI+64kD 25mhz, ultrix 4.3 + +SSLeay 0.9.0b 19-Apr-1998 +built on Thu Apr 23 07:22:31 EST 1998 +options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) blowfish(idx) +C flags:cc -O2 -DL_ENDIAN -DNOPROTO -DNOCONST +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 14.63k 40.65k 54.70k 60.07k 61.78k +mdc2 29.43k 37.27k 38.23k 38.57k 38.60k +md5 140.04k 676.59k 1283.84k 1654.10k 1802.24k +hmac(md5) 60.51k 378.90k 937.82k 1470.46k 1766.74k +sha1 60.77k 296.79k 525.40k 649.90k 699.05k +rmd160 48.82k 227.16k 417.19k 530.31k 572.05k +rc4 904.76k 996.20k 1007.53k 1015.65k 1010.35k +des cbc 178.87k 209.39k 213.42k 215.55k 214.53k +des ede3 74.25k 79.30k 80.40k 80.21k 80.14k +idea cbc 181.02k 209.37k 214.44k 214.36k 213.83k +rc2 cbc 161.52k 184.98k 187.99k 188.76k 189.05k +rc5-32/12 cbc 398.99k 582.91k 614.66k 626.07k 621.87k +blowfish cbc 296.38k 387.69k 405.50k 412.57k 410.05k +cast cbc 214.76k 260.63k 266.92k 268.63k 258.26k + sign verify sign/s verify/s +rsa 512 bits 0.0870s 0.0089s 11.5 112.4 +rsa 1024 bits 0.4881s 0.0295s 2.0 33.9 +rsa 2048 bits 3.2750s 0.1072s 0.3 9.3 +rsa 4096 bits 23.9833s 0.4093s 0.0 2.4 + sign verify sign/s verify/s +dsa 512 bits 0.0898s 0.1706s 11.1 5.9 +dsa 1024 bits 0.2847s 0.5565s 3.5 1.8 +dsa 2048 bits 1.0267s 2.0433s 1.0 0.5 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/091/r4400.irx b/sample-app/protex_tutorial/OpenSSL/times/091/r4400.irx new file mode 100644 index 0000000..9b96ca1 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/091/r4400.irx @@ -0,0 +1,32 @@ +R4400 16kI+16kD 200mhz, Irix 5.3 + +SSLeay 0.9.0e 27-Apr-1998 +built on Sun Apr 26 07:26:05 PDT 1998 +options:bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) blowfish(ptr) +C flags:cc -O2 -use_readonly_const -DTERMIOS -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 79.80k 220.59k 298.01k 327.06k 338.60k +mdc2 262.74k 285.30k 289.16k 288.36k 288.49k +md5 930.35k 4167.13k 7167.91k 8678.23k 9235.86k +hmac(md5) 399.44k 2367.57k 5370.74k 7884.28k 9076.98k +sha1 550.96k 2488.17k 4342.76k 5362.50k 5745.40k +rmd160 424.58k 1752.83k 2909.67k 3486.08k 3702.89k +rc4 6687.79k 7834.63k 7962.61k 8035.65k 7915.28k +des cbc 1544.20k 1725.94k 1748.35k 1758.17k 1745.61k +des ede3 587.29k 637.75k 645.93k 643.17k 646.01k +idea cbc 1575.52k 1719.75k 1732.41k 1736.69k 1740.11k +rc2 cbc 1496.21k 1629.90k 1643.19k 1652.14k 1646.62k +rc5-32/12 cbc 3452.48k 4276.47k 4390.74k 4405.25k 4400.12k +blowfish cbc 2354.58k 3242.36k 3401.11k 3433.65k 3383.65k +cast cbc 1942.22k 2152.28k 2187.51k 2185.67k 2177.20k + sign verify sign/s verify/s +rsa 512 bits 0.0130s 0.0014s 76.9 729.8 +rsa 1024 bits 0.0697s 0.0043s 14.4 233.9 +rsa 2048 bits 0.4664s 0.0156s 2.1 64.0 +rsa 4096 bits 3.4067s 0.0586s 0.3 17.1 + sign verify sign/s verify/s +dsa 512 bits 0.0140s 0.0261s 71.4 38.4 +dsa 1024 bits 0.0417s 0.0794s 24.0 12.6 +dsa 2048 bits 0.1478s 0.2929s 6.8 3.4 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/100.lnx b/sample-app/protex_tutorial/OpenSSL/times/100.lnx new file mode 100644 index 0000000..d0f4537 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/100.lnx @@ -0,0 +1,32 @@ +SSLeay 0.8.4c 03-Aug-1999 +built on Tue Nov 4 02:52:29 EST 1997 +options:bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DMD5_ASM -DSHA1_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 53.27k 155.95k 201.30k 216.41k 236.78k +mdc2 192.98k 207.98k 206.76k 206.17k 208.87k +md5 993.15k 5748.27k 11944.70k 16477.53k 18287.27k +hmac(md5) 404.97k 2787.58k 7690.07k 13744.43k 17601.88k +sha1 563.24k 2851.67k 5363.71k 6879.23k 7441.07k +rc4 7876.70k 10400.85k 10825.90k 10943.49k 10745.17k +des cbc 2047.39k 2188.25k 2188.29k 2239.49k 2233.69k +des ede3 660.55k 764.01k 773.55k 779.21k 780.97k +idea cbc 653.93k 708.48k 715.43k 719.87k 720.90k +rc2 cbc 648.08k 702.23k 708.78k 711.00k 709.97k +blowfish cbc 3764.39k 4288.66k 4375.04k 4497.07k 4423.68k +cast cbc 2757.14k 2993.75k 3035.31k 3078.90k 3055.62k + +blowfish cbc 3258.81k 3673.47k 3767.30k 3774.12k 3719.17k +cast cbc 2677.05k 3164.78k 3273.05k 3287.38k 3244.03k + + + sign verify +rsa 512 bits 0.0213s 0.0020s +rsa 1024 bits 0.1073s 0.0063s +rsa 2048 bits 0.6873s 0.0224s +rsa 4096 bits 4.9333s 0.0845s + sign verify +dsa 512 bits 0.0201s 0.0385s +dsa 1024 bits 0.0604s 0.1190s +dsa 2048 bits 0.2121s 0.4229s diff --git a/sample-app/protex_tutorial/OpenSSL/times/100.nt b/sample-app/protex_tutorial/OpenSSL/times/100.nt new file mode 100644 index 0000000..0dd7cfc --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/100.nt @@ -0,0 +1,29 @@ +SSLeay 0.8.4c 03-Aug-1999 +built on Tue Aug 3 09:49:58 EST 1999 +options:bn(64,32) md2(int) rc4(ptr,int) des(idx,cisc,4,long) idea(int) blowfish( +ptr2) +C flags:cl /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN -DBN +_ASM -DMD5_ASM -DSHA1_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 93.07k 258.38k 349.03k 382.83k 392.87k +mdc2 245.80k 259.02k 259.34k 259.16k 260.14k +md5 1103.42k 6017.65k 12210.49k 16552.11k 18291.77k +hmac(md5) 520.15k 3394.00k 8761.86k 14593.96k 17742.40k +sha1 538.06k 2726.76k 5242.22k 6821.12k 7426.18k +rc4 8283.90k 10513.09k 10886.38k 10929.50k 10816.75k +des cbc 2073.10k 2232.91k 2251.61k 2256.46k 2232.44k +des ede3 758.85k 782.46k 786.14k 786.08k 781.24k +idea cbc 831.02k 892.63k 901.07k 903.48k 901.85k +rc2 cbc 799.89k 866.09k 873.96k 876.22k 874.03k +blowfish cbc 3835.32k 4418.78k 4511.94k 4494.54k 4416.92k +cast cbc 2974.68k 3272.71k 3313.04k 3335.17k 3261.51k + sign verify +rsa 512 bits 0.0202s 0.0019s +rsa 1024 bits 0.1029s 0.0062s +rsa 2048 bits 0.6770s 0.0220s +rsa 4096 bits 4.8770s 0.0838s + sign verify +dsa 512 bits 0.0191s 0.0364s +dsa 1024 bits 0.0590s 0.1141s +dsa 2048 bits 0.2088s 0.4171s diff --git a/sample-app/protex_tutorial/OpenSSL/times/200.lnx b/sample-app/protex_tutorial/OpenSSL/times/200.lnx new file mode 100644 index 0000000..fd7e7f4 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/200.lnx @@ -0,0 +1,30 @@ +This machine was slightly loaded :-( + +SSLeay 0.8.4c 03-Aug-1999 +built on Tue Nov 4 02:52:29 EST 1997 +options:bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DMD5_ASM -DSHA1_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 130.86k 365.31k 499.60k 547.75k 561.41k +mdc2 526.03k 581.38k 587.12k 586.31k 589.60k +md5 1919.49k 11173.23k 22387.60k 29553.47k 32587.21k +hmac(md5) 747.09k 5248.35k 14275.44k 24713.26k 31737.13k +sha1 1336.63k 6400.50k 11668.67k 14648.83k 15700.85k +rc4 15002.32k 21327.21k 22301.63k 22503.78k 22549.26k +des cbc 4115.16k 4521.08k 4632.37k 4607.28k 4570.57k +des ede3 1540.29k 1609.76k 1623.64k 1620.76k 1624.18k +idea cbc 2405.08k 2664.78k 2704.22k 2713.95k 2716.29k +rc2 cbc 1634.07k 1764.30k 1780.23k 1790.27k 1788.12k +blowfish cbc 5993.98k 6927.27k 7083.61k 7088.40k 7123.72k +cast cbc 5981.52k 6900.44k 7079.70k 7110.40k 7057.72k + sign verify +rsa 512 bits 0.0085s 0.0007s +rsa 1024 bits 0.0377s 0.0020s +rsa 2048 bits 0.2176s 0.0067s +rsa 4096 bits 1.4800s 0.0242s +sign verify +dsa 512 bits 0.0071s 0.0132s +dsa 1024 bits 0.0192s 0.0376s +dsa 2048 bits 0.0638s 0.1280s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/486-66.dos b/sample-app/protex_tutorial/OpenSSL/times/486-66.dos new file mode 100644 index 0000000..1644bf8 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/486-66.dos @@ -0,0 +1,22 @@ +MS-dos static libs, 16bit C build, 16bit assember + +SSLeay 0.6.1 +options:bn(32,16) md2(char) rc4(idx,int) des(ptr,long) idea(short) +C flags:cl /ALw /Gx- /Gf /f- /Ocgnotb2 /G2 /W3 /WX -DL_ENDIAN /nologo -DMSDOS -D +NO_SOCK +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 18.62k 55.54k 76.88k 85.39k 86.52k +md5 94.03k 442.06k 794.38k 974.51k 1061.31k +sha 38.37k 166.23k 272.78k 331.41k 353.77k +sha1 34.38k 147.77k 244.77k 292.57k 312.08k +rc4 641.25k 795.34k 817.16k 829.57k 817.16k +des cfb 111.46k 118.08k 120.69k 119.16k 119.37k +des cbc 122.96k 135.69k 137.10k 135.69k 135.40k +des ede3 48.01k 50.92k 50.32k 50.96k 50.96k +idea cfb 97.09k 100.21k 100.36k 101.14k 100.98k +idea cbc 102.08k 109.41k 111.46k 111.65k 110.52k +rc2 cfb 120.47k 125.55k 125.79k 125.55k 125.55k +rc2 cbc 129.77k 140.33k 143.72k 142.16k 141.85k +rsa 512 bits 0.264s +rsa 1024 bits 1.494s diff --git a/sample-app/protex_tutorial/OpenSSL/times/486-66.nt b/sample-app/protex_tutorial/OpenSSL/times/486-66.nt new file mode 100644 index 0000000..b26a900 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/486-66.nt @@ -0,0 +1,22 @@ +SSLeay 0.6.1 02-Jul-1996 +built on Fri Jul 10 09:53:15 EST 1996 +options:bn(64,32) md2(int) rc4(idx,int) des(idx,long) idea(int) +C flags:cl /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /nologo -DWIN32 -DL_ENDIAN /MD +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 38.27k 107.28k 145.43k 159.60k 164.15k +md5 399.00k 1946.13k 3610.80k 4511.94k 4477.27k +sha 182.04k 851.26k 1470.65k 1799.20k 1876.48k +sha1 151.83k 756.55k 1289.76k 1567.38k 1625.70k +rc4 1853.92k 2196.25k 2232.91k 2241.31k 2152.96k +des cfb 360.58k 382.69k 384.94k 386.07k 377.19k +des cbc 376.10k 431.87k 436.32k 437.78k 430.45k +des ede3 152.55k 160.38k 161.51k 161.33k 159.98k +idea cfb 245.59k 255.60k 256.65k 257.16k 254.61k +idea cbc 257.16k 276.12k 279.05k 279.11k 276.70k +rc2 cfb 280.25k 293.49k 294.74k 294.15k 291.47k +rc2 cbc 295.47k 321.57k 324.76k 324.76k 320.00k +rsa 512 bits 0.084s +rsa 1024 bits 0.495s +rsa 2048 bits 3.435s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/486-66.w31 b/sample-app/protex_tutorial/OpenSSL/times/486-66.w31 new file mode 100644 index 0000000..381f149 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/486-66.w31 @@ -0,0 +1,23 @@ +Windows 3.1 DLL's, 16 bit C with 32bit assember + +SSLeay 0.6.1 02-Jul-1996 +built on Wed Jul 10 09:53:15 EST 1996 +options:bn(32,32) md2(char) rc4(idx,int) des(ptr,long) idea(short) +C flags:cl /ALw /Gx- /Gf /G2 /f- /Ocgnotb2 /W3 /WX -DL_ENDIAN /nologo -DWIN16 +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 18.94k 54.27k 73.43k 80.91k 83.75k +md5 78.96k 391.26k 734.30k 919.80k 992.97k +sha 39.01k 168.04k 280.67k 336.08k 359.10k +sha1 35.20k 150.14k 247.31k 294.54k 313.94k +rc4 509.61k 655.36k 678.43k 677.02k 670.10k +des cfb 97.09k 104.69k 106.56k 105.70k 106.56k +des cbc 116.82k 129.77k 131.07k 131.07k 131.07k +des ede3 44.22k 47.90k 48.53k 48.47k 47.86k +idea cfb 83.49k 87.03k 87.03k 87.15k 87.73k +idea cbc 89.04k 96.23k 96.95k 97.81k 97.09k +rc2 cfb 108.32k 113.58k 113.78k 114.57k 114.77k +rc2 cbc 118.08k 131.07k 134.02k 134.02k 132.66k +rsa 512 bits 0.181s +rsa 1024 bits 0.846s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/5.lnx b/sample-app/protex_tutorial/OpenSSL/times/5.lnx new file mode 100644 index 0000000..1c1e392 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/5.lnx @@ -0,0 +1,29 @@ +SSLeay 0.8.5g 24-Jan-1998 +built on Tue Jan 27 08:11:42 EST 1998 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 56.55k 156.69k 211.63k 231.77k 238.71k +mdc2 192.26k 208.09k 210.09k 209.58k 210.26k +md5 991.04k 5745.51k 11932.67k 16465.24k 18306.39k +hmac(md5) 333.99k 2383.89k 6890.67k 13133.82k 17397.08k +sha1 571.68k 2883.88k 5379.07k 6880.26k 7443.80k +rmd160 409.41k 2212.91k 4225.45k 5456.55k 5928.28k +rc4 6847.57k 8596.22k 8901.80k 8912.90k 8850.09k +des cbc 2046.29k 2229.78k 2254.76k 2259.97k 2233.69k +des ede3 751.11k 779.95k 783.96k 784.38k 780.97k +idea cbc 653.40k 708.29k 718.42k 720.21k 720.90k +rc2 cbc 647.19k 702.46k 709.21k 710.66k 709.97k +rc5-32/12 cbc 3498.18k 4054.12k 4133.46k 4151.64k 4139.69k +blowfish cbc 3763.95k 4437.74k 4532.74k 4515.50k 4448.26k +cast cbc 2754.22k 3020.67k 3079.08k 3069.95k 3036.50k + sign verify sign/s verify/s +rsa 512 bits 0.0207s 0.0020s 48.3 511.3 +rsa 1024 bits 0.1018s 0.0059s 9.8 169.6 +rsa 2048 bits 0.6438s 0.0208s 1.6 48.0 +rsa 4096 bits 4.6033s 0.0793s 0.2 12.6 + sign verify sign/s verify/s +dsa 512 bits 0.0190s 0.0359s 52.6 27.8 +dsa 1024 bits 0.0566s 0.1109s 17.7 9.0 +dsa 2048 bits 0.1988s 0.3915s 5.0 2.6 diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-085i.nt b/sample-app/protex_tutorial/OpenSSL/times/586-085i.nt new file mode 100644 index 0000000..8a57975 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-085i.nt @@ -0,0 +1,29 @@ +SSLeay 0.8.5i 28-Jan-1998 +built on Wed Jan 28 18:00:07 EST 1998 +options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) +C flags:cl /MT /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN -DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 92.74k 257.59k 348.16k 381.79k 392.14k +mdc2 227.65k 247.82k 249.90k 250.65k 250.20k +md5 1089.54k 5966.29k 12104.77k 16493.53k 18204.44k +hmac(md5) 513.53k 3361.36k 8725.41k 14543.36k 17593.56k +sha1 580.74k 2880.51k 5376.62k 6865.78k 7413.05k +rmd160 508.06k 2427.96k 4385.51k 5510.84k 5915.80k +rc4 8004.40k 10408.74k 10794.48k 10884.12k 10728.22k +des cbc 2057.24k 2222.97k 2246.79k 2209.39k 2223.44k +des ede3 739.42k 761.99k 765.48k 760.26k 760.97k +idea cbc 827.08k 889.60k 898.83k 901.15k 897.98k +rc2 cbc 795.64k 861.04k 871.13k 872.58k 871.13k +rc5-32/12 cbc 3597.17k 4139.66k 4204.39k 4223.02k 4204.39k +blowfish cbc 3807.47k 3996.10k 4156.07k 4204.39k 4105.62k +cast cbc 2777.68k 2814.21k 2892.62k 2916.76k 2868.88k + sign verify sign/s verify/s +rsa 512 bits 0.0178s 0.0018s 56.3 541.6 +rsa 1024 bits 0.0945s 0.0059s 10.6 168.3 +rsa 2048 bits 0.6269s 0.0208s 1.6 48.0 +rsa 4096 bits 4.5560s 0.0784s 0.2 12.8 + sign verify sign/s verify/s +dsa 512 bits 0.0178s 0.0340s 56.2 29.4 +dsa 1024 bits 0.0552s 0.1077s 18.1 9.3 +dsa 2048 bits 0.1963s 0.3811s 5.1 2.6 diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-100.LN3 b/sample-app/protex_tutorial/OpenSSL/times/586-100.LN3 new file mode 100644 index 0000000..a6fa818 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-100.LN3 @@ -0,0 +1,26 @@ +SSLeay 0.8.3v 15-Oct-1997 +built on Wed Oct 15 10:05:00 EST 1997 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DX86_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 56.27k 156.76k 211.46k 231.77k 238.71k +mdc2 188.74k 206.12k 207.70k 207.87k 208.18k +md5 991.56k 5718.31k 11748.61k 16090.79k 17850.37k +hmac(md5) 387.56k 2636.01k 7327.83k 13340.33k 17091.24k +sha1 463.55k 2274.18k 4071.17k 5072.90k 5447.68k +rc4 3673.94k 4314.52k 4402.26k 4427.09k 4407.30k +des cbc 2023.79k 2209.77k 2233.34k 2220.71k 2222.76k +des ede3 747.17k 778.54k 781.57k 778.24k 778.24k +idea cbc 614.64k 678.04k 683.52k 685.06k 685.40k +rc2 cbc 536.83k 574.10k 578.05k 579.24k 578.90k +blowfish cbc 3673.39k 4354.58k 4450.22k 4429.48k 4377.26k + sign verify +rsa 512 bits 0.0217s 0.0021s +rsa 1024 bits 0.1083s 0.0064s +rsa 2048 bits 0.6867s 0.0223s +rsa 4096 bits 4.9400s 0.0846s + sign verify +dsa 512 bits 0.0203s 0.0387s +dsa 1024 bits 0.0599s 0.1170s +dsa 2048 bits 0.2115s 0.4242s diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-100.NT2 b/sample-app/protex_tutorial/OpenSSL/times/586-100.NT2 new file mode 100644 index 0000000..7f8c167 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-100.NT2 @@ -0,0 +1,26 @@ +SSLeay 0.8.3e 30-Sep-1997 +built on Tue Sep 30 14:52:58 EST 1997 +options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) +C flags:cl /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN -DX86_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 92.99k 257.59k 348.16k 381.47k 392.14k +mdc2 223.77k 235.30k 237.15k 236.77k 237.29k +md5 862.53k 4222.17k 7842.75k 9925.00k 10392.23k +sha 491.34k 2338.61k 4062.28k 4986.10k 5307.90k +sha1 494.38k 2234.94k 3838.83k 4679.58k 4980.18k +rc4 6338.10k 7489.83k 7676.25k 7698.80k 7631.56k +des cbc 1654.17k 1917.66k 1961.05k 1968.05k 1960.69k +des ede3 691.17k 739.42k 744.13k 745.82k 741.40k +idea cbc 788.46k 870.33k 879.16k 881.38k 879.90k +rc2 cbc 794.44k 859.63k 868.24k 869.68k 867.45k +blowfish cbc 2379.88k 3017.48k 3116.12k 3134.76k 3070.50k + sign verify +rsa 512 bits 0.0204s 0.0027s +rsa 1024 bits 0.1074s 0.0032s +rsa 2048 bits 0.6890s 0.0246s +rsa 4096 bits 5.0180s 0.0911s + sign verify +dsa 512 bits 0.0201s 0.0376s +dsa 1024 bits 0.0608s 0.1193s +dsa 2048 bits 0.2133s 0.4294s diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-100.dos b/sample-app/protex_tutorial/OpenSSL/times/586-100.dos new file mode 100644 index 0000000..3085c25 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-100.dos @@ -0,0 +1,24 @@ +ms-dos static libs, 16 bit C and 16 bit assmber + +SSLeay 0.6.1 02-Jul-1996 +built on Tue Jul 9 22:52:54 EST 1996 +options:bn(32,16) md2(char) rc4(idx,int) des(ptr,long) idea(short) +C flags:cl /ALw /Gx- /Gf /G2 /f- /Ocgnotb2 /W3 /WX -DL_ENDIAN /nologo -DMSDOS -DNO_SOCK +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 45.99k 130.75k 176.53k 199.35k 203.21k +md5 236.17k 1072.16k 1839.61k 2221.56k 2383.13k +sha 107.97k 459.10k 757.64k 908.64k 954.99k +sha1 96.95k 409.92k 672.16k 788.40k 844.26k +rc4 1659.14k 1956.30k 2022.72k 2022.72k 2022.72k +des cfb 313.57k 326.86k 326.86k 331.83k 326.86k +des cbc 345.84k 378.82k 378.82k 384.38k 378.82k +des ede3 139.59k 144.66k 144.61k 144.45k 143.29k +idea cfb 262.67k 274.21k 274.21k 274.21k 274.21k +idea cbc 284.32k 318.14k 318.14k 318.14k 318.14k +rc2 cfb 265.33k 274.21k 277.69k 277.11k 277.69k +rc2 cbc 283.71k 310.60k 309.86k 313.57k 314.32k +rsa 512 bits 0.104s +rsa 1024 bits 0.566s +rsa 2048 bits 3.680s +rsa 4096 bits 26.740s diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-100.ln4 b/sample-app/protex_tutorial/OpenSSL/times/586-100.ln4 new file mode 100644 index 0000000..14a9db9 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-100.ln4 @@ -0,0 +1,26 @@ +SSLeay 0.8.3aa 24-Oct-1997 +built on Mon Oct 27 10:16:25 EST 1997 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DMD5_ASM -DSHA1_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 56.78k 156.71k 211.46k 231.77k 238.71k +mdc2 187.45k 200.49k 201.64k 202.75k 202.77k +md5 1002.51k 5798.66k 11967.15k 16449.19k 18251.78k +hmac(md5) 468.71k 3173.46k 8386.99k 14305.56k 17607.34k +sha1 586.98k 2934.87k 5393.58k 6863.19k 7408.30k +rc4 3675.10k 4314.15k 4402.77k 4427.78k 4404.57k +des cbc 1902.96k 2202.01k 2242.30k 2252.46k 2236.42k +des ede3 700.15k 774.23k 783.70k 781.62k 783.70k +idea cbc 618.46k 677.93k 683.61k 685.40k 685.40k +rc2 cbc 536.97k 573.87k 577.96k 579.24k 578.90k +blowfish cbc 3672.66k 4271.89k 4428.80k 4469.76k 4374.53k + sign verify +rsa 512 bits 0.0213s 0.0021s +rsa 1024 bits 0.1075s 0.0063s +rsa 2048 bits 0.6853s 0.0224s +rsa 4096 bits 4.9400s 0.0845s + sign verify +dsa 512 bits 0.0203s 0.0380s +dsa 1024 bits 0.0600s 0.1189s +dsa 2048 bits 0.2110s 0.4250s diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-100.lnx b/sample-app/protex_tutorial/OpenSSL/times/586-100.lnx new file mode 100644 index 0000000..0c05173 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-100.lnx @@ -0,0 +1,23 @@ +SSLeay 0.7.3 30-Apr-1997 +built on Mon May 12 04:13:55 EST 1997 +options:bn(64,32) md2(char) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 72.95k 202.77k 274.01k 300.37k 309.23k +md5 770.57k 4094.02k 7409.41k 9302.36k 9986.05k +sha 363.05k 1571.07k 2613.85k 3134.81k 3320.49k +sha1 340.94k 1462.85k 2419.20k 2892.12k 3042.35k +rc4 3676.91k 4314.94k 4407.47k 4430.51k 4412.76k +des cbc 1489.95k 1799.08k 1841.66k 1851.73k 1848.66k +des ede3 621.93k 711.19k 726.10k 729.77k 729.09k +idea cbc 618.16k 676.99k 683.09k 684.37k 683.59k +rc2 cbc 537.59k 573.93k 578.56k 579.58k 579.70k +blowfish cbc 2077.57k 2682.20k 2827.18k 2840.92k 2842.62k +rsa 512 bits 0.024s 0.003 +rsa 1024 bits 0.120s 0.003 +rsa 2048 bits 0.751s 0.026 +rsa 4096 bits 5.320s 0.096 +dsa 512 bits 0.022s 0.042 +dsa 1024 bits 0.065s 0.126 +dsa 2048 bits 0.227s 0.449 diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-100.nt b/sample-app/protex_tutorial/OpenSSL/times/586-100.nt new file mode 100644 index 0000000..9adcac3 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-100.nt @@ -0,0 +1,23 @@ +SSLeay 0.7.3 30-Apr-1997 +built on Mon May 19 10:47:38 EST 1997 +options:bn(64,32) md2(char) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) +C flags not available +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 89.57k 245.94k 331.59k 362.95k 373.29k +md5 858.93k 4175.51k 7700.21k 9715.78k 10369.11k +sha 466.18k 2103.67k 3607.69k 4399.31k 4669.16k +sha1 449.59k 2041.02k 3496.13k 4256.45k 4512.92k +rc4 5862.55k 7447.27k 7698.80k 7768.38k 7653.84k +des cbc 1562.71k 1879.84k 1928.24k 1938.93k 1911.02k +des ede3 680.27k 707.97k 728.62k 733.15k 725.98k +idea cbc 797.46k 885.85k 895.68k 898.06k 896.45k +rc2 cbc 609.46k 648.75k 654.01k 654.42k 653.60k +blowfish cbc 2357.94k 3000.22k 3106.89k 3134.76k 3080.42k +rsa 512 bits 0.022s 0.003 +rsa 1024 bits 0.112s 0.003 +rsa 2048 bits 0.726s 0.026 +rsa 4096 bits 5.268s 0.095 +dsa 512 bits 0.021s 0.039 +dsa 1024 bits 0.063s 0.127 +dsa 2048 bits 0.224s 0.451 diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-100.ntx b/sample-app/protex_tutorial/OpenSSL/times/586-100.ntx new file mode 100644 index 0000000..35166a5 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-100.ntx @@ -0,0 +1,30 @@ +SSLeay 0.8.5f 22-Jan-1998 +built on Wed Jan 21 17:11:53 EST 1998 +options:bn(64,32) md2(int) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish( +ptr2) +C flags:cl /MT /W3 /WX /G5 /Ox /O2 /Ob2 /Gs0 /GF /Gy /nologo -DWIN32 -DL_ENDIAN +-DBN_ASM -DMD5_ASM -DSHA1_ASM -DRMD160_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 92.99k 257.43k 347.84k 381.82k 392.14k +mdc2 232.19k 253.68k 257.57k 258.70k 258.70k +md5 1094.09k 5974.79k 12139.81k 16487.04k 18291.77k +hmac(md5) 375.70k 2590.04k 7309.70k 13469.18k 17447.19k +sha1 613.78k 2982.93k 5446.44k 6889.46k 7424.86k +rmd160 501.23k 2405.68k 4367.25k 5503.61k 5915.80k +rc4 8167.75k 10429.44k 10839.12k 10929.50k 10772.30k +des cbc 2057.24k 2218.27k 2237.20k 2227.69k 2213.59k +des ede3 719.63k 727.11k 728.77k 719.56k 722.97k +idea cbc 827.67k 888.85k 898.06k 900.30k 898.75k +rc2 cbc 797.46k 862.53k 870.33k 872.58k 870.40k +blowfish cbc 3835.32k 4435.60k 4513.89k 4513.89k 4416.92k +cast cbc 2785.06k 3052.62k 3088.59k 3034.95k 3034.95k + sign verify sign/s verify/s +rsa 512 bits 0.0202s 0.0020s 49.4 500.2 +rsa 1024 bits 0.1030s 0.0063s 9.7 159.4 +rsa 2048 bits 0.6740s 0.0223s 1.5 44.9 +rsa 4096 bits 4.8970s 0.0844s 0.2 11.8 + sign verify sign/s verify/s +dsa 512 bits 0.0191s 0.0361s 52.4 27.7 +dsa 1024 bits 0.0587s 0.1167s 17.0 8.6 +dsa 2048 bits 0.2091s 0.4123s 4.8 2.4 diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-100.w31 b/sample-app/protex_tutorial/OpenSSL/times/586-100.w31 new file mode 100644 index 0000000..d5b1c10 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-100.w31 @@ -0,0 +1,27 @@ +Pentium 100, Windows 3.1 DLL's, 16 bit C, 32bit assember. + +Running under Windows NT 4.0 Beta 2 + +SSLeay 0.6.4 20-Aug-1996 +built on Thu Aug 22 08:44:21 EST 1996 +options:bn(32,32) md2(char) rc4(idx,int) des(ptr,long) idea(short) +C flags:cl /ALw /Gx- /Gf /G2 /f- /Ocgnotb2 /W3 /WX -DL_ENDIAN /nologo -DWIN16 +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 45.83k 128.82k 180.17k 194.90k 198.59k +md5 224.82k 1038.19k 1801.68k 2175.47k 2330.17k +sha 105.11k 448.11k 739.48k 884.13k 944.66k +sha1 94.71k 402.99k 667.88k 795.58k 844.26k +rc4 1614.19k 1956.30k 2022.72k 2022.72k 2022.72k +des cfb 291.27k 318.14k 318.14k 318.14k 322.84k +des cbc 326.86k 356.17k 362.08k 362.08k 367.15k +des ede3 132.40k 139.57k 139.53k 139.37k 140.97k +idea cfb 265.33k 280.67k 280.67k 277.69k 281.27k +idea cbc 274.21k 302.01k 306.24k 306.24k 305.53k +rc2 cfb 264.79k 274.21k 274.78k 274.21k 274.21k +rc2 cbc 281.27k 306.24k 309.86k 305.53k 309.86k +rsa 512 bits 0.058s +rsa 1024 bits 0.280s +rsa 2048 bits 1.430s +rsa 4096 bits 10.600s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/586-1002.lnx b/sample-app/protex_tutorial/OpenSSL/times/586-1002.lnx new file mode 100644 index 0000000..d830bce --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586-1002.lnx @@ -0,0 +1,26 @@ +SSLeay 0.8.3e 30-Sep-1997 +built on Wed Oct 1 03:01:44 EST 1997 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DX86_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 56.21k 156.57k 211.29k 231.77k 237.92k +mdc2 170.99k 191.70k 193.90k 195.58k 195.95k +md5 770.50k 3961.96k 7291.22k 9250.82k 9942.36k +sha 344.93k 1520.77k 2569.81k 3108.52k 3295.91k +sha1 326.20k 1423.74k 2385.15k 2870.95k 3041.96k +rc4 3672.88k 4309.65k 4374.41k 4408.66k 4355.41k +des cbc 1349.73k 1689.05k 1735.34k 1748.99k 1739.43k +des ede3 638.70k 704.00k 711.85k 714.41k 712.70k +idea cbc 619.55k 677.33k 683.26k 685.06k 685.40k +rc2 cbc 521.18k 571.20k 573.46k 578.90k 578.90k +blowfish cbc 2079.67k 2592.49k 2702.34k 2730.33k 2695.17k + sign verify +rsa 512 bits 0.0213s 0.0026s +rsa 1024 bits 0.1099s 0.0031s +rsa 2048 bits 0.7007s 0.0248s +rsa 4096 bits 5.0500s 0.0921s + sign verify +dsa 512 bits 0.0203s 0.0389s +dsa 1024 bits 0.0614s 0.1222s +dsa 2048 bits 0.2149s 0.4283s diff --git a/sample-app/protex_tutorial/OpenSSL/times/586p-100.lnx b/sample-app/protex_tutorial/OpenSSL/times/586p-100.lnx new file mode 100644 index 0000000..561eb31 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/586p-100.lnx @@ -0,0 +1,26 @@ +Pentium 100 - Linux 1.2.13 - gcc 2.7.2p +This is the pentium specific version of gcc + +SSLeay 0.6.4 20-Aug-1996 +built on Thu Aug 22 08:27:58 EST 1996 +options:bn(64,32) md2(char) rc4(idx,int) des(idx,long) idea(int) +C flags:gcc -DL_ENDIAN -DTERMIO -O6 -fomit-frame-pointer -mpentium -Wall +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 74.90k 208.43k 282.11k 309.59k 318.43k +md5 807.08k 4205.67k 7801.51k 9958.06k 10810.71k +sha 405.98k 1821.55k 3119.10k 3799.04k 4052.31k +sha1 389.13k 1699.50k 2852.78k 3437.57k 3656.36k +rc4 3621.15k 4130.07k 4212.74k 4228.44k 4213.42k +des cfb 794.39k 828.37k 831.74k 832.51k 832.85k +des cbc 817.68k 886.17k 894.72k 896.00k 892.93k +des ede3 308.83k 323.29k 324.61k 324.95k 324.95k +idea cfb 690.41k 715.39k 718.51k 719.19k 718.17k +idea cbc 696.80k 760.60k 767.32k 768.68k 770.05k +rc2 cfb 619.91k 639.74k 642.30k 642.73k 641.71k +rc2 cbc 631.99k 671.42k 676.35k 676.18k 677.21k +rsa 512 bits 0.025s +rsa 1024 bits 0.123s +rsa 2048 bits 0.756s +rsa 4096 bits 5.365s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/686-200.bsd b/sample-app/protex_tutorial/OpenSSL/times/686-200.bsd new file mode 100644 index 0000000..f23c580 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/686-200.bsd @@ -0,0 +1,25 @@ +Pentium Pro 200mhz +FreeBSD 2.1.5 +gcc 2.7.2.2 + +SSLeay 0.7.0 30-Jan-1997 +built on Tue Apr 22 12:14:36 EST 1997 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DTERMIOS -D_ANSI_SOURCE -fomit-frame-pointer -O3 -m486 -Wall +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 130.99k 367.68k 499.09k 547.04k 566.50k +md5 1924.98k 8293.50k 13464.41k 16010.39k 16820.68k +sha 1250.75k 5330.43k 8636.88k 10227.36k 10779.14k +sha1 1071.55k 4572.50k 7459.98k 8791.96k 9341.61k +rc4 10724.22k 14546.25k 15240.18k 15259.50k 15265.63k +des cbc 3309.11k 3883.01k 3968.25k 3971.86k 3979.14k +des ede3 1442.98k 1548.33k 1562.48k 1562.00k 1563.33k +idea cbc 2195.69k 2506.39k 2529.59k 2545.66k 2546.54k +rc2 cbc 806.00k 833.52k 837.58k 838.52k 836.69k +blowfish cbc 4687.34k 5949.97k 6182.43k 6248.11k 6226.09k +rsa 512 bits 0.010s +rsa 1024 bits 0.045s +rsa 2048 bits 0.260s +rsa 4096 bits 1.690s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/686-200.lnx b/sample-app/protex_tutorial/OpenSSL/times/686-200.lnx new file mode 100644 index 0000000..a10cc2f --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/686-200.lnx @@ -0,0 +1,26 @@ +SSLeay 0.8.2a 04-Sep-1997 +built on Fri Sep 5 17:37:05 EST 1997 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) C flags:gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 131.02k 368.41k 500.57k 549.21k 566.09k +mdc2 535.60k 589.10k 595.88k 595.97k 594.54k +md5 1801.53k 9674.77k 17484.03k 21849.43k 23592.96k +sha 1261.63k 5533.25k 9285.63k 11187.88k 11913.90k +sha1 1103.13k 4782.53k 7933.78k 9472.34k 10070.70k +rc4 10722.53k 14443.93k 15215.79k 15299.24k 15219.59k +des cbc 3286.57k 3827.73k 3913.39k 3931.82k 3926.70k +des ede3 1443.50k 1549.08k 1561.17k 1566.38k 1564.67k +idea cbc 2203.64k 2508.16k 2538.33k 2543.62k 2547.71k +rc2 cbc 1430.94k 1511.59k 1524.82k 1527.13k 1523.33k +blowfish cbc 4716.07k 5965.82k 6190.17k 6243.67k 6234.11k + sign verify +rsa 512 bits 0.0100s 0.0011s +rsa 1024 bits 0.0451s 0.0012s +rsa 2048 bits 0.2605s 0.0086s +rsa 4096 bits 1.6883s 0.0302s + sign verify +dsa 512 bits 0.0083s 0.0156s +dsa 1024 bits 0.0228s 0.0454s +dsa 2048 bits 0.0719s 0.1446s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/686-200.nt b/sample-app/protex_tutorial/OpenSSL/times/686-200.nt new file mode 100644 index 0000000..c8cbaa0 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/686-200.nt @@ -0,0 +1,24 @@ +built on Tue May 13 08:24:51 EST 1997 +options:bn(64,32) md2(char) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfi +sh(ptr2) +C flags not available +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 156.39k 427.99k 576.14k 628.36k 647.27k +md5 2120.48k 10255.02k 18396.07k 22795.13k 24244.53k +sha 1468.59k 6388.89k 10686.12k 12826.62k 13640.01k +sha1 1393.46k 6013.34k 9974.56k 11932.59k 12633.45k +rc4 13833.46k 19275.29k 20321.24k 20281.93k 20520.08k +des cbc 3382.50k 4104.02k 4152.78k 4194.30k 4194.30k +des ede3 1465.51k 1533.00k 1549.96k 1553.29k 1570.29k +idea cbc 2579.52k 3079.52k 3130.08k 3153.61k 3106.89k +rc2 cbc 1204.57k 1276.42k 1285.81k 1289.76k 1285.81k +blowfish cbc 5229.81k 6374.32k 6574.14k 6574.14k 6594.82k +rsa 512 bits 0.008s 0.001 +rsa 1024 bits 0.038s 0.001 +rsa 2048 bits 0.231s 0.008 +rsa 4096 bits 1.540s 0.027 +dsa 512 bits 0.007s 0.013 +dsa 1024 bits 0.021s 0.040 +dsa 2048 bits 0.066s 0.130 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/L1 b/sample-app/protex_tutorial/OpenSSL/times/L1 new file mode 100644 index 0000000..09253d7 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/L1 @@ -0,0 +1,27 @@ +SSLeay 0.8.3ad 27-Oct-1997 +built on Wed Oct 29 00:36:17 EST 1997 +options:bn(64,32) md2(int) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:gcc -DL_ENDIAN -DTERMIO -DBN_ASM -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DMD5_ASM -DSHA1_ASM +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 56.16k 156.50k 211.46k 231.77k 238.71k +mdc2 183.37k 205.21k 205.57k 209.92k 207.53k +md5 1003.65k 5605.56k 11628.54k 15887.70k 17522.69k +hmac(md5) 411.24k 2803.46k 7616.94k 13475.84k 16864.60k +sha1 542.66k 2843.50k 5320.53k 6833.49k 7389.18k +rc4 3677.15k 4313.73k 4407.89k 4429.82k 4404.57k +des cbc 1787.94k 2174.51k 2236.76k 2249.73k 2230.95k +des ede3 719.46k 777.26k 784.81k 780.29k 783.70k +idea cbc 619.56k 677.89k 684.12k 685.40k 685.40k +rc2 cbc 537.51k 573.93k 578.47k 579.24k 578.90k +blowfish cbc 3226.76k 4221.65k 4424.19k 4468.39k 4377.26k +cast cbc 2866.13k 3165.35k 3263.15k 3287.04k 3233.11k + sign verify +rsa 512 bits 0.0212s 0.0021s +rsa 1024 bits 0.1072s 0.0064s +rsa 2048 bits 0.6853s 0.0222s +rsa 4096 bits 4.9300s 0.0848s + sign verify +dsa 512 bits 0.0200s 0.0380s +dsa 1024 bits 0.0600s 0.1180s +dsa 2048 bits 0.2110s 0.4221s diff --git a/sample-app/protex_tutorial/OpenSSL/times/R10000.t b/sample-app/protex_tutorial/OpenSSL/times/R10000.t new file mode 100644 index 0000000..6b3874c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/R10000.t @@ -0,0 +1,24 @@ +IRIX 6.2 - R10000 195mhz +SLeay 0.6.5a 06-Dec-1996 +built on Tue Dec 24 03:51:45 EST 1996 +options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) +C flags:cc -O2 -DTERMIOS -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 156.34k 424.03k 571.88k 628.88k 646.01k +md5 1885.02k 8181.72k 13440.53k 16020.60k 16947.54k +sha 1587.12k 7022.05k 11951.24k 14440.12k 15462.74k +sha1 1413.13k 6215.86k 10571.16k 12736.22k 13628.51k +rc4 10556.28k 11974.08k 12077.10k 12111.38k 12103.20k +des cfb 2977.71k 3252.27k 3284.36k 3302.66k 3290.54k +des cbc 3298.31k 3704.96k 3771.30k 3730.73k 3778.80k +des ede3 1278.28k 1328.82k 1342.66k 1339.82k 1343.27k +idea cfb 2843.34k 3138.04k 3180.95k 3176.46k 3188.54k +idea cbc 3115.21k 3558.03k 3590.61k 3591.24k 3601.18k +rc2 cfb 2006.66k 2133.33k 2149.03k 2159.36k 2149.71k +rc2 cbc 2167.07k 2315.30k 2338.05k 2329.34k 2333.90k +rsa 512 bits 0.008s +rsa 1024 bits 0.043s +rsa 2048 bits 0.280s +rsa 4096 bits 2.064s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/R4400.t b/sample-app/protex_tutorial/OpenSSL/times/R4400.t new file mode 100644 index 0000000..af8848f --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/R4400.t @@ -0,0 +1,26 @@ +IRIX 5.3 +R4400 200mhz +cc -O2 +SSLeay 0.6.5a 06-Dec-1996 +built on Mon Dec 23 11:51:11 EST 1996 +options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc2,16,long) idea(int) +C flags:cc -O2 -DTERMIOS -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 100.62k 280.25k 380.15k 416.02k 428.82k +md5 828.62k 3525.05k 6311.98k 7742.51k 8328.04k +sha 580.04k 2513.74k 4251.73k 5101.04k 5394.80k +sha1 520.23k 2382.94k 4107.82k 5024.62k 5362.56k +rc4 5871.53k 6323.08k 6357.49k 6392.04k 6305.45k +des cfb 1016.76k 1156.72k 1176.59k 1180.55k 1181.65k +des cbc 1016.38k 1303.81k 1349.10k 1359.41k 1356.62k +des ede3 607.39k 650.74k 655.11k 657.52k 654.18k +idea cfb 1296.10k 1348.66k 1353.80k 1358.75k 1355.40k +idea cbc 1453.90k 1554.68k 1567.84k 1569.89k 1573.57k +rc2 cfb 1199.86k 1251.69k 1253.57k 1259.56k 1251.31k +rc2 cbc 1334.60k 1428.55k 1441.89k 1445.42k 1441.45k +rsa 512 bits 0.024s +rsa 1024 bits 0.125s +rsa 2048 bits 0.806s +rsa 4096 bits 5.800s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/aix.t b/sample-app/protex_tutorial/OpenSSL/times/aix.t new file mode 100644 index 0000000..4f24e39 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/aix.t @@ -0,0 +1,34 @@ +from Paco Garcia +This machine is a Bull Estrella Minitower Model MT604-100 +Processor : PPC604 +P.Speed : 100Mhz +Data/Instr Cache : 16 K +L2 Cache : 256 K +PCI BUS Speed : 33 Mhz +TransfRate PCI : 132 MB/s +Memory : 96 MB + +AIX 4.1.4 + +SSLeay 0.6.6 14-Jan-1997 +built on Mon Jan 13 21:36:03 CUT 1997 +options:bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,4,long) idea(int) blowfish +(idx) +C flags:cc -O -DAIX -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 53.83k 147.46k 197.63k 215.72k 221.70k +md5 1278.13k 5354.77k 8679.60k 10195.09k 10780.56k +sha 1055.34k 4600.37k 7721.30k 9298.94k 9868.63k +sha1 276.90k 1270.25k 2187.95k 2666.84k 2850.82k +rc4 4660.57k 5268.93k 5332.48k 5362.47k 5346.65k +des cbc 1774.16k 1981.10k 1979.56k 2032.71k 1972.25k +des ede3 748.81k 781.42k 785.66k 785.75k 780.84k +idea cbc 2066.19k 2329.58k 2378.91k 2379.86k 2380.89k +rc2 cbc 1278.53k 1379.69k 1389.99k 1393.66k 1389.91k +blowfish cbc 2812.91k 3307.90k 3364.91k 3386.37k 3374.32k +rsa 512 bits 0.019s +rsa 1024 bits 0.096s +rsa 2048 bits 0.614s +rsa 4096 bits 4.433s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/aixold.t b/sample-app/protex_tutorial/OpenSSL/times/aixold.t new file mode 100644 index 0000000..0b51412 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/aixold.t @@ -0,0 +1,23 @@ +SSLeay 0.7.3r 20-May-1997 +built on Mon Jun 2 04:06:32 EST 1997 +options:bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,4,long) idea(int) blowfish(idx) +C flags:cc -O -DAIX -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 19.09k 52.47k 71.23k 77.49k 78.93k +md5 214.56k 941.21k 1585.43k 1883.12k 1988.70k +sha 118.35k 521.65k 860.28k 1042.27k 1100.46k +sha1 109.52k 478.98k 825.90k 995.48k 1049.69k +rc4 1263.63k 1494.24k 1545.70k 1521.66k 1518.99k +des cbc 259.62k 286.55k 287.15k 288.15k 289.45k +des ede3 104.92k 107.88k 109.27k 109.25k 109.96k +idea cbc 291.63k 320.07k 319.40k 320.51k 318.27k +rc2 cbc 220.04k 237.76k 241.44k 245.90k 244.08k +blowfish cbc 407.95k 474.83k 480.99k 485.71k 481.07k +rsa 512 bits 0.157s 0.019 +rsa 1024 bits 0.908s 0.023 +rsa 2048 bits 6.225s 0.218 +rsa 4096 bits 46.500s 0.830 +dsa 512 bits 0.159s 0.312 +dsa 1024 bits 0.536s 1.057 +dsa 2048 bits 1.970s 3.977 diff --git a/sample-app/protex_tutorial/OpenSSL/times/alpha.t b/sample-app/protex_tutorial/OpenSSL/times/alpha.t new file mode 100644 index 0000000..3a7c6c4 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/alpha.t @@ -0,0 +1,81 @@ +SSLeay-051 Alpha gcc -O3 64Bit (assember bn_mul) +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 44.40k 121.56k 162.73k 179.20k 185.01k +md5 780.85k 3278.53k 5281.52k 6327.98k 6684.67k +sha 501.40k 2249.19k 3855.27k 4801.19k 5160.96k +sha-1 384.99k 1759.72k 3113.64k 3946.92k 4229.80k +rc4 3505.05k 3724.54k 3723.78k 3555.33k 3694.68k +des cfb 946.96k 1015.27k 1021.87k 1033.56k 1037.65k +des cbc 1001.24k 1220.20k 1243.31k 1272.73k 1265.87k +des ede3 445.34k 491.65k 500.53k 502.10k 502.44k +idea cfb 643.53k 667.49k 663.81k 666.28k 664.51k +idea cbc 650.42k 735.41k 733.27k 742.74k 745.47k +rsa 512 bits 0.031s +rsa 1024 bits 0.141s +rsa 2048 bits 0.844s +rsa 4096 bits 6.033s + +SSLeay-051 Alpha cc -O2 64bit (assember bn_mul) +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 45.37k 122.86k 165.97k 182.95k 188.42k +md5 842.42k 3629.93k 5916.76k 7039.17k 7364.61k +sha 498.93k 2197.23k 3895.60k 4756.48k 5132.13k +sha-1 382.02k 1757.21k 3112.53k 3865.23k 4128.77k +rc4 2975.25k 3049.33k 3180.97k 3214.68k 3424.26k +des cfb 901.55k 990.83k 1006.08k 1011.19k 1004.89k +des cbc 947.84k 1127.84k 1163.67k 1162.24k 1157.80k +des ede3 435.62k 485.57k 493.67k 491.52k 491.52k +idea cfb 629.31k 648.66k 647.77k 648.53k 649.90k +idea cbc 565.15k 608.00k 613.46k 613.38k 617.13k +rsa 512 bits 0.030s +rsa 1024 bits 0.141s +rsa 2048 bits 0.854s +rsa 4096 bits 6.067s + +des cfb 718.28k 822.64k 833.11k 836.27k 841.05k +des cbc 806.10k 951.42k 975.83k 983.73k 991.23k +des ede3 329.50k 379.11k 387.95k 387.41k 388.33k + +des cfb 871.62k 948.65k 951.81k 953.00k 955.58k +des cbc 953.60k 1174.27k 1206.70k 1216.10k 1216.44k +des ede3 349.34k 418.05k 427.26k 429.74k 431.45k + + + + +SSLeay-045c Alpha gcc -O3 64Bit +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 44.95k 122.22k 164.27k 180.62k 184.66k +md5 808.71k 3371.95k 5415.68k 6385.66k 6684.67k +sha 493.68k 2162.05k 3725.82k 4552.02k 4838.74k +rc4 3317.32k 3649.09k 3728.30k 3744.09k 3691.86k +cfb des 996.45k 1050.77k 1058.30k 1059.16k 1064.96k +cbc des 1096.52k 1255.49k 1282.13k 1289.90k 1299.80k +ede3 des 482.14k 513.51k 518.66k 520.19k 521.39k +cfb idea 519.90k 533.40k 535.21k 535.55k 535.21k +cbc idea 619.34k 682.21k 688.04k 689.15k 690.86k +rsa 512 bits 0.050s +rsa 1024 bits 0.279s +rsa 2048 bits 1.908s +rsa 4096 bits 14.750s + +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 37.31k 102.77k 137.64k 151.55k 155.78k +md5 516.65k 2535.21k 4655.72k 5859.66k 6343.34k +rc4 3519.61k 3707.01k 3746.86k 3755.39k 3675.48k +cfb des 780.27k 894.68k 913.10k 921.26k 922.97k +cbc des 867.54k 1040.13k 1074.17k 1075.54k 1084.07k +ede3 des 357.19k 397.36k 398.08k 402.28k 401.41k +cbc idea 646.53k 686.44k 694.03k 691.20k 693.59k +rsa 512 bits 0.046s +rsa 1024 bits 0.270s +rsa 2048 bits 1.858s +rsa 4096 bits 14.350s + +md2 C 37.83k 103.17k 137.90k 150.87k 155.37k +md2 L 37.30k 102.04k 139.01k 152.74k 155.78k +rc4 I 3532.24k 3718.08k 3750.83k 3768.78k 3694.59k +rc4 CI 2662.97k 2873.26k 2907.22k 2920.63k 2886.31k +rc4 LI 3514.63k 3738.72k 3747.41k 3752.96k 3708.49k +cbc idea S 619.01k 658.68k 661.50k 662.53k 663.55k +cbc idea L 645.69k 684.22k 694.55k 692.57k 690.86k diff --git a/sample-app/protex_tutorial/OpenSSL/times/alpha400.t b/sample-app/protex_tutorial/OpenSSL/times/alpha400.t new file mode 100644 index 0000000..079e0d1 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/alpha400.t @@ -0,0 +1,25 @@ +Alpha EV5.6 (21164A) 400mhz + +SSLeay 0.7.3r 20-May-1997 +built on Mon Jun 2 03:39:58 EST 1997 +options:bn(64,64) md2(int) rc4(ptr,int) des(idx,cisc,4,long) idea(int) blowfish(idx) +C flags:cc -arch host -tune host -fast -std -O4 -inline speed +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 274.98k 760.96k 1034.27k 1124.69k 1148.69k +md5 2524.46k 11602.60k 19838.81k 24075.26k 25745.10k +sha 1848.46k 8335.66k 14232.49k 17247.91k 18530.30k +sha1 1639.67k 7336.53k 12371.80k 14807.72k 15870.63k +rc4 17950.93k 19390.66k 19652.44k 19700.39k 19412.31k +des cbc 4018.59k 4872.06k 4988.76k 5003.26k 4995.73k +des ede3 1809.11k 1965.67k 1984.26k 1986.90k 1982.46k +idea cbc 2848.82k 3204.33k 3250.26k 3257.34k 3260.42k +rc2 cbc 3766.08k 4349.50k 4432.21k 4448.94k 4448.26k +blowfish cbc 6694.88k 9042.35k 9486.93k 9598.98k 9624.91k +rsa 512 bits 0.003s 0.000 +rsa 1024 bits 0.013s 0.000 +rsa 2048 bits 0.081s 0.003 +rsa 4096 bits 0.577s 0.011 +dsa 512 bits 0.003s 0.005 +dsa 1024 bits 0.007s 0.014 +dsa 2048 bits 0.025s 0.050 diff --git a/sample-app/protex_tutorial/OpenSSL/times/cyrix100.lnx b/sample-app/protex_tutorial/OpenSSL/times/cyrix100.lnx new file mode 100644 index 0000000..010a221 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/cyrix100.lnx @@ -0,0 +1,22 @@ +SSLeay 0.6.6 06-Dec-1996 +built on Fri Dec 6 10:05:20 GMT 1996 +options:bn(64,32) md2(char) rc4(idx,int) des(idx,risc,16,long) idea(int) +C flags:gcc -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 36.77k 102.48k 138.00k 151.57k 155.78k +md5 513.59k 2577.22k 4623.51k 5768.99k 6214.53k +sha 259.89k 1105.45k 1814.97k 2156.16k 2292.13k +sha1 242.43k 1040.95k 1719.44k 2049.74k 2164.64k +rc4 1984.48k 2303.41k 2109.37k 2071.47k 1985.61k +des cfb 712.08k 758.29k 753.17k 752.06k 748.67k +des cbc 787.37k 937.64k 956.77k 961.61k 957.54k +des ede3 353.97k 377.28k 379.99k 379.34k 379.11k +idea cfb 403.80k 418.50k 416.60k 415.78k 415.03k +idea cbc 426.54k 466.40k 471.31k 472.67k 473.14k +rc2 cfb 405.15k 420.05k 418.16k 416.72k 416.36k +rc2 cbc 428.21k 468.43k 473.09k 472.59k 474.70k +rsa 512 bits 0.040s +rsa 1024 bits 0.195s +rsa 2048 bits 1.201s +rsa 4096 bits 8.700s diff --git a/sample-app/protex_tutorial/OpenSSL/times/dgux-x86.t b/sample-app/protex_tutorial/OpenSSL/times/dgux-x86.t new file mode 100644 index 0000000..70635c5 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/dgux-x86.t @@ -0,0 +1,23 @@ +version:SSLeay 0.5.2c 15-May-1996 +built Fri Jun 14 19:47:04 EST 1996 +options:bn(LLONG,thirty_two) md2(CHAR) rc4(IDX,int) des(ary,long) idea(int) +C flags:gcc -O3 -fomit-frame-pointer -DL_ENDIAN + +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 113.86k 316.48k 428.36k 467.63k 481.56k +md5 1001.99k 5037.99k 9545.94k 12036.95k 11800.38k +sha 628.77k 2743.48k 5113.42k 6206.99k 6165.42k +sha1 583.83k 2638.66k 4538.85k 5532.09k 5917.04k +rc4 5493.27k 6369.39k 6511.30k 6577.83k 6486.73k +des cfb 1219.01k 1286.06k 1299.33k 1288.87k 1381.72k +des cbc 1360.58k 1469.04k 1456.96k 1454.08k 1513.57k +des ede3 544.45k 567.84k 568.99k 570.37k 566.09k +idea cfb 1012.39k 1056.30k 1063.52k 989.17k 863.24k +idea cbc 985.36k 1090.44k 1105.92k 1108.65k 1090.17k +rc2 cfb 963.86k 979.06k 995.30k 937.35k 827.39k +rc2 cbc 951.72k 1042.11k 1049.60k 1047.21k 1059.11k +rsa 512 bits 0.032s +rsa 1024 bits 0.159s +rsa 2048 bits 1.025s +rsa 4096 bits 7.270s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/dgux.t b/sample-app/protex_tutorial/OpenSSL/times/dgux.t new file mode 100644 index 0000000..c7f7564 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/dgux.t @@ -0,0 +1,17 @@ +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 38.54k 106.28k 144.00k 157.46k 161.72k +md5 323.23k 1471.62k 2546.11k 3100.20k 3309.57k +rc4 I 1902.74k 2055.20k 2080.42k 2077.88k 2065.46k +cfb des 456.23k 475.22k 481.79k 488.42k 487.17k +cbc des 484.30k 537.50k 553.09k 558.08k 558.67k +ede3 des 199.97k 209.05k 211.03k 211.85k 212.78k +cbc idea 478.50k 519.33k 523.42k 525.09k 526.44k +rsa 512 bits 0.159s !RSA_LLONG +rsa 1024 bits 1.053s +rsa 2048 bits 7.600s +rsa 4096 bits 59.760s + +md2 C 30.53k 83.58k 112.84k 123.22k 126.24k +rc4 1844.56k 1975.50k 1997.73k 1994.95k 1984.88k +rc4 C 1800.09k 1968.85k 1995.20k 1992.36k 1996.80k +rc4 CI 1830.81k 2035.75k 2067.28k 2070.23k 2062.77k diff --git a/sample-app/protex_tutorial/OpenSSL/times/hpux-acc.t b/sample-app/protex_tutorial/OpenSSL/times/hpux-acc.t new file mode 100644 index 0000000..0c0e936 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/hpux-acc.t @@ -0,0 +1,25 @@ +HPUX 887 + +SSLeay 0.7.3r 20-May-1997 +built on Mon Jun 2 02:59:45 EST 1997 +options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) blowfish(idx) +C flags:cc -DB_ENDIAN -D_HPUX_SOURCE -Aa -Ae +ESlit +O4 -Wl,-a,archive +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 58.99k 166.85k 225.07k 247.21k 253.76k +md5 639.22k 2726.98k 4477.25k 5312.69k 5605.20k +sha 381.08k 1661.49k 2793.84k 3368.86k 3581.23k +sha1 349.54k 1514.56k 2536.63k 3042.59k 3224.39k +rc4 2891.10k 4238.01k 4464.11k 4532.49k 4545.87k +des cbc 717.05k 808.76k 820.14k 821.97k 821.96k +des ede3 288.21k 303.50k 303.69k 305.82k 305.14k +idea cbc 325.83k 334.36k 335.89k 336.61k 333.43k +rc2 cbc 793.00k 915.81k 926.69k 933.28k 929.53k +blowfish cbc 1561.91k 2051.97k 2122.65k 2139.40k 2145.92k +rsa 512 bits 0.031s 0.004 +rsa 1024 bits 0.164s 0.004 +rsa 2048 bits 1.055s 0.037 +rsa 4096 bits 7.600s 0.137 +dsa 512 bits 0.029s 0.057 +dsa 1024 bits 0.092s 0.177 +dsa 2048 bits 0.325s 0.646 diff --git a/sample-app/protex_tutorial/OpenSSL/times/hpux-kr.t b/sample-app/protex_tutorial/OpenSSL/times/hpux-kr.t new file mode 100644 index 0000000..ad4a0ad --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/hpux-kr.t @@ -0,0 +1,23 @@ +SSLeay 0.7.3r 20-May-1997 +built on Mon Jun 2 02:17:35 EST 1997 +options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,cisc,16,long) idea(int) blowfish(idx) +C flags:cc -DB_ENDIAN -DNOCONST -DNOPROTO -D_HPUX_SOURCE +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 35.30k 98.36k 133.41k 146.34k 150.69k +md5 391.20k 1737.31k 2796.65k 3313.75k 3503.74k +sha 189.55k 848.14k 1436.72k 1735.87k 1848.03k +sha1 175.30k 781.14k 1310.32k 1575.61k 1675.81k +rc4 2070.55k 2501.47k 2556.65k 2578.34k 2584.91k +des cbc 465.13k 536.85k 545.87k 547.86k 548.89k +des ede3 190.05k 200.99k 202.31k 202.22k 202.75k +idea cbc 263.44k 277.77k 282.13k 281.51k 283.15k +rc2 cbc 448.37k 511.39k 519.54k 522.00k 521.31k +blowfish cbc 839.98k 1097.70k 1131.16k 1145.64k 1144.67k +rsa 512 bits 0.048s 0.005 +rsa 1024 bits 0.222s 0.006 +rsa 2048 bits 1.272s 0.042 +rsa 4096 bits 8.445s 0.149 +dsa 512 bits 0.041s 0.077 +dsa 1024 bits 0.111s 0.220 +dsa 2048 bits 0.363s 0.726 diff --git a/sample-app/protex_tutorial/OpenSSL/times/hpux.t b/sample-app/protex_tutorial/OpenSSL/times/hpux.t new file mode 100644 index 0000000..dcf7615 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/hpux.t @@ -0,0 +1,86 @@ +HP-UX A.09.05 9000/712 + +SSLeay 0.6.6 14-Jan-1997 +built on Tue Jan 14 16:36:31 WET 1997 +options:bn(32,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) +blowfish(idx) +C flags:cc -DB_ENDIAN -D_HPUX_SOURCE -Aa +ESlit +O2 -Wl,-a,archive +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 66.56k 184.92k 251.82k 259.86k 282.62k +md5 615.54k 2805.92k 4764.30k 5724.21k 6084.39k +sha 358.23k 1616.46k 2781.50k 3325.72k 3640.89k +sha1 327.50k 1497.98k 2619.44k 3220.26k 3460.85k +rc4 3500.47k 3890.99k 3943.81k 3883.74k 3900.02k +des cbc 742.65k 871.66k 887.15k 891.21k 895.40k +des ede3 302.42k 322.50k 324.46k 326.66k 326.05k +idea cbc 664.41k 755.87k 765.61k 772.70k 773.69k +rc2 cbc 798.78k 931.04k 947.69k 950.31k 952.04k +blowfish cbc 1353.32k 1932.29k 2021.93k 2047.02k 2053.66k +rsa 512 bits 0.059s +rsa 1024 bits 0.372s +rsa 2048 bits 2.697s +rsa 4096 bits 20.790s + +SSLeay 0.6.6 14-Jan-1997 +built on Tue Jan 14 15:37:30 WET 1997 +options:bn(64,32) md2(int) rc4(ptr,int) des(ptr,risc1,16,long) idea(int) +blowfish(idx) +C flags:gcc -DB_ENDIAN -O3 +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 44.91k 122.57k 167.71k 183.89k 190.24k +md5 532.50k 2316.27k 3965.72k 4740.11k 5055.06k +sha 363.76k 1684.09k 2978.53k 3730.86k 3972.72k +sha1 385.76k 1743.53k 2997.69k 3650.74k 3899.08k +rc4 3178.84k 3621.31k 3672.71k 3684.01k 3571.54k +des cbc 733.00k 844.70k 863.28k 863.72k 868.73k +des ede3 289.99k 308.94k 310.11k 309.64k 312.08k +idea cbc 624.07k 713.91k 724.76k 723.35k 725.13k +rc2 cbc 704.34k 793.39k 804.25k 805.99k 782.63k +blowfish cbc 1371.24k 1823.66k 1890.05k 1915.51k 1920.12k +rsa 512 bits 0.030s +rsa 1024 bits 0.156s +rsa 2048 bits 1.113s +rsa 4096 bits 7.480s + + +HPUX B.10.01 V 9000/887 - HP92453-01 A.10.11 HP C Compiler +SSLeay 0.5.2 - -Aa +ESlit +Oall +O4 -Wl,-a,archive + +HPUX A.09.04 B 9000/887 + +ssleay 0.5.1 gcc v 2.7.0 -O3 -mpa-risc-1-1 +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 53.00k 166.81k 205.66k 241.95k 242.20k +md5 743.22k 3128.44k 6031.85k 6142.07k 7025.26k +sha 481.30k 2008.24k 3361.31k 3985.07k 4180.74k +sha-1 463.60k 1916.15k 3139.24k 3786.27k 3997.70k +rc4 3708.61k 4125.16k 4547.53k 4206.21k 4390.07k +des cfb 665.91k 705.97k 698.48k 694.25k 666.08k +des cbc 679.80k 741.90k 769.85k 747.62k 719.47k +des ede3 264.31k 270.22k 265.63k 273.07k 273.07k +idea cfb 635.91k 673.40k 605.60k 699.53k 672.36k +idea cbc 705.85k 774.63k 750.60k 715.83k 721.50k +rsa 512 bits 0.066s +rsa 1024 bits 0.372s +rsa 2048 bits 2.177s +rsa 4096 bits 16.230s + +HP92453-01 A.09.61 HP C Compiler +ssleay 0.5.1 cc -Ae +ESlit +Oall -Wl,-a,archive +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 58.69k 163.30k 213.57k 230.40k 254.23k +md5 608.60k 2596.82k 3871.43k 4684.10k 4763.88k +sha 343.26k 1482.43k 2316.80k 2766.27k 2860.26k +sha-1 319.15k 1324.13k 2106.03k 2527.82k 2747.95k +rc4 2467.47k 3374.41k 3265.49k 3354.39k 3368.55k +des cfb 812.05k 814.90k 851.20k 819.20k 854.56k +des cbc 836.35k 994.06k 916.02k 1020.01k 988.14k +des ede3 369.78k 389.15k 401.01k 382.94k 408.03k +idea cfb 290.40k 298.06k 286.11k 296.92k 299.46k +idea cbc 301.30k 297.72k 304.34k 300.10k 309.70k +rsa 512 bits 0.350s +rsa 1024 bits 2.635s +rsa 2048 bits 19.930s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/p2.w95 b/sample-app/protex_tutorial/OpenSSL/times/p2.w95 new file mode 100644 index 0000000..82d1e55 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/p2.w95 @@ -0,0 +1,22 @@ +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 235.90k 652.30k 893.36k 985.74k 985.74k +mdc2 779.61k 816.81k 825.65k 816.01k 825.65k +md5 2788.77k 13508.23k 24672.38k 30504.03k 33156.55k +sha 1938.22k 8397.01k 14122.24k 16980.99k 18196.55k +sha1 1817.29k 7832.50k 13168.93k 15738.48k 16810.84k +rc4 15887.52k 21709.65k 22745.68k 22995.09k 22995.09k +des cbc 4599.02k 5377.31k 5377.31k 5533.38k 5533.38k +des ede3 1899.59k 2086.71k 2086.67k 2086.51k 2085.90k +idea cbc 3350.08k 3934.62k 3979.42k 4017.53k 4017.53k +rc2 cbc 1534.13k 1630.76k 1625.70k 1644.83k 1653.91k +blowfish cbc 6678.83k 8490.49k 8701.88k 8848.74k 8886.24k + sign verify +rsa 512 bits 0.0062s 0.0008s +rsa 1024 bits 0.0287s 0.0009s +rsa 2048 bits 0.1785s 0.0059s +rsa 4096 bits 1.1300s 0.0205s + sign verify +dsa 512 bits 0.0055s 0.0100s +dsa 1024 bits 0.0154s 0.0299s +dsa 2048 bits 0.0502s 0.0996s diff --git a/sample-app/protex_tutorial/OpenSSL/times/pent2.t b/sample-app/protex_tutorial/OpenSSL/times/pent2.t new file mode 100644 index 0000000..b6dc269 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/pent2.t @@ -0,0 +1,24 @@ +pentium 2, 266mhz, Visual C++ 5.0, Windows 95 + +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 235.90k 652.30k 893.36k 985.74k 985.74k +mdc2 779.61k 816.81k 825.65k 816.01k 825.65k +md5 2788.77k 13508.23k 24672.38k 30504.03k 33156.55k +sha 1938.22k 8397.01k 14122.24k 16980.99k 18196.55k +sha1 1817.29k 7832.50k 13168.93k 15738.48k 16810.84k +rc4 15887.52k 21709.65k 22745.68k 22995.09k 22995.09k +des cbc 4599.02k 5377.31k 5377.31k 5533.38k 5533.38k +des ede3 1899.59k 2086.71k 2086.67k 2086.51k 2085.90k +idea cbc 3350.08k 3934.62k 3979.42k 4017.53k 4017.53k +rc2 cbc 1534.13k 1630.76k 1625.70k 1644.83k 1653.91k +blowfish cbc 6678.83k 8490.49k 8701.88k 8848.74k 8886.24k + sign verify +rsa 512 bits 0.0062s 0.0008s +rsa 1024 bits 0.0287s 0.0009s +rsa 2048 bits 0.1785s 0.0059s +rsa 4096 bits 1.1300s 0.0205s + sign verify +dsa 512 bits 0.0055s 0.0100s +dsa 1024 bits 0.0154s 0.0299s +dsa 2048 bits 0.0502s 0.0996s diff --git a/sample-app/protex_tutorial/OpenSSL/times/readme b/sample-app/protex_tutorial/OpenSSL/times/readme new file mode 100644 index 0000000..7074f58 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/readme @@ -0,0 +1,11 @@ +The 'times' in this directory are not all for the most recent version of +the library and it should be noted that on some CPUs (specifically sparc +and Alpha), the locations of files in the application after linking can +make upto a %10 speed difference when running benchmarks on things like +cbc mode DES. To put it mildly this can be very anoying. + +About the only way to get around this would be to compile the library as one +object file, or to 'include' the source files in a specific order. + +The best way to get an idea of the 'raw' DES speed is to build the +'speed' program in crypto/des. diff --git a/sample-app/protex_tutorial/OpenSSL/times/s586-100.lnx b/sample-app/protex_tutorial/OpenSSL/times/s586-100.lnx new file mode 100644 index 0000000..cbc3e3c --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/s586-100.lnx @@ -0,0 +1,25 @@ +Shared library build + +SSLeay 0.7.3 30-Apr-1997 +built on Tue May 13 03:43:56 EST 1997 +options:bn(64,32) md2(char) rc4(idx,int) des(ptr,risc1,16,long) idea(int) blowfish(ptr2) +C flags:-DTERMIO -O3 -DL_ENDIAN -fomit-frame-pointer -m486 -Wall +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 68.95k 191.40k 258.22k 283.31k 291.21k +md5 627.37k 3064.75k 5370.15k 6765.91k 7255.38k +sha 323.35k 1431.32k 2417.07k 2916.69k 3102.04k +sha1 298.08k 1318.34k 2228.82k 2694.83k 2864.47k +rc4 3404.13k 4026.33k 4107.43k 4136.28k 4117.85k +des cbc 1414.60k 1782.53k 1824.24k 1847.64k 1840.47k +des ede3 588.36k 688.19k 700.33k 702.46k 704.51k +idea cbc 582.96k 636.71k 641.54k 642.39k 642.30k +rc2 cbc 569.34k 612.37k 617.64k 617.47k 619.86k +blowfish cbc 2015.77k 2534.49k 2609.65k 2607.10k 2615.98k +rsa 512 bits 0.027s 0.003 +rsa 1024 bits 0.128s 0.003 +rsa 2048 bits 0.779s 0.027 +rsa 4096 bits 5.450s 0.098 +dsa 512 bits 0.024s 0.045 +dsa 1024 bits 0.068s 0.132 +dsa 2048 bits 0.231s 0.469 diff --git a/sample-app/protex_tutorial/OpenSSL/times/s586-100.nt b/sample-app/protex_tutorial/OpenSSL/times/s586-100.nt new file mode 100644 index 0000000..8e3baf6 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/s586-100.nt @@ -0,0 +1,23 @@ +SSLeay 0.7.3 30-Apr-1997 +built on Mon May 19 10:47:38 EST 1997 +options:bn(64,32) md2(char) rc4(idx,int) des(idx,cisc,4,long) idea(int) blowfish(ptr2) +C flags not available +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 90.26k 248.57k 335.06k 366.09k 376.64k +md5 863.95k 4205.24k 7628.78k 9582.60k 10290.25k +sha 463.93k 2102.51k 3623.28k 4417.85k 4695.29k +sha1 458.23k 2005.88k 3385.78k 4094.00k 4340.13k +rc4 5843.60k 7543.71k 7790.31k 7836.89k 7791.47k +des cbc 1583.95k 1910.67k 1960.69k 1972.12k 1946.13k +des ede3 654.79k 722.60k 740.97k 745.82k 738.27k +idea cbc 792.04k 876.96k 887.35k 892.63k 890.36k +rc2 cbc 603.50k 652.38k 661.85k 662.69k 661.44k +blowfish cbc 2379.88k 3043.76k 3153.61k 3153.61k 3134.76k +rsa 512 bits 0.022s 0.003 +rsa 1024 bits 0.111s 0.003 +rsa 2048 bits 0.716s 0.025 +rsa 4096 bits 5.188s 0.094 +dsa 512 bits 0.020s 0.039 +dsa 1024 bits 0.062s 0.124 +dsa 2048 bits 0.221s 0.441 diff --git a/sample-app/protex_tutorial/OpenSSL/times/sgi.t b/sample-app/protex_tutorial/OpenSSL/times/sgi.t new file mode 100644 index 0000000..7963610 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/sgi.t @@ -0,0 +1,29 @@ +SGI Challenge R4400 200mhz IRIX 5.3 - gcc (2.6.3) +SSLeay 0.6.1 02-Jul-1996 +built on Tue Jul 2 16:25:30 EST 1996 +options:bn(64,32) md2(char) rc4(idx,char) des(idx,long) idea(int) +C flags:gcc -O2 -mips2 -DTERMIOS -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 96.53k 266.70k 360.09k 393.70k 405.07k +md5 971.15k 4382.56k 7406.90k 8979.99k 9559.18k +sha 596.86k 2832.26k 4997.30k 6277.75k 6712.89k +sha1 578.34k 2630.16k 4632.05k 5684.34k 6083.37k +rc4 5641.12k 6821.76k 6996.13k 7052.61k 6913.32k +des cfb 1354.86k 1422.11k 1434.58k 1433.24k 1432.89k +des cbc 1467.13k 1618.92k 1630.08k 1637.00k 1629.62k +des ede3 566.13k 591.91k 596.86k 596.18k 592.54k +idea cfb 1190.60k 1264.49k 1270.38k 1267.84k 1272.37k +idea cbc 1271.45k 1410.37k 1422.49k 1426.46k 1421.73k +rc2 cfb 1285.73k 1371.40k 1380.92k 1383.13k 1379.23k +rc2 cbc 1386.61k 1542.10k 1562.49k 1572.45k 1567.93k +rsa 512 bits 0.018s +rsa 1024 bits 0.106s +rsa 2048 bits 0.738s +rsa 4096 bits 5.535s + +version:SSLeay 0.5.2c 15-May-1996 +rsa 512 bits 0.035s +rsa 1024 bits 0.204s +rsa 2048 bits 1.423s +rsa 4096 bits 10.800s diff --git a/sample-app/protex_tutorial/OpenSSL/times/sparc.t b/sample-app/protex_tutorial/OpenSSL/times/sparc.t new file mode 100644 index 0000000..1611f76 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/sparc.t @@ -0,0 +1,26 @@ +gcc 2.7.2 +Sparc 10 - Solaris 2.3 - 50mhz +SSLeay 0.7.3r 20-May-1997 +built on Mon Jun 2 00:55:51 EST 1997 +options:bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,16,long) idea(int) blowfish(ptr) +C flags:gcc -O3 -fomit-frame-pointer -mv8 -Wall +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 54.88k 154.52k 210.35k 231.08k 237.21k +md5 550.75k 2460.49k 4116.01k 4988.74k 5159.86k +sha 340.28k 1461.76k 2430.10k 2879.87k 2999.15k +sha1 307.27k 1298.41k 2136.26k 2540.07k 2658.28k +rc4 2652.21k 2805.24k 3301.63k 4003.98k 4071.18k +des cbc 811.78k 903.93k 914.19k 921.60k 932.29k +des ede3 328.21k 344.93k 349.64k 351.48k 345.07k +idea cbc 685.06k 727.42k 734.41k 730.11k 739.21k +rc2 cbc 718.59k 777.02k 781.96k 784.38k 782.60k +blowfish cbc 1268.85k 1520.64k 1568.88k 1587.54k 1591.98k +rsa 512 bits 0.037s 0.005 +rsa 1024 bits 0.213s 0.006 +rsa 2048 bits 1.471s 0.053 +rsa 4096 bits 11.100s 0.202 +dsa 512 bits 0.038s 0.074 +dsa 1024 bits 0.128s 0.248 +dsa 2048 bits 0.473s 0.959 + diff --git a/sample-app/protex_tutorial/OpenSSL/times/sparc2 b/sample-app/protex_tutorial/OpenSSL/times/sparc2 new file mode 100644 index 0000000..4b0dd80 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/sparc2 @@ -0,0 +1,21 @@ +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 14.56k 40.25k 54.95k 60.13k 62.18k +mdc2 53.59k 57.45k 58.11k 58.21k 58.51k +md5 176.95k 764.75k 1270.36k 1520.14k 1608.36k +hmac(md5) 55.88k 369.70k 881.15k 1337.05k 1567.40k +sha1 92.69k 419.75k 723.63k 878.82k 939.35k +rc4 1247.28k 1414.09k 1434.30k 1434.34k 1441.13k +des cbc 284.41k 318.58k 323.07k 324.09k 323.87k +des ede3 109.99k 119.99k 121.60k 121.87k 121.66k +idea cbc 43.06k 43.68k 43.84k 43.64k 44.07k +rc2 cbc 278.85k 311.44k 316.50k 316.57k 317.37k +blowfish cbc 468.89k 569.35k 581.61k 568.34k 559.54k +cast cbc 285.84k 338.79k 345.71k 346.19k 341.09k + sign verify +rsa 512 bits 0.4175s 0.0519s +rsa 1024 bits 2.9325s 0.1948s +rsa 2048 bits 22.3600s 0.7669s + sign verify +dsa 512 bits 0.5178s 1.0300s +dsa 1024 bits 1.8780s 3.7167s +dsa 2048 bits 7.3500s 14.4800s diff --git a/sample-app/protex_tutorial/OpenSSL/times/sparcLX.t b/sample-app/protex_tutorial/OpenSSL/times/sparcLX.t new file mode 100644 index 0000000..2fdaed7 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/sparcLX.t @@ -0,0 +1,22 @@ +Sparc Station LX +SSLeay 0.7.3 30-Apr-1997 +built on Thu May 1 10:44:02 EST 1997 +options:bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,16,long) idea(int) blowfish(ptr) +C flags:gcc -O3 -fomit-frame-pointer -mv8 -Wall +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 17.60k 48.72k 66.47k 72.70k 74.72k +md5 226.24k 1082.21k 1982.72k 2594.02k 2717.01k +sha 71.38k 320.71k 551.08k 677.76k 720.90k +sha1 63.08k 280.79k 473.86k 576.94k 608.94k +rc4 1138.30k 1257.67k 1304.49k 1377.78k 1364.42k +des cbc 265.34k 308.85k 314.28k 315.39k 317.20k +des ede3 83.23k 93.13k 94.04k 94.50k 94.63k +idea cbc 254.48k 274.26k 275.88k 274.68k 275.80k +rc2 cbc 328.27k 375.39k 381.43k 381.61k 380.83k +blowfish cbc 487.00k 498.02k 510.12k 515.41k 516.10k +rsa 512 bits 0.093s +rsa 1024 bits 0.537s +rsa 2048 bits 3.823s +rsa 4096 bits 28.650s + diff --git a/sample-app/protex_tutorial/OpenSSL/times/usparc.t b/sample-app/protex_tutorial/OpenSSL/times/usparc.t new file mode 100644 index 0000000..2215624 --- /dev/null +++ b/sample-app/protex_tutorial/OpenSSL/times/usparc.t @@ -0,0 +1,25 @@ +Sparc 2000? - Solaris 2.5.1 - 167mhz Ultra sparc + +SSLeay 0.7.3r 20-May-1997 +built on Mon Jun 2 02:25:48 EST 1997 +options:bn(64,32) md2(int) rc4(ptr,char) des(ptr,risc1,16,long) idea(int) blowfish(ptr) +C flags:cc cc -xtarget=ultra -xarch=v8plus -Xa -xO5 -Xa -DB_ENDIAN +The 'numbers' are in 1000s of bytes per second processed. +type 8 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes +md2 135.23k 389.87k 536.66k 591.87k 603.48k +md5 1534.38k 6160.41k 9842.69k 11446.95k 11993.09k +sha 1178.30k 5020.74k 8532.22k 10275.50k 11010.05k +sha1 1114.22k 4703.94k 7703.81k 9236.14k 9756.67k +rc4 10818.03k 13327.57k 13711.10k 13810.69k 13836.29k +des cbc 3052.44k 3320.02k 3356.25k 3369.98k 3295.91k +des ede3 1310.32k 1359.98k 1367.47k 1362.94k 1362.60k +idea cbc 1749.52k 1833.13k 1844.74k 1848.32k 1848.66k +rc2 cbc 1950.25k 2053.23k 2064.21k 2072.58k 2072.58k +blowfish cbc 4927.16k 5659.75k 5762.73k 5797.55k 5805.40k +rsa 512 bits 0.021s 0.003 +rsa 1024 bits 0.126s 0.003 +rsa 2048 bits 0.888s 0.032 +rsa 4096 bits 6.770s 0.122 +dsa 512 bits 0.022s 0.043 +dsa 1024 bits 0.076s 0.151 +dsa 2048 bits 0.286s 0.574 diff --git a/sample-app/protex_tutorial/RuneKit/RuneKit.exe b/sample-app/protex_tutorial/RuneKit/RuneKit.exe new file mode 100644 index 0000000..a98bf0c Binary files /dev/null and b/sample-app/protex_tutorial/RuneKit/RuneKit.exe differ diff --git a/sample-app/protex_tutorial/apache-ant/LICENSE b/sample-app/protex_tutorial/apache-ant/LICENSE new file mode 100644 index 0000000..c996756 --- /dev/null +++ b/sample-app/protex_tutorial/apache-ant/LICENSE @@ -0,0 +1,49 @@ +/* + * ============================================================================ + * The Apache Software License, Version 1.1 + * ============================================================================ + * + * Copyright (C) 2000-2003 The Apache Software Foundation. All + * rights reserved. + * + * Redistribution and use in source and binary forms, with or without modifica- + * tion, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The end-user documentation included with the redistribution, if any, must + * include the following acknowledgment: "This product includes software + * developed by the Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, if + * and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Ant" and "Apache Software Foundation" must not be used to + * endorse or promote products derived from this software without prior + * written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", nor may + * "Apache" appear in their name, without prior written permission of the + * Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- + * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * This software consists of voluntary contributions made by many individuals + * on behalf of the Apache Software Foundation. For more information on the + * Apache Software Foundation, please see . + * + */ diff --git a/sample-app/protex_tutorial/apache-ant/LICENSE.dom b/sample-app/protex_tutorial/apache-ant/LICENSE.dom new file mode 100644 index 0000000..2959b70 --- /dev/null +++ b/sample-app/protex_tutorial/apache-ant/LICENSE.dom @@ -0,0 +1,71 @@ +This license came from: +http://www.w3.org/Consortium/Legal/copyright-software-19980720 + + +W3C� SOFTWARE NOTICE AND LICENSE +Copyright � 1994-2001 World +Wide Web Consortium, World +Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/ + +This W3C work (including software, documents, or other related +items) is being provided by the copyright holders under the +following license. By obtaining, using and/or copying this work, +you (the licensee) agree that you have read, understood, and will +comply with the following terms and conditions: +Permission to use, copy, modify, and distribute this software +and its documentation, with or without modification,� for any +purpose and without fee or royalty is hereby granted, provided that +you include the following on ALL copies of the software and +documentation or portions thereof, including modifications, that +you make: + +The full text of this NOTICE in a location viewable to users of +the redistributed or derivative work. + +Any pre-existing intellectual property disclaimers, notices, or +terms and conditions. If none exist, a short notice of the +following form (hypertext is preferred, text is permitted) should +be used within the body of any redistributed or derivative code: +"Copyright � [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/" + +Notice of any changes or modifications to the W3C files, +including the date changes were made. (We recommend you provide +URIs to the location from which the code is derived.) + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND +COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF +MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE +USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD +PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, +SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE +SOFTWARE OR DOCUMENTATION. + +The name and trademarks of copyright holders may NOT be used in +advertising or publicity pertaining to the software without +specific, written prior permission. Title to copyright in this +software and any associated documentation will at all times remain +with copyright holders. +____________________________________ +This formulation of W3C's notice and license became active on +August 14 1998 so as to improve compatibility with GPL. This +version ensures that W3C software licensing terms are no more +restrictive than GPL and consequently W3C software may be +distributed in GPL packages. See the older formulation for the +policy prior to this date. Please see our Copyright FAQ for common +questions about using materials from +our site, including specific terms and conditions for packages like +libwww, Amaya, and Jigsaw. +Other questions about this notice can be +directed to site-policy@w3.org. + +webmaster diff --git a/sample-app/protex_tutorial/apache-ant/LICENSE.sax b/sample-app/protex_tutorial/apache-ant/LICENSE.sax new file mode 100644 index 0000000..05bccc9 --- /dev/null +++ b/sample-app/protex_tutorial/apache-ant/LICENSE.sax @@ -0,0 +1,20 @@ +This license came from: http://www.megginson.com/SAX/copying.html + However please note future versions of SAX may be covered + under http://saxproject.org/?selected=pd + + +This page is now out of date -- see the new SAX site at +http://www.saxproject.org/ for more up-to-date +releases and other information. Please change your bookmarks. + + +SAX2 is Free! + +I hereby abandon any property rights to SAX 2.0 (the Simple API for +XML), and release all of the SAX 2.0 source code, compiled code, and +documentation contained in this distribution into the Public Domain. +SAX comes with NO WARRANTY or guarantee of fitness for any +purpose. + +David Megginson, david@megginson.com +2000-05-05 \ No newline at end of file diff --git a/sample-app/protex_tutorial/apache-ant/LICENSE.xerces b/sample-app/protex_tutorial/apache-ant/LICENSE.xerces new file mode 100644 index 0000000..28282b4 --- /dev/null +++ b/sample-app/protex_tutorial/apache-ant/LICENSE.xerces @@ -0,0 +1,56 @@ +/* + * The Apache Software License, Version 1.1 + * + * + * Copyright (c) 1999-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Xerces" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was + * originally based on software copyright (c) 1999, International + * Business Machines, Inc., http://www.ibm.com. For more + * information on the Apache Software Foundation, please see + * . + */ diff --git a/sample-app/protex_tutorial/apache-ant/lib/ant.jar b/sample-app/protex_tutorial/apache-ant/lib/ant.jar new file mode 100644 index 0000000..50dc7b2 Binary files /dev/null and b/sample-app/protex_tutorial/apache-ant/lib/ant.jar differ diff --git a/sample-app/protex_tutorial/apache-ant/lib/optional.jar b/sample-app/protex_tutorial/apache-ant/lib/optional.jar new file mode 100644 index 0000000..4def964 Binary files /dev/null and b/sample-app/protex_tutorial/apache-ant/lib/optional.jar differ diff --git a/sample-app/protex_tutorial/apache-ant/lib/xercesImpl.jar b/sample-app/protex_tutorial/apache-ant/lib/xercesImpl.jar new file mode 100644 index 0000000..c1c8379 Binary files /dev/null and b/sample-app/protex_tutorial/apache-ant/lib/xercesImpl.jar differ diff --git a/sample-app/protex_tutorial/apache-ant/lib/xml-apis.jar b/sample-app/protex_tutorial/apache-ant/lib/xml-apis.jar new file mode 100644 index 0000000..8331d27 Binary files /dev/null and b/sample-app/protex_tutorial/apache-ant/lib/xml-apis.jar differ diff --git a/sample-app/protex_tutorial/blowfish.c b/sample-app/protex_tutorial/blowfish.c new file mode 100644 index 0000000..2595b94 --- /dev/null +++ b/sample-app/protex_tutorial/blowfish.c @@ -0,0 +1,392 @@ +#include "includes.h" +#include "defines.h" +#include "blowfish.h" +#define N 16 + +static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x); +static const uInt32 ORIG_P[16 + 2] = { + 0x243F6A88L, 0x85A308D3L, 0x13198A2EL, 0x03707344L, + 0xA4093822L, 0x299F31D0L, 0x082EFA98L, 0xEC4E6C89L, + 0x452821E6L, 0x38D01377L, 0xBE5466CFL, 0x34E90C6CL, + 0xC0AC29B7L, 0xC97C50DDL, 0x3F84D5B5L, 0xB5470917L, + 0x9216D5D9L, 0x8979FB1BL +}; + +static const uInt32 ORIG_S[4][256] = { + { 0xD1310BA6L, 0x98DFB5ACL, 0x2FFD72DBL, 0xD01ADFB7L, + 0xB8E1AFEDL, 0x6A267E96L, 0xBA7C9045L, 0xF12C7F99L, + 0x24A19947L, 0xB3916CF7L, 0x0801F2E2L, 0x858EFC16L, + 0x636920D8L, 0x71574E69L, 0xA458FEA3L, 0xF4933D7EL, + 0x0D95748FL, 0x728EB658L, 0x718BCD58L, 0x82154AEEL, + 0x7B54A41DL, 0xC25A59B5L, 0x9C30D539L, 0x2AF26013L, + 0xC5D1B023L, 0x286085F0L, 0xCA417918L, 0xB8DB38EFL, + 0x8E79DCB0L, 0x603A180EL, 0x6C9E0E8BL, 0xB01E8A3EL, + 0xD71577C1L, 0xBD314B27L, 0x78AF2FDAL, 0x55605C60L, + 0xE65525F3L, 0xAA55AB94L, 0x57489862L, 0x63E81440L, + 0x55CA396AL, 0x2AAB10B6L, 0xB4CC5C34L, 0x1141E8CEL, + 0xA15486AFL, 0x7C72E993L, 0xB3EE1411L, 0x636FBC2AL, + 0x2BA9C55DL, 0x741831F6L, 0xCE5C3E16L, 0x9B87931EL, + 0xAFD6BA33L, 0x6C24CF5CL, 0x7A325381L, 0x28958677L, + 0x3B8F4898L, 0x6B4BB9AFL, 0xC4BFE81BL, 0x66282193L, + 0x61D809CCL, 0xFB21A991L, 0x487CAC60L, 0x5DEC8032L, + 0xEF845D5DL, 0xE98575B1L, 0xDC262302L, 0xEB651B88L, + 0x23893E81L, 0xD396ACC5L, 0x0F6D6FF3L, 0x83F44239L, + 0x2E0B4482L, 0xA4842004L, 0x69C8F04AL, 0x9E1F9B5EL, + 0x21C66842L, 0xF6E96C9AL, 0x670C9C61L, 0xABD388F0L, + 0x6A51A0D2L, 0xD8542F68L, 0x960FA728L, 0xAB5133A3L, + 0x6EEF0B6CL, 0x137A3BE4L, 0xBA3BF050L, 0x7EFB2A98L, + 0xA1F1651DL, 0x39AF0176L, 0x66CA593EL, 0x82430E88L, + 0x8CEE8619L, 0x456F9FB4L, 0x7D84A5C3L, 0x3B8B5EBEL, + 0xE06F75D8L, 0x85C12073L, 0x401A449FL, 0x56C16AA6L, + 0x4ED3AA62L, 0x363F7706L, 0x1BFEDF72L, 0x429B023DL, + 0x37D0D724L, 0xD00A1248L, 0xDB0FEAD3L, 0x49F1C09BL, + 0x075372C9L, 0x80991B7BL, 0x25D479D8L, 0xF6E8DEF7L, + 0xE3FE501AL, 0xB6794C3BL, 0x976CE0BDL, 0x04C006BAL, + 0xC1A94FB6L, 0x409F60C4L, 0x5E5C9EC2L, 0x196A2463L, + 0x68FB6FAFL, 0x3E6C53B5L, 0x1339B2EBL, 0x3B52EC6FL, + 0x6DFC511FL, 0x9B30952CL, 0xCC814544L, 0xAF5EBD09L, + 0xBEE3D004L, 0xDE334AFDL, 0x660F2807L, 0x192E4BB3L, + 0xC0CBA857L, 0x45C8740FL, 0xD20B5F39L, 0xB9D3FBDBL, + 0x5579C0BDL, 0x1A60320AL, 0xD6A100C6L, 0x402C7279L, + 0x679F25FEL, 0xFB1FA3CCL, 0x8EA5E9F8L, 0xDB3222F8L, + 0x3C7516DFL, 0xFD616B15L, 0x2F501EC8L, 0xAD0552ABL, + 0x323DB5FAL, 0xFD238760L, 0x53317B48L, 0x3E00DF82L, + 0x9E5C57BBL, 0xCA6F8CA0L, 0x1A87562EL, 0xDF1769DBL, + 0xD542A8F6L, 0x287EFFC3L, 0xAC6732C6L, 0x8C4F5573L, + 0x695B27B0L, 0xBBCA58C8L, 0xE1FFA35DL, 0xB8F011A0L, + 0x10FA3D98L, 0xFD2183B8L, 0x4AFCB56CL, 0x2DD1D35BL, + 0x9A53E479L, 0xB6F84565L, 0xD28E49BCL, 0x4BFB9790L, + 0xE1DDF2DAL, 0xA4CB7E33L, 0x62FB1341L, 0xCEE4C6E8L, + 0xEF20CADAL, 0x36774C01L, 0xD07E9EFEL, 0x2BF11FB4L, + 0x95DBDA4DL, 0xAE909198L, 0xEAAD8E71L, 0x6B93D5A0L, + 0xD08ED1D0L, 0xAFC725E0L, 0x8E3C5B2FL, 0x8E7594B7L, + 0x8FF6E2FBL, 0xF2122B64L, 0x8888B812L, 0x900DF01CL, + 0x4FAD5EA0L, 0x688FC31CL, 0xD1CFF191L, 0xB3A8C1ADL, + 0x2F2F2218L, 0xBE0E1777L, 0xEA752DFEL, 0x8B021FA1L, + 0xE5A0CC0FL, 0xB56F74E8L, 0x18ACF3D6L, 0xCE89E299L, + 0xB4A84FE0L, 0xFD13E0B7L, 0x7CC43B81L, 0xD2ADA8D9L, + 0x165FA266L, 0x80957705L, 0x93CC7314L, 0x211A1477L, + 0xE6AD2065L, 0x77B5FA86L, 0xC75442F5L, 0xFB9D35CFL, + 0xEBCDAF0CL, 0x7B3E89A0L, 0xD6411BD3L, 0xAE1E7E49L, + 0x00250E2DL, 0x2071B35EL, 0x226800BBL, 0x57B8E0AFL, + 0x2464369BL, 0xF009B91EL, 0x5563911DL, 0x59DFA6AAL, + 0x78C14389L, 0xD95A537FL, 0x207D5BA2L, 0x02E5B9C5L, + 0x83260376L, 0x6295CFA9L, 0x11C81968L, 0x4E734A41L, + 0xB3472DCAL, 0x7B14A94AL, 0x1B510052L, 0x9A532915L, + 0xD60F573FL, 0xBC9BC6E4L, 0x2B60A476L, 0x81E67400L, + 0x08BA6FB5L, 0x571BE91FL, 0xF296EC6BL, 0x2A0DD915L, + 0xB6636521L, 0xE7B9F9B6L, 0xFF34052EL, 0xC5855664L, + 0x53B02D5DL, 0xA99F8FA1L, 0x08BA4799L, 0x6E85076AL }, + + { 0x4B7A70E9L, 0xB5B32944L, 0xDB75092EL, 0xC4192623L, + 0xAD6EA6B0L, 0x49A7DF7DL, 0x9CEE60B8L, 0x8FEDB266L, + 0xECAA8C71L, 0x699A17FFL, 0x5664526CL, 0xC2B19EE1L, + 0x193602A5L, 0x75094C29L, 0xA0591340L, 0xE4183A3EL, + 0x3F54989AL, 0x5B429D65L, 0x6B8FE4D6L, 0x99F73FD6L, + 0xA1D29C07L, 0xEFE830F5L, 0x4D2D38E6L, 0xF0255DC1L, + 0x4CDD2086L, 0x8470EB26L, 0x6382E9C6L, 0x021ECC5EL, + 0x09686B3FL, 0x3EBAEFC9L, 0x3C971814L, 0x6B6A70A1L, + 0x687F3584L, 0x52A0E286L, 0xB79C5305L, 0xAA500737L, + 0x3E07841CL, 0x7FDEAE5CL, 0x8E7D44ECL, 0x5716F2B8L, + 0xB03ADA37L, 0xF0500C0DL, 0xF01C1F04L, 0x0200B3FFL, + 0xAE0CF51AL, 0x3CB574B2L, 0x25837A58L, 0xDC0921BDL, + 0xD19113F9L, 0x7CA92FF6L, 0x94324773L, 0x22F54701L, + 0x3AE5E581L, 0x37C2DADCL, 0xC8B57634L, 0x9AF3DDA7L, + 0xA9446146L, 0x0FD0030EL, 0xECC8C73EL, 0xA4751E41L, + 0xE238CD99L, 0x3BEA0E2FL, 0x3280BBA1L, 0x183EB331L, + 0x4E548B38L, 0x4F6DB908L, 0x6F420D03L, 0xF60A04BFL, + 0x2CB81290L, 0x24977C79L, 0x5679B072L, 0xBCAF89AFL, + 0xDE9A771FL, 0xD9930810L, 0xB38BAE12L, 0xDCCF3F2EL, + 0x5512721FL, 0x2E6B7124L, 0x501ADDE6L, 0x9F84CD87L, + 0x7A584718L, 0x7408DA17L, 0xBC9F9ABCL, 0xE94B7D8CL, + 0xEC7AEC3AL, 0xDB851DFAL, 0x63094366L, 0xC464C3D2L, + 0xEF1C1847L, 0x3215D908L, 0xDD433B37L, 0x24C2BA16L, + 0x12A14D43L, 0x2A65C451L, 0x50940002L, 0x133AE4DDL, + 0x71DFF89EL, 0x10314E55L, 0x81AC77D6L, 0x5F11199BL, + 0x043556F1L, 0xD7A3C76BL, 0x3C11183BL, 0x5924A509L, + 0xF28FE6EDL, 0x97F1FBFAL, 0x9EBABF2CL, 0x1E153C6EL, + 0x86E34570L, 0xEAE96FB1L, 0x860E5E0AL, 0x5A3E2AB3L, + 0x771FE71CL, 0x4E3D06FAL, 0x2965DCB9L, 0x99E71D0FL, + 0x803E89D6L, 0x5266C825L, 0x2E4CC978L, 0x9C10B36AL, + 0xC6150EBAL, 0x94E2EA78L, 0xA5FC3C53L, 0x1E0A2DF4L, + 0xF2F74EA7L, 0x361D2B3DL, 0x1939260FL, 0x19C27960L, + 0x5223A708L, 0xF71312B6L, 0xEBADFE6EL, 0xEAC31F66L, + 0xE3BC4595L, 0xA67BC883L, 0xB17F37D1L, 0x018CFF28L, + 0xC332DDEFL, 0xBE6C5AA5L, 0x65582185L, 0x68AB9802L, + 0xEECEA50FL, 0xDB2F953BL, 0x2AEF7DADL, 0x5B6E2F84L, + 0x1521B628L, 0x29076170L, 0xECDD4775L, 0x619F1510L, + 0x13CCA830L, 0xEB61BD96L, 0x0334FE1EL, 0xAA0363CFL, + 0xB5735C90L, 0x4C70A239L, 0xD59E9E0BL, 0xCBAADE14L, + 0xEECC86BCL, 0x60622CA7L, 0x9CAB5CABL, 0xB2F3846EL, + 0x648B1EAFL, 0x19BDF0CAL, 0xA02369B9L, 0x655ABB50L, + 0x40685A32L, 0x3C2AB4B3L, 0x319EE9D5L, 0xC021B8F7L, + 0x9B540B19L, 0x875FA099L, 0x95F7997EL, 0x623D7DA8L, + 0xF837889AL, 0x97E32D77L, 0x11ED935FL, 0x16681281L, + 0x0E358829L, 0xC7E61FD6L, 0x96DEDFA1L, 0x7858BA99L, + 0x57F584A5L, 0x1B227263L, 0x9B83C3FFL, 0x1AC24696L, + 0xCDB30AEBL, 0x532E3054L, 0x8FD948E4L, 0x6DBC3128L, + 0x58EBF2EFL, 0x34C6FFEAL, 0xFE28ED61L, 0xEE7C3C73L, + 0x5D4A14D9L, 0xE864B7E3L, 0x42105D14L, 0x203E13E0L, + 0x45EEE2B6L, 0xA3AAABEAL, 0xDB6C4F15L, 0xFACB4FD0L, + 0xC742F442L, 0xEF6ABBB5L, 0x654F3B1DL, 0x41CD2105L, + 0xD81E799EL, 0x86854DC7L, 0xE44B476AL, 0x3D816250L, + 0xCF62A1F2L, 0x5B8D2646L, 0xFC8883A0L, 0xC1C7B6A3L, + 0x7F1524C3L, 0x69CB7492L, 0x47848A0BL, 0x5692B285L, + 0x095BBF00L, 0xAD19489DL, 0x1462B174L, 0x23820E00L, + 0x58428D2AL, 0x0C55F5EAL, 0x1DADF43EL, 0x233F7061L, + 0x3372F092L, 0x8D937E41L, 0xD65FECF1L, 0x6C223BDBL, + 0x7CDE3759L, 0xCBEE7460L, 0x4085F2A7L, 0xCE77326EL, + 0xA6078084L, 0x19F8509EL, 0xE8EFD855L, 0x61D99735L, + 0xA969A7AAL, 0xC50C06C2L, 0x5A04ABFCL, 0x800BCADCL, + 0x9E447A2EL, 0xC3453484L, 0xFDD56705L, 0x0E1E9EC9L, + 0xDB73DBD3L, 0x105588CDL, 0x675FDA79L, 0xE3674340L, + 0xC5C43465L, 0x713E38D8L, 0x3D28F89EL, 0xF16DFF20L, + 0x153E21E7L, 0x8FB03D4AL, 0xE6E39F2BL, 0xDB83ADF7L }, + + { 0xE93D5A68L, 0x948140F7L, 0xF64C261CL, 0x94692934L, + 0x411520F7L, 0x7602D4F7L, 0xBCF46B2EL, 0xD4A20068L, + 0xD4082471L, 0x3320F46AL, 0x43B7D4B7L, 0x500061AFL, + 0x1E39F62EL, 0x97244546L, 0x14214F74L, 0xBF8B8840L, + 0x4D95FC1DL, 0x96B591AFL, 0x70F4DDD3L, 0x66A02F45L, + 0xBFBC09ECL, 0x03BD9785L, 0x7FAC6DD0L, 0x31CB8504L, + 0x96EB27B3L, 0x55FD3941L, 0xDA2547E6L, 0xABCA0A9AL, + 0x28507825L, 0x530429F4L, 0x0A2C86DAL, 0xE9B66DFBL, + 0x68DC1462L, 0xD7486900L, 0x680EC0A4L, 0x27A18DEEL, + 0x4F3FFEA2L, 0xE887AD8CL, 0xB58CE006L, 0x7AF4D6B6L, + 0xAACE1E7CL, 0xD3375FECL, 0xCE78A399L, 0x406B2A42L, + 0x20FE9E35L, 0xD9F385B9L, 0xEE39D7ABL, 0x3B124E8BL, + 0x1DC9FAF7L, 0x4B6D1856L, 0x26A36631L, 0xEAE397B2L, + 0x3A6EFA74L, 0xDD5B4332L, 0x6841E7F7L, 0xCA7820FBL, + 0xFB0AF54EL, 0xD8FEB397L, 0x454056ACL, 0xBA489527L, + 0x55533A3AL, 0x20838D87L, 0xFE6BA9B7L, 0xD096954BL, + 0x55A867BCL, 0xA1159A58L, 0xCCA92963L, 0x99E1DB33L, + 0xA62A4A56L, 0x3F3125F9L, 0x5EF47E1CL, 0x9029317CL, + 0xFDF8E802L, 0x04272F70L, 0x80BB155CL, 0x05282CE3L, + 0x95C11548L, 0xE4C66D22L, 0x48C1133FL, 0xC70F86DCL, + 0x07F9C9EEL, 0x41041F0FL, 0x404779A4L, 0x5D886E17L, + 0x325F51EBL, 0xD59BC0D1L, 0xF2BCC18FL, 0x41113564L, + 0x257B7834L, 0x602A9C60L, 0xDFF8E8A3L, 0x1F636C1BL, + 0x0E12B4C2L, 0x02E1329EL, 0xAF664FD1L, 0xCAD18115L, + 0x6B2395E0L, 0x333E92E1L, 0x3B240B62L, 0xEEBEB922L, + 0x85B2A20EL, 0xE6BA0D99L, 0xDE720C8CL, 0x2DA2F728L, + 0xD0127845L, 0x95B794FDL, 0x647D0862L, 0xE7CCF5F0L, + 0x5449A36FL, 0x877D48FAL, 0xC39DFD27L, 0xF33E8D1EL, + 0x0A476341L, 0x992EFF74L, 0x3A6F6EABL, 0xF4F8FD37L, + 0xA812DC60L, 0xA1EBDDF8L, 0x991BE14CL, 0xDB6E6B0DL, + 0xC67B5510L, 0x6D672C37L, 0x2765D43BL, 0xDCD0E804L, + 0xF1290DC7L, 0xCC00FFA3L, 0xB5390F92L, 0x690FED0BL, + 0x667B9FFBL, 0xCEDB7D9CL, 0xA091CF0BL, 0xD9155EA3L, + 0xBB132F88L, 0x515BAD24L, 0x7B9479BFL, 0x763BD6EBL, + 0x37392EB3L, 0xCC115979L, 0x8026E297L, 0xF42E312DL, + 0x6842ADA7L, 0xC66A2B3BL, 0x12754CCCL, 0x782EF11CL, + 0x6A124237L, 0xB79251E7L, 0x06A1BBE6L, 0x4BFB6350L, + 0x1A6B1018L, 0x11CAEDFAL, 0x3D25BDD8L, 0xE2E1C3C9L, + 0x44421659L, 0x0A121386L, 0xD90CEC6EL, 0xD5ABEA2AL, + 0x64AF674EL, 0xDA86A85FL, 0xBEBFE988L, 0x64E4C3FEL, + 0x9DBC8057L, 0xF0F7C086L, 0x60787BF8L, 0x6003604DL, + 0xD1FD8346L, 0xF6381FB0L, 0x7745AE04L, 0xD736FCCCL, + 0x83426B33L, 0xF01EAB71L, 0xB0804187L, 0x3C005E5FL, + 0x77A057BEL, 0xBDE8AE24L, 0x55464299L, 0xBF582E61L, + 0x4E58F48FL, 0xF2DDFDA2L, 0xF474EF38L, 0x8789BDC2L, + 0x5366F9C3L, 0xC8B38E74L, 0xB475F255L, 0x46FCD9B9L, + 0x7AEB2661L, 0x8B1DDF84L, 0x846A0E79L, 0x915F95E2L, + 0x466E598EL, 0x20B45770L, 0x8CD55591L, 0xC902DE4CL, + 0xB90BACE1L, 0xBB8205D0L, 0x11A86248L, 0x7574A99EL, + 0xB77F19B6L, 0xE0A9DC09L, 0x662D09A1L, 0xC4324633L, + 0xE85A1F02L, 0x09F0BE8CL, 0x4A99A025L, 0x1D6EFE10L, + 0x1AB93D1DL, 0x0BA5A4DFL, 0xA186F20FL, 0x2868F169L, + 0xDCB7DA83L, 0x573906FEL, 0xA1E2CE9BL, 0x4FCD7F52L, + 0x50115E01L, 0xA70683FAL, 0xA002B5C4L, 0x0DE6D027L, + 0x9AF88C27L, 0x773F8641L, 0xC3604C06L, 0x61A806B5L, + 0xF0177A28L, 0xC0F586E0L, 0x006058AAL, 0x30DC7D62L, + 0x11E69ED7L, 0x2338EA63L, 0x53C2DD94L, 0xC2C21634L, + 0xBBCBEE56L, 0x90BCB6DEL, 0xEBFC7DA1L, 0xCE591D76L, + 0x6F05E409L, 0x4B7C0188L, 0x39720A3DL, 0x7C927C24L, + 0x86E3725FL, 0x724D9DB9L, 0x1AC15BB4L, 0xD39EB8FCL, + 0xED545578L, 0x08FCA5B5L, 0xD83D7CD3L, 0x4DAD0FC4L, + 0x1E50EF5EL, 0xB161E6F8L, 0xA28514D9L, 0x6C51133CL, + 0x6FD5C7E7L, 0x56E14EC4L, 0x362ABFCEL, 0xDDC6C837L, + 0xD79A3234L, 0x92638212L, 0x670EFA8EL, 0x406000E0L }, + + { 0x3A39CE37L, 0xD3FAF5CFL, 0xABC27737L, 0x5AC52D1BL, + 0x5CB0679EL, 0x4FA33742L, 0xD3822740L, 0x99BC9BBEL, + 0xD5118E9DL, 0xBF0F7315L, 0xD62D1C7EL, 0xC700C47BL, + 0xB78C1B6BL, 0x21A19045L, 0xB26EB1BEL, 0x6A366EB4L, + 0x5748AB2FL, 0xBC946E79L, 0xC6A376D2L, 0x6549C2C8L, + 0x530FF8EEL, 0x468DDE7DL, 0xD5730A1DL, 0x4CD04DC6L, + 0x2939BBDBL, 0xA9BA4650L, 0xAC9526E8L, 0xBE5EE304L, + 0xA1FAD5F0L, 0x6A2D519AL, 0x63EF8CE2L, 0x9A86EE22L, + 0xC089C2B8L, 0x43242EF6L, 0xA51E03AAL, 0x9CF2D0A4L, + 0x83C061BAL, 0x9BE96A4DL, 0x8FE51550L, 0xBA645BD6L, + 0x2826A2F9L, 0xA73A3AE1L, 0x4BA99586L, 0xEF5562E9L, + 0xC72FEFD3L, 0xF752F7DAL, 0x3F046F69L, 0x77FA0A59L, + 0x80E4A915L, 0x87B08601L, 0x9B09E6ADL, 0x3B3EE593L, + 0xE990FD5AL, 0x9E34D797L, 0x2CF0B7D9L, 0x022B8B51L, + 0x96D5AC3AL, 0x017DA67DL, 0xD1CF3ED6L, 0x7C7D2D28L, + 0x1F9F25CFL, 0xADF2B89BL, 0x5AD6B472L, 0x5A88F54CL, + 0xE029AC71L, 0xE019A5E6L, 0x47B0ACFDL, 0xED93FA9BL, + 0xE8D3C48DL, 0x283B57CCL, 0xF8D56629L, 0x79132E28L, + 0x785F0191L, 0xED756055L, 0xF7960E44L, 0xE3D35E8CL, + 0x15056DD4L, 0x88F46DBAL, 0x03A16125L, 0x0564F0BDL, + 0xC3EB9E15L, 0x3C9057A2L, 0x97271AECL, 0xA93A072AL, + 0x1B3F6D9BL, 0x1E6321F5L, 0xF59C66FBL, 0x26DCF319L, + 0x7533D928L, 0xB155FDF5L, 0x03563482L, 0x8ABA3CBBL, + 0x28517711L, 0xC20AD9F8L, 0xABCC5167L, 0xCCAD925FL, + 0x4DE81751L, 0x3830DC8EL, 0x379D5862L, 0x9320F991L, + 0xEA7A90C2L, 0xFB3E7BCEL, 0x5121CE64L, 0x774FBE32L, + 0xA8B6E37EL, 0xC3293D46L, 0x48DE5369L, 0x6413E680L, + 0xA2AE0810L, 0xDD6DB224L, 0x69852DFDL, 0x09072166L, + 0xB39A460AL, 0x6445C0DDL, 0x586CDECFL, 0x1C20C8AEL, + 0x5BBEF7DDL, 0x1B588D40L, 0xCCD2017FL, 0x6BB4E3BBL, + 0xDDA26A7EL, 0x3A59FF45L, 0x3E350A44L, 0xBCB4CDD5L, + 0x72EACEA8L, 0xFA6484BBL, 0x8D6612AEL, 0xBF3C6F47L, + 0xD29BE463L, 0x542F5D9EL, 0xAEC2771BL, 0xF64E6370L, + 0x740E0D8DL, 0xE75B1357L, 0xF8721671L, 0xAF537D5DL, + 0x4040CB08L, 0x4EB4E2CCL, 0x34D2466AL, 0x0115AF84L, + 0xE1B00428L, 0x95983A1DL, 0x06B89FB4L, 0xCE6EA048L, + 0x6F3F3B82L, 0x3520AB82L, 0x011A1D4BL, 0x277227F8L, + 0x611560B1L, 0xE7933FDCL, 0xBB3A792BL, 0x344525BDL, + 0xA08839E1L, 0x51CE794BL, 0x2F32C9B7L, 0xA01FBAC9L, + 0xE01CC87EL, 0xBCC7D1F6L, 0xCF0111C3L, 0xA1E8AAC7L, + 0x1A908749L, 0xD44FBD9AL, 0xD0DADECBL, 0xD50ADA38L, + 0x0339C32AL, 0xC6913667L, 0x8DF9317CL, 0xE0B12B4FL, + 0xF79E59B7L, 0x43F5BB3AL, 0xF2D519FFL, 0x27D9459CL, + 0xBF97222CL, 0x15E6FC2AL, 0x0F91FC71L, 0x9B941525L, + 0xFAE59361L, 0xCEB69CEBL, 0xC2A86459L, 0x12BAA8D1L, + 0xB6C1075EL, 0xE3056A0CL, 0x10D25065L, 0xCB03A442L, + 0xE0EC6E0EL, 0x1698DB3BL, 0x4C98A0BEL, 0x3278E964L, + 0x9F1F9532L, 0xE0D392DFL, 0xD3A0342BL, 0x8971F21EL, + 0x1B0A7441L, 0x4BA3348CL, 0xC5BE7120L, 0xC37632D8L, + 0xDF359F8DL, 0x9B992F2EL, 0xE60B6F47L, 0x0FE3F11DL, + 0xE54CDA54L, 0x1EDAD891L, 0xCE6279CFL, 0xCD3E7E6FL, + 0x1618B166L, 0xFD2C1D05L, 0x848FD2C5L, 0xF6FB2299L, + 0xF523F357L, 0xA6327623L, 0x93A83531L, 0x56CCCD02L, + 0xACF08162L, 0x5A75EBB5L, 0x6E163697L, 0x88D273CCL, + 0xDE966292L, 0x81B949D0L, 0x4C50901BL, 0x71C65614L, + 0xE6C6C7BDL, 0x327A140AL, 0x45E1D006L, 0xC3F27B9AL, + 0xC9AA53FDL, 0x62A80F00L, 0xBB25BFE2L, 0x35BDD2F6L, + 0x71126905L, 0xB2040222L, 0xB6CBCF7CL, 0xCD769C2BL, + 0x53113EC0L, 0x1640E3D3L, 0x38ABBD60L, 0x2547ADF0L, + 0xBA38209CL, 0xF746CE76L, 0x77AFA1C5L, 0x20756060L, + 0x85CBFE4EL, 0x8AE88DD8L, 0x7AAAF9B0L, 0x4CF9AA7EL, + 0x1948C25CL, 0x02FB8A8CL, 0x01C36AE4L, 0xD6EBE1F9L, + 0x90D4F869L, 0xA65CDEA0L, 0x3F09252DL, 0xC208E69FL, + 0xB74E6132L, 0xCE77E25BL, 0x578FDFE3L, 0x3AC372E6L } +}; +uInt32 F(BLOWFISH_CTX *ctx, uInt32 x) { + unsigned short a, b, c, d; + uInt32 y; + + d = x & 0x00FF; + x >>= 8; + c = x & 0x00FF; + x >>= 8; + b = x & 0x00FF; + x >>= 8; + a = x & 0x00FF; + + y = ctx->S[0][a] + ctx->S[1][b]; + y = y ^ ctx->S[2][c]; + y = y + ctx->S[3][d]; + return y; +} + +void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 +*xr) { + uInt32 Xl; + uInt32 Xr; + uInt32 temp; + short i; + + Xl = *xl; + Xr = *xr; + + for (i = 0; i < N; ++i) { + Xl = Xl ^ ctx->P[i]; + Xr = F(ctx, Xl) ^ Xr; + temp = Xl; + Xl = Xr; + Xr = temp; + } + + temp = Xl; + Xl = Xr; + Xr = temp; + Xr = Xr ^ ctx->P[N]; + Xl = Xl ^ ctx->P[N + 1]; + *xl = Xl; + *xr = Xr; +} + +void Blowfish_Decrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32 +*xr) { + uInt32 Xl; + uInt32 Xr; + uInt32 temp; + short i; + + Xl = *xl; + Xr = *xr; + + for (i = N + 1; i > 1; --i) { + Xl = Xl ^ ctx->P[i]; + Xr = F(ctx, Xl) ^ Xr; + /* Exchange Xl and Xr */ + temp = Xl; + Xl = Xr; + Xr = temp; + } + + /* Exchange Xl and Xr */ + temp = Xl; + Xl = Xr; + Xr = temp; + Xr = Xr ^ ctx->P[1]; + Xl = Xl ^ ctx->P[0]; + *xl = Xl; + *xr = Xr; +} + +void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen) { + int i, j, k; + uInt32 data, datal, datar; + + for (i = 0; i < 4; i++) { + + for (j = 0; j < 256; j++) + ctx->S[i][j] = ORIG_S[i][j]; + } + + j = 0; + + for (i = 0; i < N + 2; ++i) { + data = 0x00000000; + + for (k = 0; k < 4; ++k) { + data = (data << 8) | key[j]; + j = j + 1; + if (j >= keyLen) + j = 0; + } + + ctx->P[i] = ORIG_P[i] ^ data; + } + + datal = 0x00000000; + datar = 0x00000000; + + for (i = 0; i < N + 2; i += 2) { + Blowfish_Encrypt(ctx, &datal, &datar); + ctx->P[i] = datal; + ctx->P[i + 1] = datar; + } + + for (i = 0; i < 4; ++i) { + + for (j = 0; j < 256; j += 2) { + Blowfish_Encrypt(ctx, &datal, &datar); + ctx->S[i][j] = datal; + ctx->S[i][j + 1] = datar; + } + } +} diff --git a/sample-app/protex_tutorial/lib/commons-fileupload-1.1.jar b/sample-app/protex_tutorial/lib/commons-fileupload-1.1.jar new file mode 100644 index 0000000..6fb2120 Binary files /dev/null and b/sample-app/protex_tutorial/lib/commons-fileupload-1.1.jar differ diff --git a/sample-app/protex_tutorial/lib/commons-io-1.1.jar b/sample-app/protex_tutorial/lib/commons-io-1.1.jar new file mode 100644 index 0000000..624fc1a Binary files /dev/null and b/sample-app/protex_tutorial/lib/commons-io-1.1.jar differ diff --git a/sample-app/protex_tutorial/lib/commons-logging.jar b/sample-app/protex_tutorial/lib/commons-logging.jar new file mode 100644 index 0000000..b73a80f Binary files /dev/null and b/sample-app/protex_tutorial/lib/commons-logging.jar differ diff --git a/sample-app/protex_tutorial/lib/lucene-1.4.3.jar b/sample-app/protex_tutorial/lib/lucene-1.4.3.jar new file mode 100644 index 0000000..58add99 Binary files /dev/null and b/sample-app/protex_tutorial/lib/lucene-1.4.3.jar differ diff --git a/sample-app/protex_tutorial/licenses/Exceptions b/sample-app/protex_tutorial/licenses/Exceptions new file mode 100644 index 0000000..c9b3cd9 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/Exceptions @@ -0,0 +1,15 @@ + +GPL License Exception: + +Even though U-Boot in general is covered by the GPL-2.0/GPL-2.0+, +this does *not* cover the so-called "standalone" applications that +use U-Boot services by means of the jump table provided by U-Boot +exactly for this purpose - this is merely considered normal use of +U-Boot, and does *not* fall under the heading of "derived work". + + The header files "include/image.h" and "arch/*/include/asm/u-boot.h" +define interfaces to U-Boot. Including these (unmodified) header +files in another file is considered normal use of U-Boot, and does +*not* fall under the heading of "derived work". +-- Wolfgang Denk + diff --git a/sample-app/protex_tutorial/licenses/GNU GENERAL PUBLIC LICENSE.txt b/sample-app/protex_tutorial/licenses/GNU GENERAL PUBLIC LICENSE.txt new file mode 100644 index 0000000..7972b13 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/GNU GENERAL PUBLIC LICENSE.txt @@ -0,0 +1,86 @@ +GNU GENERAL PUBLIC LICENSE +Version 2, June 1991 +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +Preamble +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. +The precise terms and conditions for copying, distribution and modification follow. +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. +1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. +2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: +a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. +b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. +c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. +3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: +a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, +c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. +4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. +5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. +6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. +7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. +8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. +9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. +10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. +NO WARRANTY +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +END OF TERMS AND CONDITIONS +How to Apply These Terms to Your New Programs +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. +one line to give the program's name and an idea of what it does. +Copyright (C) yyyy name of author + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +Also add information on how to contact you by electronic and paper mail. +If the program is interactive, make it output a short notice like this when it starts in an interactive mode: +Gnomovision version 69, Copyright (C) year name of author +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details +type `show w'. This is free software, and you are welcome +to redistribute it under certain conditions; type `show c' +for details. +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: +Yoyodyne, Inc., hereby disclaims all copyright +interest in the program `Gnomovision' +(which makes passes at compilers) written +by James Hacker. + +signature of Ty Coon, 1 April 1989 +Ty Coon, President of Vice +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. + diff --git a/sample-app/protex_tutorial/licenses/LICENSE-APACHE.txt b/sample-app/protex_tutorial/licenses/LICENSE-APACHE.txt new file mode 100644 index 0000000..3e24b1a --- /dev/null +++ b/sample-app/protex_tutorial/licenses/LICENSE-APACHE.txt @@ -0,0 +1,42 @@ +Copyright (C) 2002 The Apache Software Foundation. All rights reserved. +Redistribution and use in source and binary forms, with or without +modifica- tion, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions, and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. The end-user documentation included with the redistribution, if +any,must include the following acknowledgment: "This product includes +software developed by the Apache Software Foundation +(http://www.apache.org/)." Alternately, this acknowledgment may appear +in the software itself, if and wherever such third-party acknowledgments +normally appear. + +4. The names "Apache Commons" and "Apache Software Foundation" must not +be used to endorse or promote products derived from this software +without prior written permission. For written permission, please contact +apache@apache.org. + +5. Products derived from this software may not be called "Apache", nor +may "Apache" appear in their name, without prior written permission of +the Apache Software Foundation. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN +NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary +contributions made by many individuals on behalf of the Apache Software +Foundation. For more information on the Apache Software Foundation, +please see . diff --git a/sample-app/protex_tutorial/licenses/LICENSE-JSF.txt b/sample-app/protex_tutorial/licenses/LICENSE-JSF.txt new file mode 100644 index 0000000..847dabd --- /dev/null +++ b/sample-app/protex_tutorial/licenses/LICENSE-JSF.txt @@ -0,0 +1,171 @@ +Sun Microsystems, Inc. +Binary Code License Agreement + +READ THE TERMS OF THIS AGREEMENT AND ANY PROVIDED SUPPLEMENTAL LICENSE +TERMS (COLLECTIVELY "AGREEMENT") CAREFULLY BEFORE OPENING THE SOFTWARE +MEDIA PACKAGE.� BY OPENING THE SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE +TERMS OF THIS AGREEMENT.� IF YOU ARE ACCESSING THE SOFTWARE +ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE +"ACCEPT" BUTTON AT THE END OF THIS AGREEMENT.� IF YOU DO NOT AGREE TO +ALL THESE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF +PURCHASE FOR A REFUND OR, IF THE SOFTWARE IS ACCESSED ELECTRONICALLY, +SELECT THE "DECLINE" BUTTON AT THE END OF THIS AGREEMENT. + +1.� LICENSE TO USE.� Sun grants you a non-exclusive and non-transferable +license for the internal use only of the accompanying software and +documentation and any error corrections provided by Sun (collectively +"Software"), by the number of users and the class of computer hardware +for which the corresponding fee has been paid. + +2.� RESTRICTIONS.� Software is confidential and copyrighted. Title to +Software and all associated intellectual property rights is retained by +Sun and/or its licensors.� Except as specifically authorized in any +Supplemental License Terms, you may not make copies of Software, other +than a single copy of Software for archival purposes.� Unless +enforcement is prohibited by applicable law, you may not modify, +decompile, or reverse engineer Software.� Licensee acknowledges that +Licensed Software is not designed or intended for use in the design, +construction, operation or maintenance of any nuclear facility. Sun +Microsystems, Inc. disclaims any express or implied warranty of fitness +for such uses. � No right, title or interest in or to any trademark, +service mark, logo or trade name of Sun or its licensors is granted +under this Agreement. + +3. LIMITED WARRANTY.� Sun warrants to you that for a period of ninety +(90) days from the date of purchase, as evidenced by a copy of the +receipt, the media on which Software is furnished (if any) will be free +of defects in materials and workmanship under normal use.� Except for +the foregoing, Software is provided "AS IS".� Your exclusive remedy and +Sun's entire liability under this limited warranty will be at Sun's +option to replace Software media or refund the fee paid for Software. + +4.� DISCLAIMER OF WARRANTY.� UNLESS SPECIFIED IN THIS AGREEMENT, ALL +EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING +ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT +THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. + +5.� LIMITATION OF LIABILITY.� TO THE EXTENT NOT PROHIBITED BY LAW, IN NO +EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT +OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE +DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING +OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF +SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.� In no event +will Sun's liability to you, whether in contract, tort (including +negligence), or otherwise, exceed the amount paid by you for Software +under this Agreement.� The foregoing limitations will apply even if the +above stated warranty fails of its essential purpose. + +6.� Termination.� This Agreement is effective until terminated.� You may +terminate this Agreement at any time by destroying all copies of +Software.� This Agreement will terminate immediately without notice from +Sun if you fail to comply with any provision of this Agreement.� Upon +Termination, you must destroy all copies of Software. + +7. Export Regulations. All Software and technical data delivered under +this Agreement are subject to US export control laws and may be subject +to export or import regulations in other countries.� You agree to comply +strictly with all such laws and regulations and acknowledge that you +have the responsibility to obtain such licenses to export, re-export, or +import as may be required after delivery to you. + +8.� U.S. Government Restricted Rights.� If Software is being acquired by +or on behalf of the U.S. Government or by a U.S. Government prime +contractor or subcontractor (at any tier), then the Government's rights +in Software and accompanying documentation will be only as set forth in +this Agreement; this is in accordance with 48 CFR 227.7201 through +227.7202-4 (for Department of Defense (DOD) acquisitions) and with 48 +CFR 2.101 and 12.212 (for non-DOD acquisitions). + +9.� Governing Law.� Any action related to this Agreement will be +governed by California law and controlling U.S. federal law.� No choice +of law rules of any jurisdiction will apply. + +10. Severability. If any provision of this Agreement is held to be +unenforceable, this Agreement will remain in effect with the provision +omitted, unless omission would frustrate the intent of the parties, in +which case this Agreement will immediately terminate. + +11. Integration.� This Agreement is the entire agreement between you and +Sun relating to its subject matter.� It supersedes all prior or +contemporaneous oral or written communications, proposals, +representations and warranties and prevails over any conflicting or +additional terms of any quote, order, acknowledgment, or other +communication between the parties relating to its subject matter during +the term of this Agreement.� No modification of this Agreement will be +binding, unless in writing and signed by an authorized representative of +each party. + +JAVA(TM) INTERFACE CLASSES JAVASERVER(TM) FACES 1.0 SUPPLEMENTAL LICENSE +TERMS + +These supplemental license terms ("Supplemental Terms") add to or modify +the terms of the Binary Code License Agreement (collectively, the +"Agreement"). Capitalized terms not defined in these Supplemental Terms +shall have the same meanings ascribed to them in the Agreement. These +Supplemental Terms shall supersede any inconsistent or conflicting terms +in the Agreement, or in any license contained within the Software. + +1. Software Internal Use and Development License Grant. Subject to the +terms and conditions of this Agreement, including, but not limited to +Section 3 (Java(TM) Technology Restrictions) of these Supplemental +Terms, Sun grants you a non-exclusive, non-transferable, limited license +to reproduce internally and use internally the binary form of the +Software, complete and unmodified, for the sole purpose of designing, +developing and testing your Java applets and applications ("Programs"). + +2. License to Distribute Software.� In addition to the license granted +in Section 1 (Software Internal Use and Development License Grant) of +these Supplemental Terms, subject to the terms and conditions of this +Agreement, including but not limited to Section 3 (Java Technology +Restrictions), Sun grants you a non-exclusive, non-transferable, limited +license to reproduce and distribute the Software in binary form only, +provided that you (i) distribute the Software complete and unmodified +and only bundled as part of your Programs, (ii) do not distribute +additional software intended to replace any component(s) of the +Software, (iii) do not remove or alter any proprietary legends or +notices contained in the Software, (iv) only distribute the Software +subject to a license agreement that protects Sun's interests consistent +with the terms contained in this Agreement, and (v) agree to defend and +indemnify Sun and its licensors from and against any damages, costs, +liabilities, settlement amounts and/or expenses (including attorneys' +fees) incurred in connection with any claim, lawsuit or action by any +third party that arises or results from the use or distribution of any +and all Programs and/or Software. + +3. Java Technology Restrictions. You may not modify the Java Platform +Interface ("JPI", identified as classes contained within the "java" +package or any subpackages of the "java" package), by creating +additional classes within the JPI or otherwise causing the addition to +or modification of the classes in the JPI.� In the event that you create +an additional class and associated API(s) which (i) extends the +functionality of the Java Platform, and (ii) is exposed to third party +software developers for the purpose of developing additional software +which invokes such additional API, you must promptly publish broadly an +accurate specification for such API for free use by all developers. You +may not create, or authorize your licensees to create additional +classes, interfaces, or subpackages that are in any way identified as +"java", "javax", "sun" or similar convention as specified by Sun in any +naming convention designation. + +4. Trademarks and Logos. You acknowledge and agree as between you and +Sun that Sun owns the SUN, SOLARIS, JAVA, JINI, FORTE, and iPLANET +trademarks and all SUN, SOLARIS, JAVA, JINI, FORTE, and iPLANET-related +trademarks, service marks, logos and other brand designations ("Sun +Marks"), and you agree to comply with the Sun Trademark and Logo Usage +Requirements currently located at +http://www.sun.com/policies/trademarks. Any use you make of the Sun +Marks inures to Sun's benefit. + +5. Source Code. Software may contain source code that is provided solely +for reference purposes pursuant to the terms of this Agreement.� Source +code may not be redistributed unless expressly provided for in this +Agreement. + +6.� Termination for Infringement.� Either party may terminate this +Agreement immediately should any Software become, or in either party's +opinion be likely to become, the subject of a claim of infringement of +any intellectual property right. + +For inquiries please contact: Sun Microsystems, Inc. 4150 Network +Circle, Santa Clara, California 95054. (LFI#138358/Form ID#011801) diff --git a/sample-app/protex_tutorial/licenses/OFL.txt b/sample-app/protex_tutorial/licenses/OFL.txt new file mode 100644 index 0000000..07c881f --- /dev/null +++ b/sample-app/protex_tutorial/licenses/OFL.txt @@ -0,0 +1,97 @@ +Copyright (c) 2010, Andrey Makarov (makarov@bmstu.ru, mka-at-mailru@mail.ru), +with Reserved Font Name Anka/Coder Narrow. + +Copyright (c) 2011, Pablo Impallari (www.impallari.com|impallari@gmail.com), +Rodrigo Fuenzalida (www.rfuenzalida.com) with Reserved Font Name Cantora. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/sample-app/protex_tutorial/licenses/README b/sample-app/protex_tutorial/licenses/README new file mode 100644 index 0000000..486e18d --- /dev/null +++ b/sample-app/protex_tutorial/licenses/README @@ -0,0 +1,153 @@ +SPDX-License-Identifier: GPL-2.0 + + U-Boot is Free Software. It is copyrighted by Wolfgang Denk and +many others who contributed code (see the actual source code and the +git commit messages for details). You can redistribute U-Boot and/or +modify it under the terms of version 2 of the GNU General Public +License as published by the Free Software Foundation. Most of it can +also be distributed, at your option, under any later version of the +GNU General Public License -- see individual files for exceptions. + + NOTE! This license does *not* cover the so-called "standalone" +applications that use U-Boot services by means of the jump table +provided by U-Boot exactly for this purpose - this is merely +considered normal use of U-Boot, and does *not* fall under the +heading of "derived work" -- see file Licenses/Exceptions for +details. + + Also note that the GPL and the other licenses are copyrighted by +the Free Software Foundation and other organizations, but the +instance of code that they refer to (the U-Boot source code) is +copyrighted by me and others who actually wrote it. +-- Wolfgang Denk + + +Like many other projects, U-Boot has a tradition of including big +blocks of License headers in all files. This not only blows up the +source code with mostly redundant information, but also makes it very +difficult to generate License Clearing Reports. An additional problem +is that even the same licenses are referred to by a number of +slightly varying text blocks (full, abbreviated, different +indentation, line wrapping and/or white space, with obsolete address +information, ...) which makes automatic processing a nightmare. + +To make this easier, such license headers in the source files will be +replaced with a single line reference to Unique License Identifiers +as defined by the Linux Foundation's SPDX project [1]. + +If a "SPDX-License-Identifier:" line references more than one Unique +License Identifier, then this means that the respective file can be +used under the terms of either of these licenses, i. e. with + + SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause + +you can choose between GPL-2.0+ and BSD-3-Clause licensing. + +We use the SPDX Unique License Identifiers here; these are available +at [2]. + +License identifier syntax +------------------------- + +1. Placement: + + The SPDX license identifier in U-Boot files shall be added at the first + possible line in a file which can contain a comment. For the majority + or files this is the first line, except for scripts which require the + '#!PATH_TO_INTERPRETER' in the first line. For those scripts the SPDX + identifier goes into the second line. + +| + +2. Style: + + The SPDX license identifier is added in form of a comment. The comment + style depends on the file type:: + + C source: // SPDX-License-Identifier: + C header: /* SPDX-License-Identifier: */ + ASM: /* SPDX-License-Identifier: */ + scripts: # SPDX-License-Identifier: + .rst: .. SPDX-License-Identifier: + .dts{i}: // SPDX-License-Identifier: + + If a specific tool cannot handle the standard comment style, then the + appropriate comment mechanism which the tool accepts shall be used. This + is the reason for having the "/\* \*/" style comment in C header + files. There was build breakage observed with generated .lds files where + 'ld' failed to parse the C++ comment. This has been fixed by now, but + there are still older assembler tools which cannot handle C++ style + comments. + +| + +3. Syntax: + + A is either an SPDX short form license + identifier found on the SPDX License List, or the combination of two + SPDX short form license identifiers separated by "WITH" when a license + exception applies. When multiple licenses apply, an expression consists + of keywords "AND", "OR" separating sub-expressions and surrounded by + "(", ")" . + + License identifiers for licenses like [L]GPL with the 'or later' option + are constructed by using a "+" for indicating the 'or later' option.:: + + // SPDX-License-Identifier: GPL-2.0+ + // SPDX-License-Identifier: LGPL-2.1+ + + WITH should be used when there is a modifier to a license needed. + For example, the linux kernel UAPI files use the expression:: + + // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note + // SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note + + Other examples using WITH exceptions found in the linux kernel are:: + + // SPDX-License-Identifier: GPL-2.0 WITH mif-exception + // SPDX-License-Identifier: GPL-2.0+ WITH GCC-exception-2.0 + + Exceptions can only be used with particular License identifiers. The + valid License identifiers are listed in the tags of the exception text + file. + + OR should be used if the file is dual licensed and only one license is + to be selected. For example, some dtsi files are available under dual + licenses:: + + // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause + + Examples from U-Boot for license expressions in dual licensed files:: + + // SPDX-License-Identifier: GPL-2.0 OR MIT + // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause + + AND should be used if the file has multiple licenses whose terms all + apply to use the file. For example, if code is inherited from another + project and permission has been given to put it in U-Boot, but the + original license terms need to remain in effect:: + + // SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) AND MIT + + Another other example where both sets of license terms need to be + adhered to is:: + + // SPDX-License-Identifier: GPL-1.0+ AND LGPL-2.1+ + +[1] http://spdx.org/ +[2] http://spdx.org/licenses/ + +Full name SPDX Identifier OSI Approved File name URI +======================================================================================================================================= +GNU General Public License v2.0 only GPL-2.0 Y gpl-2.0.txt http://www.gnu.org/licenses/gpl-2.0.txt +GNU General Public License v2.0 or later GPL-2.0+ Y gpl-2.0.txt http://www.gnu.org/licenses/gpl-2.0.txt +GNU Library General Public License v2 or later LGPL-2.0+ Y lgpl-2.0.txt http://www.gnu.org/licenses/old-licenses/lgpl-2.0.txt +GNU Lesser General Public License v2.1 or later LGPL-2.1+ Y lgpl-2.1.txt http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt +eCos license version 2.0 eCos-2.0 eCos-2.0.txt http://www.gnu.org/licenses/ecos-license.html +BSD 2-Clause License BSD-2-Clause Y bsd-2-clause.txt http://spdx.org/licenses/BSD-2-Clause +BSD 3-clause "New" or "Revised" License BSD-3-Clause Y bsd-3-clause.txt http://spdx.org/licenses/BSD-3-Clause#licenseText +IBM PIBS (PowerPC Initialization and IBM-pibs ibm-pibs.txt + Boot Software) license +ISC License ISC Y isc.txt https://spdx.org/licenses/ISC +SIL OPEN FONT LICENSE (OFL-1.1) OFL-1.1 Y OFL.txt https://spdx.org/licenses/OFL-1.1.html +X11 License X11 x11.txt https://spdx.org/licenses/X11.html diff --git a/sample-app/protex_tutorial/licenses/SUN-PUBLIC-LICENSE.txt b/sample-app/protex_tutorial/licenses/SUN-PUBLIC-LICENSE.txt new file mode 100644 index 0000000..c7fe587 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/SUN-PUBLIC-LICENSE.txt @@ -0,0 +1,471 @@ +SUN PUBLIC LICENSE Version 1.0 + +1. Definitions. + + 1.0.1. "Commercial Use" means distribution or otherwise making the + Covered Code available to a third party. + + 1.1. "Contributor" means each entity that creates or contributes to + the creation of Modifications. + + 1.2. "Contributor Version" means the combination of the Original Code, + prior Modifications used by a Contributor, and the Modifications made + by that particular Contributor. + + 1.3. "Covered Code" means the Original Code or Modifications or the + combination of the Original Code and Modifications, in each case + including portions thereof and corresponding documentation released + with the source code. + + 1.4. "Electronic Distribution Mechanism" means a mechanism generally + accepted in the software development community for the electronic + transfer of data. + + 1.5. "Executable" means Covered Code in any form other than Source + Code. + + 1.6. "Initial Developer" means the individual or entity identified as + the Initial Developer in the Source Code notice required by Exhibit A. + + 1.7. "Larger Work" means a work which combines Covered Code or + portions thereof with code not governed by the terms of this License. + + 1.8. "License" means this document. + + 1.8.1. "Licensable" means having the right to grant, to the maximum + extent possible, whether at the time of the initial grant or + subsequently acquired, any and all of the rights conveyed herein. + + 1.9. "Modifications" means any addition to or deletion from the + substance or structure of either the Original Code or any previous + Modifications. When Covered Code is released as a series of files, a + Modification is: + + A. Any addition to or deletion from the contents of a file containing + Original Code or previous Modifications. + + B. Any new file that contains any part of the Original Code or + previous Modifications. + + 1.10. "Original Code" means Source Code of computer software code + which is described in the Source Code notice required by Exhibit A as + Original Code, and which, at the time of its release under this + License is not already Covered Code governed by this License. + + 1.10.1. "Patent Claims" means any patent claim(s), now owned or + hereafter acquired, including without limitation, method, process, and + apparatus claims, in any patent Licensable by grantor. + + 1.11. "Source Code" means the preferred form of the Covered Code for + making modifications to it, including all modules it contains, plus + any associated documentation, interface definition files, scripts used + to control compilation and installation of an Executable, or source + code differential comparisons against either the Original Code or + another well known, available Covered Code of the Contributor's + choice. The Source Code can be in a compressed or archival form, + provided the appropriate decompression or de-archiving software is + widely available for no charge. + + 1.12. "You" (or "Your") means an individual or a legal entity + exercising rights under, and complying with all of the terms of, this + License or a future version of this License issued under Section 6.1. + For legal entities, "You" includes any entity which controls, is + controlled by, or is under common control with You. For purposes of + this definition, "control" means (a) the power, direct or indirect, to + cause the direction or management of such entity, whether by contract + or otherwise, or (b) ownership of more than fifty percent (50%) of the + outstanding shares or beneficial ownership of such entity. + +2. Source Code License. + +2.1 The Initial Developer Grant. + + The Initial Developer hereby grants You a world-wide, royalty-free, + non-exclusive license, subject to third party intellectual property + claims: + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Initial Developer to use, reproduce, modify, + display, perform, sublicense and distribute the Original Code (or + portions thereof) with or without Modifications, and/or as part of a + Larger Work; and + + (b) under Patent Claims infringed by the making, using or selling of + Original Code, to make, have made, use, practice, sell, and offer for + sale, and/or otherwise dispose of the Original Code (or portions + thereof). + + (c) the licenses granted in this Section 2.1(a) and (b) are effective + on the date Initial Developer first distributes Original Code under + the terms of this License. + + (d) Notwithstanding Section 2.1(b) above, no patent license is + granted: 1) for code that You delete from the Original Code; 2) + separate from the Original Code; or 3) for infringements caused by: + i) the modification of the Original Code or ii) the combination of the + Original Code with other software or devices. + +2.2. Contributor Grant. + + Subject to third party intellectual property claims, each Contributor + hereby grants You a world-wide, royalty-free, non-exclusive license + + (a) under intellectual property rights (other than patent or + trademark) Licensable by Contributor, to use, reproduce, modify, + display, perform, sublicense and distribute the Modifications created + by such Contributor (or portions thereof) either on an unmodified + basis, with other Modifications, as Covered Code and/or as part of a + Larger Work; and + + (b) under Patent Claims infringed by the making, using, or selling of + Modifications made by that Contributor either alone and/or in + combination with its Contributor Version (or portions of such + combination), to make, use, sell, offer for sale, have made, and/or + otherwise dispose of: 1) Modifications made by that Contributor (or + portions thereof); and 2) the combination of Modifications made by + that Contributor with its Contributor Version (or portions of such + combination). + + (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective + on the date Contributor first makes Commercial Use of the Covered + Code. + + (d) notwithstanding Section 2.2(b) above, no patent license is + granted: 1) for any code that Contributor has deleted from the + Contributor Version; 2) separate from the Contributor Version; 3) for + infringements caused by: i) third party modifications of Contributor + Version or ii) the combination of Modifications made by that + Contributor with other software (except as part of the Contributor + Version) or other devices; or 4) under Patent Claims infringed by + Covered Code in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. + +3.1. Application of License. + + The Modifications which You create or to which You contribute are + governed by the terms of this License, including without limitation + Section 2.2. The Source Code version of Covered Code may be + distributed only under the terms of this License or a future version + of this License released under Section 6.1, and You must include a + copy of this License with every copy of the Source Code You + distribute. You may not offer or impose any terms on any Source Code + version that alters or restricts the applicable version of this + License or the recipients' rights hereunder. However, You may include + an additional document offering the additional rights described in + Section 3.5. + +3.2. Availability of Source Code. + + Any Modification which You create or to which You contribute must be + made available in Source Code form under the terms of this License + either on the same media as an Executable version or via an accepted + Electronic Distribution Mechanism to anyone to whom you made an + Executable version available; and if made available via Electronic + Distribution Mechanism, must remain available for at least twelve (12) + months after the date it initially became available, or at least six + (6) months after a subsequent version of that particular Modification + has been made available to such recipients. You are responsible for + ensuring that the Source Code version remains available even if the + Electronic Distribution Mechanism is maintained by a third party. + +3.3. Description of Modifications. + + You must cause all Covered Code to which You contribute to contain a + file documenting the changes You made to create that Covered Code and + the date of any change. You must include a prominent statement that + the Modification is derived, directly or indirectly, from Original + Code provided by the Initial Developer and including the name of the + Initial Developer in (a) the Source Code, and (b) in any notice in an + Executable version or related documentation in which You describe the + origin or ownership of the Covered Code. + +3.4. Intellectual Property Matters. + + (a) Third Party Claims. + + If Contributor has knowledge that a license under a third party's + intellectual property rights is required to exercise the rights + granted by such Contributor under Sections 2.1 or 2.2, Contributor + must include a text file with the Source Code distribution titled + "LEGAL'' which describes the claim and the party making the claim in + sufficient detail that a recipient will know whom to contact. If + Contributor obtains such knowledge after the Modification is made + available as described in Section 3.2, Contributor shall promptly + modify the LEGAL file in all copies Contributor makes available + thereafter and shall take other steps (such as notifying appropriate + mailing lists or newsgroups) reasonably calculated to inform those who + received the Covered Code that new knowledge has been obtained. + + (b) Contributor APIs. + + If Contributor's Modifications include an application programming + interface ("API") and Contributor has knowledge of patent licenses + which are reasonably necessary to implement that API, Contributor must + also include this information in the LEGAL file. + + (c) Representations. + + Contributor represents that, except as disclosed pursuant to Section + 3.4(a) above, Contributor believes that Contributor's Modifications + are Contributor's original creation(s) and/or Contributor has + sufficient rights to grant the rights conveyed by this License. + +3.5. Required Notices. + + You must duplicate the notice in Exhibit A in each file of the Source + Code. If it is not possible to put such notice in a particular Source + Code file due to its structure, then You must include such notice in a + location (such as a relevant directory) where a user would be likely + to look for such a notice. If You created one or more Modification(s) + You may add your name as a Contributor to the notice described in + Exhibit A. You must also duplicate this License in any documentation + for the Source Code where You describe recipients' rights or ownership + rights relating to Covered Code. You may choose to offer, and to + charge a fee for, warranty, support, indemnity or liability + obligations to one or more recipients of Covered Code. However, You + may do so only on Your own behalf, and not on behalf of the Initial + Developer or any Contributor. You must make it absolutely clear than + any such warranty, support, indemnity or liability obligation is + offered by You alone, and You hereby agree to indemnify the Initial + Developer and every Contributor for any liability incurred by the + Initial Developer or such Contributor as a result of warranty, + support, indemnity or liability terms You offer. + +3.6. Distribution of Executable Versions. + + You may distribute Covered Code in Executable form only if the + requirements of Section 3.1-3.5 have been met for that Covered Code, + and if You include a notice stating that the Source Code version of + the Covered Code is available under the terms of this License, + including a description of how and where You have fulfilled the + obligations of Section 3.2. The notice must be conspicuously included + in any notice in an Executable version, related documentation or + collateral in which You describe recipients' rights relating to the + Covered Code. You may distribute the Executable version of Covered + Code or ownership rights under a license of Your choice, which may + contain terms different from this License, provided that You are in + compliance with the terms of this License and that the license for the + Executable version does not attempt to limit or alter the recipient's + rights in the Source Code version from the rights set forth in this + License. If You distribute the Executable version under a different + license You must make it absolutely clear that any terms which differ + from this License are offered by You alone, not by the Initial + Developer or any Contributor. You hereby agree to indemnify the + Initial Developer and every Contributor for any liability incurred by + the Initial Developer or such Contributor as a result of any such + terms You offer. + +3.7. Larger Works. + + You may create a Larger Work by combining Covered Code with other code + not governed by the terms of this License and distribute the Larger + Work as a single product. In such a case, You must make sure the + requirements of this License are fulfilled for the Covered Code. + +4. Inability to Comply Due to Statute or Regulation. + + If it is impossible for You to comply with any of the terms of this + License with respect to some or all of the Covered Code due to + statute, judicial order, or regulation then You must: (a) comply with + the terms of this License to the maximum extent possible; and (b) + describe the limitations and the code they affect. Such description + must be included in the LEGAL file described in Section 3.4 and must + be included with all distributions of the Source Code. Except to the + extent prohibited by statute or regulation, such description must be + sufficiently detailed for a recipient of ordinary skill to be able to + understand it. + +5. Application of this License. + + This License applies to code to which the Initial Developer has + attached the notice in Exhibit A and to related Covered Code. + +6. Versions of the License. + +6.1. New Versions. + + Sun Microsystems, Inc. ("Sun") may publish revised and/or new versions + of the License from time to time. Each version will be given a + distinguishing version number. + +6.2. Effect of New Versions. + + Once Covered Code has been published under a particular version of the + License, You may always continue to use it under the terms of that + version. You may also choose to use such Covered Code under the terms + of any subsequent version of the License published by Sun. No one + other than Sun has the right to modify the terms applicable to Covered + Code created under this License. + +6.3. Derivative Works. + + If You create or use a modified version of this License (which you may + only do in order to apply it to code which is not already Covered Code + governed by this License), You must: (a) rename Your license so that + the phrases "Sun," "Sun Public License," or "SPL" or any confusingly + similar phrase do not appear in your license (except to note that your + license differs from this License) and (b) otherwise make it clear + that Your version of the license contains terms which differ from the + Sun Public License. (Filling in the name of the Initial Developer, + Original Code or Contributor in the notice described in Exhibit A + shall not of themselves be deemed to be modifications of this + License.) + +7. DISCLAIMER OF WARRANTY. + + COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF + DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. + THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE + IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, + YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE + COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER + OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF + ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. + +8. TERMINATION. + + 8.1. This License and the rights granted hereunder will terminate + automatically if You fail to comply with terms herein and fail to cure + such breach within 30 days of becoming aware of the breach. All + sublicenses to the Covered Code which are properly granted shall + survive any termination of this License. Provisions which, by their + nature, must remain in effect beyond the termination of this License + shall survive. + + 8.2. If You initiate litigation by asserting a patent infringement + claim (excluding declaratory judgment actions) against Initial Developer + or a Contributor (the Initial Developer or Contributor against whom + You file such action is referred to as "Participant") alleging that: + + (a) such Participant's Contributor Version directly or indirectly + infringes any patent, then any and all rights granted by such + Participant to You under Sections 2.1 and/or 2.2 of this License + shall, upon 60 days notice from Participant terminate prospectively, + unless if within 60 days after receipt of notice You either: (i) + agree in writing to pay Participant a mutually agreeable reasonable + royalty for Your past and future use of Modifications made by such + Participant, or (ii) withdraw Your litigation claim with respect to + the Contributor Version against such Participant. If within 60 days + of notice, a reasonable royalty and payment arrangement are not + mutually agreed upon in writing by the parties or the litigation claim + is not withdrawn, the rights granted by Participant to You under + Sections 2.1 and/or 2.2 automatically terminate at the expiration of + the 60 day notice period specified above. + + (b) any software, hardware, or device, other than such Participant's + Contributor Version, directly or indirectly infringes any patent, then + any rights granted to You by such Participant under Sections 2.1(b) + and 2.2(b) are revoked effective as of the date You first made, used, + sold, distributed, or had made, Modifications made by that + Participant. + + 8.3. If You assert a patent infringement claim against Participant + alleging that such Participant's Contributor Version directly or + indirectly infringes any patent where such claim is resolved (such as + by license or settlement) prior to the initiation of patent + infringement litigation, then the reasonable value of the licenses + granted by such Participant under Sections 2.1 or 2.2 shall be taken + into account in determining the amount or value of any payment or + license. + + 8.4. In the event of termination under Sections 8.1 or 8.2 above, all + end user license agreements (excluding distributors and resellers) + which have been validly granted by You or any distributor hereunder + prior to termination shall survive termination. + +9. LIMITATION OF LIABILITY. + + UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT + (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL + DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, + OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR + ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY + CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, + WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER + COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN + INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF + LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY + RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW + PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE + EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO + THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. + +10. U.S. GOVERNMENT END USERS. + + The Covered Code is a "commercial item," as that term is defined in 48 + C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" + and "commercial computer software documentation," as such terms are + used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. + 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all + U.S. Government End Users acquire Covered Code with only those rights + set forth herein. + +11. MISCELLANEOUS. + + This License represents the complete agreement concerning subject + matter hereof. If any provision of this License is held to be + unenforceable, such provision shall be reformed only to the extent + necessary to make it enforceable. This License shall be governed by + California law provisions (except to the extent applicable law, if + any, provides otherwise), excluding its conflict-of-law provisions. + With respect to disputes in which at least one party is a citizen of, + or an entity chartered or registered to do business in the United + States of America, any litigation relating to this License shall be + subject to the jurisdiction of the Federal Courts of the Northern + District of California, with venue lying in Santa Clara County, + California, with the losing party responsible for costs, including + without limitation, court costs and reasonable attorneys' fees and + expenses. The application of the United Nations Convention on + Contracts for the International Sale of Goods is expressly excluded. + Any law or regulation which provides that the language of a contract + shall be construed against the drafter shall not apply to this + License. + +12. RESPONSIBILITY FOR CLAIMS. + + As between Initial Developer and the Contributors, each party is + responsible for claims and damages arising, directly or indirectly, + out of its utilization of rights under this License and You agree to + work with Initial Developer and Contributors to distribute such + responsibility on an equitable basis. Nothing herein is intended or + shall be deemed to constitute any admission of liability. + +13. MULTIPLE-LICENSED CODE. + + Initial Developer may designate portions of the Covered Code as + "Multiple-Licensed". "Multiple-Licensed" means that the Initial + Developer permits you to utilize portions of the Covered Code under + Your choice of the alternative licenses, if any, specified by the + Initial Developer in the file described in Exhibit A. + +Exhibit A -Sun Public License Notice. + + The contents of this file are subject to the Sun Public License + Version 1.0 (the "License"); you may not use this file except in + compliance with the License. A copy of the License is available at + http://www.sun.com/ + + The Original Code is _________________. The Initial Developer of the + Original Code is ___________. Portions created by ______ are Copyright + (C)_________. All Rights Reserved. + + Contributor(s): ______________________________________. + + Alternatively, the contents of this file may be used under the terms + of the _____ license (the "[___] License"), in which case the + provisions of [______] License are applicable instead of those above. + If you wish to allow use of your version of this file only under the + terms of the [____] License and not to allow others to use your + version of this file under the SPL, indicate your decision by deleting + the provisions above and replace them with the notice and other + provisions required by the [___] License. If you do not delete the + provisions above, a recipient may use your version of this file under + either the SPL or the [___] License." + + [NOTE: The text of this Exhibit A may differ slightly from the text of + the notices in the Source Code files of the Original Code. You should + use the text of this Exhibit A rather than the text found in the + Original Code Source Code for Your Modifications.] \ No newline at end of file diff --git a/sample-app/protex_tutorial/licenses/bsd-2-clause.txt b/sample-app/protex_tutorial/licenses/bsd-2-clause.txt new file mode 100644 index 0000000..af69764 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/bsd-2-clause.txt @@ -0,0 +1,25 @@ +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + +1. Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. +2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sample-app/protex_tutorial/licenses/bsd-3-clause.txt b/sample-app/protex_tutorial/licenses/bsd-3-clause.txt new file mode 100644 index 0000000..aac5e2a --- /dev/null +++ b/sample-app/protex_tutorial/licenses/bsd-3-clause.txt @@ -0,0 +1,24 @@ +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions, and the following disclaimer, + without modification. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The names of the above-listed copyright holders may not be used + to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/sample-app/protex_tutorial/licenses/eCos-2.0.txt b/sample-app/protex_tutorial/licenses/eCos-2.0.txt new file mode 100644 index 0000000..8a12e20 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/eCos-2.0.txt @@ -0,0 +1,43 @@ + Note that this license is not endorsed by the Free Software Foundation. + It is available here as a convenience to readers of [1]the license + list. + +The eCos license version 2.0 + + This file is part of eCos, the Embedded Configurable Operating System. + Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. + + eCos is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 or (at your option) any later + version. + + eCos is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License along + with eCos; if not, write to the Free Software Foundation, Inc., 51 + Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + As a special exception, if other files instantiate templates or use + macros or inline functions from this file, or you compile this file and + link it with other works to produce a work based on this file, this + file does not by itself cause the resulting work to be covered by the + GNU General Public License. However the source code for this file must + still be made available in accordance with section (3) of the GNU + General Public License. + + This exception does not invalidate any other reasons why a work based + on this file might be covered by the GNU General Public License. + + Alternative licenses for eCos may be arranged by contacting Red Hat, + Inc. at http://sources.redhat.com/ecos/ecos-license/ + ------------------------------------------- + + ####ECOSGPLCOPYRIGHTEND#### + +References + + 1. http://www.gnu.org/licenses/license-list.html diff --git a/sample-app/protex_tutorial/licenses/gpl-2.0.txt b/sample-app/protex_tutorial/licenses/gpl-2.0.txt new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/sample-app/protex_tutorial/licenses/ibm-pibs.txt b/sample-app/protex_tutorial/licenses/ibm-pibs.txt new file mode 100644 index 0000000..4cd7523 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/ibm-pibs.txt @@ -0,0 +1,17 @@ +This source code has been made available to you by IBM on an AS-IS +basis. Anyone receiving this source is licensed under IBM +copyrights to use it in any way he or she deems fit, including +copying it, modifying it, compiling it, and redistributing it either +with or without modifications. No license under IBM patents or +patent applications is to be implied by the copyright license. + +Any user of this software should understand that IBM cannot provide +technical support for this software and will not be responsible for +any consequences resulting from the use of this software. + +Any person who transfers this source code or any derivative work +must include the IBM copyright notice, this paragraph, and the +preceding two paragraphs in the transferred software. + +COPYRIGHT I B M CORPORATION 1995 +LICENSED MATERIAL - PROGRAM PROPERTY OF I B M diff --git a/sample-app/protex_tutorial/licenses/isc.txt b/sample-app/protex_tutorial/licenses/isc.txt new file mode 100644 index 0000000..4b7c2ba --- /dev/null +++ b/sample-app/protex_tutorial/licenses/isc.txt @@ -0,0 +1,17 @@ +ISC License: +Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC") +Copyright (c) 1995-2003 by Internet Software Consortium + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, +provided that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. diff --git a/sample-app/protex_tutorial/licenses/lgpl-2.0.txt b/sample-app/protex_tutorial/licenses/lgpl-2.0.txt new file mode 100644 index 0000000..5bc8fb2 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/lgpl-2.0.txt @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/sample-app/protex_tutorial/licenses/lgpl-2.1.txt b/sample-app/protex_tutorial/licenses/lgpl-2.1.txt new file mode 100644 index 0000000..4362b49 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/lgpl-2.1.txt @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/sample-app/protex_tutorial/licenses/r8a779x_usb3.txt b/sample-app/protex_tutorial/licenses/r8a779x_usb3.txt new file mode 100644 index 0000000..e2afcc9 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/r8a779x_usb3.txt @@ -0,0 +1,26 @@ +Copyright (c) 2014, Renesas Electronics Corporation +All rights reserved. + +Redistribution and use in binary form, without modification, are permitted +provided that the following conditions are met: + +1. Redistribution in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +2. The name of Renesas Electronics Corporation may not be used to endorse or + promote products derived from this software without specific prior written + permission. +3. Reverse engineering, decompilation, or disassembly of this software is + not permitted. + +THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS ELECTRONICS CORPORATION DISCLAIMS +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL RENESAS ELECTRONICS +CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/sample-app/protex_tutorial/licenses/x11.txt b/sample-app/protex_tutorial/licenses/x11.txt new file mode 100644 index 0000000..23a3c63 --- /dev/null +++ b/sample-app/protex_tutorial/licenses/x11.txt @@ -0,0 +1,25 @@ +X11 License +Copyright (C) 1996 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X +CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization from the X Consortium. + +X Window System is a trademark of X Consortium, Inc. diff --git a/sample-app/protex_tutorial/openvpn.exe b/sample-app/protex_tutorial/openvpn.exe new file mode 100644 index 0000000..3419a89 Binary files /dev/null and b/sample-app/protex_tutorial/openvpn.exe differ diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/README b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/README new file mode 100644 index 0000000..3809e8b --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/README @@ -0,0 +1,171 @@ +Petris + +1. SYNOPSIS +2. REQUIREMENTS +3. FILES +4. INSTALLATION +5. CHANGES +6. COPYRIGHT +7. NOTES + + +1. SYNOPSIS + +Standard tetris clone with extra options. + +This is the classic version of tetris. It has some enhancements (which can be +switched off), including patterns (layouts) of predetermined blocks already on +the board, changeable board sizes, changeable speed and extra shapes. You can +add new layouts and shapes easily. + +On-line help is provided - start up the game and click the Help button or press F1. + + +2. REQUIREMENTS + +Perl 5.004 +Tk 400.202 +Linux/X windows or Win32 + +MesgBox.pm (available from wherever you got petris) + +The game was developed under Debian GNU/Linux 2.0. + +~60K disk space. + + +3. FILES + +README +debian-menu +tk-text.pl +petris +petris-action.pl +petris-board-commands.pl +petris-board.pl +petris-button-commands.pl +petris-buttons.pl +petris-consts.pl +petris-help.pl +petris-icon-16x16.xpm +petris-keys.pl +petris-layouts.pl +petris-options.pl +petris-opts.pl +petris-shapes.pl + +Petris will create a directory in your home directory called '.games' and a +file in that directory called 'petrisrc'. On Win32 machines it will create +a file called 'PETRIS.INI' in the directory it is invoked from. + + +4. INSTALLATION + +Note that Petris can be installed pretty well anywhere - the only restriction +is that all the petris* files must be together in the same directory. + +# Create the directories. +mkdir /usr/games +mkdir /usr/games/petris + +# Copy the tar.gz to the game directory. +cp petris-VERSION.tar.gz /usr/games + +# Change to the games directory. +cd /usr/games + +# Unpack the archive using method A or B: +# Method A for those using GNU tar +tar xvfz petris-VERSION.tar.gz +# Method B for those not using GNU tar +gunzip petris-VERSION.tar.gz +tar xvf petris-VERSION.tar + +# Change to the petris directory. +cd petris + +# Make sure petris is executable. +chmod a+x petris + +# If this is an upgrade from a previous version and you're not using Win32 +# then keep your options. +mv ~/.games/petris-opts ~/.games/petrisrc + +# Optional. If you want petris to appear on your X menu do the following: +cp debian-menu /etc/menu/petris +update-menus + +# Note that the name of the file supplied, 'debian-menu', is changed in the +# move to 'petris'. Note also that if you haven't used the paths given here you +# must change the command path in /etc/menu/petris. The addition to the menu +# will only appear when the window manager is restarted. + +# To run petris from the command line: +/usr/games/petris/petris & + +# You could always either alias this or use a soft link to a directory on the +# path to save typing the whole path. Note that 'deprecated' error messages +# which appear are harmless and can be ignored. + + +5. CHANGES + +1999/01/23 Modified options so that the program need not exec itself when the + board size is changed. Also improved modularisation. + +1999/02/02 Corrected a mistake that stopped buttons working with the mouse. + Made the game 'friendlier' to Win32 machines. + +1999/02/23 Changed to use MesgBox dialog - should now work properly under + Windows. + +1999/03/13 Minor tidying to Help and Options dialogues; added the option + which allows you to decide whether or not to intersperse random + layouts between predefined ones if using layouts. + +1999/03/18 Minor documentation changes to suit CPAN scripts area. + +1999/04/21 Included MesgBox.pm to make the .tar.gz file complete. + +1999/08/07 Minor fixes for Win32. Also Linux options file has been renamed + .petrisrc to be more conventional. + +1999/08/08 Changed licence to GPL. + +1999/08/28 Added `left handed' keystrokes; changed help into pod and now use + my standard render pod routines from tk-text.pl. + +1999/09/06 Removed MesgBox.pm at Lupe Christoph's (CPAN) request. You must + pick this module up separately now (although old versions will + work fine if you've already got one). + +1999/09/11 Now use an improved algorithm to ensure (I hope) that new pieces + are always a different colour from the background (previously they + would occassionally be `invisible'). + + +6. COPYRIGHT + +Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +Petris may be used/distributed under the GPL. + +Contact: - please include 'petris' in the +subject line. + + +7. NOTES + +When I installed Debian Linux I was surprised to find that no Tetris was +supplied. I felt this was a gap that I would like to fill. After developing +Snake in a way that I felt would lend itself to the development of other +'graph-paper' games, I decided to put it to the test and so developed this +version of Tetris. I have called the game Petris because Andreas Koenig +pointed out that Tetris was probably a trademark - the name Petris was +suggested by Jarkko Hietaniemi. I think that the code supplied here could be +adapted to many other 'graph-paper' games. + +To customise by adding new shapes edit the petris-shapes.pl file (after making +a backup and reading the comments first of course!) Similarly to add new +layouts edit petris-layouts.pl. + + diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/debian-menu b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/debian-menu new file mode 100644 index 0000000..42603ea --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/debian-menu @@ -0,0 +1,2 @@ +?package(local.petris):needs="X11" section="Games/Board" \ + title="Petris" command="/usr/games/petris/petris" diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris new file mode 100644 index 0000000..5c25eed --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris @@ -0,0 +1,240 @@ +#!/usr/bin/perl -w + +# $Id: petris,v 1.18 1999/09/11 15:41:50 root Exp root $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +# TODO Fix colour bug - some pieces start off multi-coloured - this happens +# sometimes after clearing a row. + +use strict ; + +use Tk ; +use Tk::MesgBox ; + +use FindBin qw( $RealBin ) ; +use lib $RealBin ; + +use vars qw( $VERSION $DEBUG + $BOARD $HEAP $BLOCK + $ROTATE $LEFT $RIGHT $DOWN + $RUNNING $PAUSED $NOTRUNNING + %Global %Const %Opt + $Win + %Buttons %Board %Block ) ; + +$VERSION = '1.14' ; # Application version. +$DEBUG = 0 ; + +my $DieOnWarn = 1 ; +my $WarnInDialogue = 0 ; + + +&initialise ; + +MainLoop ; + + +BEGIN { + $SIG{__WARN__} = sub { + if( $WarnInDialogue and defined $Win ) { + my $msg = $Win->MesgBox( + -title => "Petris Error", + -text => $_[0], + -icon => 'ERROR', + ) ; + $msg->Show ; + } + else { + print STDOUT join( "\n", @_ ), "\n" ; + } + } ; +} + + +sub initialise { + + $Global{WROTE_OPTS} = 0 ; + + $Win = MainWindow->new() ; + $Win->title( "Petris" ) ; + + &load_library( "petris-consts.pl" ) ; + $Global{STATE} = $NOTRUNNING ; # Need consts to set this. + &load_library( "petris-opts.pl" ) ; # Default. + &read_opts ; # User. + &set_consts ; # Need opts to set these. + &load_library( "petris-shapes.pl" ) ; + &load_library( "petris-layouts.pl" ) ; + &load_library( "petris-buttons.pl" ) ; + &load_library( "petris-button-commands.pl" ) ; + &load_library( "petris-board.pl" ) ; + &load_library( "petris-board-commands.pl" ) ; + &load_library( "petris-keys.pl" ) ; + &load_library( "petris-help.pl" ) ; + &load_library( "petris-options.pl" ) ; + &load_library( "petris-action.pl" ) ; + + &load_library( "tk-text.pl" ) ; + + &window_centre( $Win ) ; + &board::create ; + &button::start ; +} + + +sub window_centre { + my $win = shift ; + + $win->update ; + my $x = int( ( $win->screenwidth - $win->width ) / 2 ) ; + my $y = int( ( $win->screenheight - ( $win->height - 20 ) ) / 2 ) ; + $win->geometry( "+$x+$y" ) ; +} + + +sub read_opts { + + return unless -e $Const{OPTS_FILE} ; + + if( open( IN, $Const{OPTS_FILE} ) ) { + local $_ ; + while( ) { + next if /^#/ or /^\s*$/ ; + chomp ; + my( $key, $val ) = /^([^\s:]+)\s*:\s*(.*)/ ; + $val = $1 if $val =~ /([^#]+)#/ ; + $val =~ s/\s+$// ; + $Opt{uc $key} = $val ; + } + close IN ; + &opts_check ; + } + else { + warn "Failed to read $Const{OPTS_FILE}: $!.\n" ; + } +} + + +sub write_opts { + + # Create the games opt directory if it doesn't exist. + $Const{OPTS_FILE} =~ m{^(.*)/} ; + mkdir $1, 0666 if defined $1 and not -e $1 ; + + if( open( OUT, ">$Const{OPTS_FILE}" ) ) { + local $_ ; + foreach ( sort keys %Opt ) { + print OUT "$_: $Opt{$_}\n" ; + } + close OUT ; + } + else { + warn "Failed to write $Const{OPTS_FILE}: $!.\n" ; + } +} + + +sub set_consts { + + $Const{BOARD_OFFSET} = int( ( $Opt{BOARD_SQUARE_LENGTH} - + $Const{BOARD_SQUARE_LENGTH_MIN} ) / 2 ) + 1 ; + + $Const{BOARD_X_LENGTH} = $Opt{BOARD_SQUARES_X} * $Opt{BOARD_SQUARE_LENGTH} ; + $Const{BOARD_Y_LENGTH} = $Opt{BOARD_SQUARES_Y} * $Opt{BOARD_SQUARE_LENGTH} ; +} + + +sub get_colour { + + # Pick out the hex colour values. + my( $red1, $green1, $blue1 ) = + $Const{BOARD_BACKGROUND_COLOUR} =~ /([0-9A-Fa-f]){2}/og ; + $red1 = hex $red1 ; + $green1 = hex $green1 ; + $blue1 = hex $blue1 ; + # Brightness calculation taken from Mastering Algorithms with Perl. + my $brightness = ( $red1 * 0.118 ) + + ( $green1 * 0.231 ) + + ( $blue1 * 0.043 ) ; + + my( $red2, $green2, $blue2 ) ; + + while( 1 ) { + # We don't want the random colour to be too close to the background + # colour or it will be `invisible'. + $red2 = int( rand( 0xFF ) ) ; + $green2 = int( rand( 0xFF ) ) ; + $blue2 = int( rand( 0xFF ) ) ; + my $newbrightness = ( $red2 * 0.118 ) + + ( $green2 * 0.231 ) + + ( $blue2 * 0.043 ) ; + + last if abs( $brightness - $newbrightness ) > 10 and + ( ( abs( $red1 - $red2 ) + + abs( $green1 - $green2 ) + + abs( $blue1 - $blue2 ) ) > 10 ) ; + } + + sprintf "#%02X%02X%02X", $red2, $green2, $blue2 ; +} + + +sub load_library { + my $file = shift ; + + unless( my $return = do "${file}" ) { + my $warned = 0 ; + warn "Failed to parse $file: $@.\n", + $warned = 1 if $@ ; + warn "Failed to do $file: $!\n", + $warned = 1 if not $warned and not defined $return ; + warn "Failed to run $file.\n", + $warned = 1 if not $warned and $return ; + die "Failed to load $file.\n" if $DieOnWarn ; + } +} + + +__END__ + + +=pod SCRIPT CATEGORIES + +Games + +=pod DESCRIPTION + +Perl/Tk Tetris clone with extensions. + +=pod PREREQUISITES + +Pragmas: + +C +C + +Modules: + +C +C +C + +=pod COREQUISITES + +None. + +=pod OSNAMES + +Developed under: +Linux/X-Windows + +Known to run under: +Win32 + +=pod LICENSE + +GPL. + +=cut diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-action.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-action.pl new file mode 100644 index 0000000..664e059 --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-action.pl @@ -0,0 +1,384 @@ +#!/usr/bin/perl -w + +# $Id: petris-action.pl,v 1.8 1999/08/08 15:46:59 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package main ; + + +my $ClearingRows = 0 ; + + +sub action::game_over { + + $Global{STATE} = $NOTRUNNING ; + + $Buttons{START}->configure( -state => 'normal' ) ; + $Buttons{PAUSE}->configure( -state => 'disabled' ) ; + $Board{STATUS}->configure( -text => 'Ready' ) ; + $Win->configure( -cursor => 'left_ptr' ) ; # The default cursor. + + return if shift ; + + my $result = "\nYou scored $Opt{SCORE}." ; + if( $Opt{SCORE} > $Opt{HIGH_SCORE} ) { + $result .= "\n\nAnd beat the high score of $Opt{HIGH_SCORE}!" ; + $Opt{HIGH_SCORE} = $Opt{SCORE} ; + $Global{WROTE_OPTS} = 0 ; + } + else { + $result .= "\n\nCurrent high score is $Opt{HIGH_SCORE}." ; + } + + my $msg = $Win->MesgBox( + -title => "Petris Game Over", + -text => $result, + -icon => 'INFO', + ) ; + $msg->Show ; + + unless( $Global{WROTE_OPTS} ) { # Make sure we write out new high score! + &write_opts ; + $Global{WROTE_OPTS} = 1 ; + } +} + + +sub action::tick { + return if $Global{STATE} != $RUNNING ; + + &action::advance( $DOWN ) ; + $Win->after( $Global{INTERVAL}, \&action::tick ) ; +} + + +sub action::create_block { + my $game_over = 0 ; + + my $colour = &get_colour ; + print "B: $colour\n" if $DEBUG ; + @{$Block{SQUARES}} = @{$Const{"BLOCK_" . int( rand $Global{BLOCK_MAX} ) }} ; + foreach my $coords ( @{$Block{SQUARES}} ) { + my( $x, $y ) = @{$coords} ; + # If we start on the heap or a block its over. + $game_over = 1, last if $Board{SQUARES}[$x][$y]{TYPE} != $BOARD ; + $Board{SQUARES}[$x][$y]{TYPE} = $BLOCK ; + $Board{SQUARES}[$x][$y]{COLOUR} = $colour ; + } + &action::game_over if $game_over ; +} + + +sub action::advance { + return if $ClearingRows ; # Can't move while we're clearing. + + my $action = shift ; + + my( $coords, $x, $y ) ; + + my @block = @{$Block{SQUARES}} ; + my $can_move = 1 ; + + if( $action == $ROTATE ) { + my @pivot = &action::find_pivot( @block ) ; + foreach $coords ( @block ) { + ( $x, $y ) = &action::rotate_block_square( @pivot, @{$coords} ) ; + # Ignore if we are at the side or if we'd hit the heap. + $can_move = 0, last if $x < 0 ; + $can_move = 0, last if $x >= $Opt{BOARD_SQUARES_X} ; + $can_move = 0, last if $Board{SQUARES}[$x][$y]{TYPE} == $HEAP ; + } + } + elsif( $action == $LEFT ) { + foreach $coords ( @block ) { + ( $x, $y ) = @{$coords} ; + # Ignore if we are at the side or if we'd hit the heap. + $can_move = 0, last if $x - 1 < 0 ; + $can_move = 0, last if $Board{SQUARES}[$x - 1][$y]{TYPE} == $HEAP ; + } + } + elsif( $action == $RIGHT ) { + foreach $coords ( @block ) { + ( $x, $y ) = @{$coords} ; + # Ignore if we are at the side or if we'd hit the heap. + $can_move = 0, last if $x + 1 >= $Opt{BOARD_SQUARES_X} ; + $can_move = 0, last if $Board{SQUARES}[$x + 1][$y]{TYPE} == $HEAP ; + } + } + else { # $action == $DOWN + foreach $coords ( @block ) { + ( $x, $y ) = @{$coords} ; + # Ignore if we are at the bottom or if we'd hit the heap. + $can_move = 0, last if $y + 1 >= $Opt{BOARD_SQUARES_Y} ; + $can_move = 0, last if $Board{SQUARES}[$x][$y + 1]{TYPE} == $HEAP ; + } + } + + # Its safe to move so do so. + if( $can_move ) { + @{$Block{SQUARES}} = &action::block( $action, @block ) ; + } + elsif( $action == $DOWN ) { + # We've hit bottom or heap. + foreach my $coords ( @block ) { + my( $x, $y ) = @{$coords} ; + $Board{SQUARES}[$x][$y]{TYPE} = $HEAP ; + # No need to draw its already there. + } + &action::create_block ; + } + + &action::draw_block ; # This is either the moved block or the new block. + + # Clear any filled rows. + &action::clear_row ; + + $can_move and not $ClearingRows ; +} + + +sub action::block { + my( $action, @oldblock ) = @_ ; + + my @newblock = () ; + my @pivot = &action::find_pivot( @oldblock ) if $action == $ROTATE ; + + foreach my $coords ( @oldblock ) { + my( $x, $y ) = @{$coords} ; + + # Remember the old square's colour. + my $colour = $Board{SQUARES}[$x][$y]{COLOUR} ; + + # Blank out old. + &action::draw_square( $x, $y, $BOARD ) ; + + # Perform the move. + if( $action == $LEFT ) { + $x-- ; + } + elsif( $action == $RIGHT ) { + $x++ ; + } + elsif( $action == $DOWN ) { + $y++ ; + } + elsif( $action == $ROTATE ) { + ( $x, $y ) = &action::rotate_block_square( @pivot, $x, $y ) ; + } + unshift @newblock, [ $x, $y ] ; + $Board{SQUARES}[$x][$y]{TYPE} = $BLOCK ; + $Board{SQUARES}[$x][$y]{COLOUR} = $colour ; + } + + @newblock ; +} + + +# Pivot algorithm taken from Advanced Perl Programming. +sub action::find_pivot { + my @block = shift ; + + my( $total_x, $total_y, $squares ) = ( 0, 0, 0 ) ; + + foreach my $coords ( @block ) { + my( $x, $y ) = @{$coords} ; + $total_x += $x ; + $total_y += $y ; + $squares++ ; + } + ( int( $total_x / $squares + 0.5 ) , int( $total_y / $squares + 0.5 ) ) ; +} + + +sub action::rotate_block_square { + my( $pivot_x, $pivot_y, $x, $y ) = @_ ; + + my $new_x = $pivot_x + ( $y - $pivot_y ) ; + my $new_y = $pivot_y - ( $x - $pivot_x ) ; + + ( $new_x, $new_y ) ; +} + + +sub action::clear_row { + my $done_row = 0 ; + + $ClearingRows = 1 ; + ROW : + for( my $y = $Opt{BOARD_SQUARES_Y} - 1 ; $y > 0 ; $y-- ) { + my $row_complete = 1 ; + COLUMN : + for( my $x = 0 ; $x < $Opt{BOARD_SQUARES_X} ; $x++ ) { + $row_complete = 0, last COLUMN + if $Board{SQUARES}[$x][$y]{TYPE} != $HEAP ; + } + if( $row_complete ) { + $done_row = 1 ; + &action::move_rows_down( $y ) ; # Move all higher rows down. + last ROW ; # We only need look once per action. + } + } + $ClearingRows = 0 unless $done_row ; +} + + +sub action::move_rows_down { + my $complete_row = shift ; + my( $x, $y, $colour ) ; + + # Increment the score. + $Opt{SCORE} += $Global{SCORE_INC} ; + $Buttons{SCORE}->configure( -text => $Opt{SCORE} ) ; + $Global{LINES}++ ; + $Buttons{LINES}->configure( -text => $Global{LINES} ) ; + $Global{INTERVAL} -= $Opt{SPEED_UP} if $Opt{SPEED_UP} ; + if( $Opt{USE_SPECIAL_LAYOUTS} and + ( $Opt{SCORE} % $Global{NEW_BOARD_TRIGGER} == 0 ) ) { + &action::new_board ; + $ClearingRows = 0 ; + return ; # No point in drawing if we've got a new board. + } + + # Special effect for deleting a row: colour the row to be deleted then + # pause for interval millisec. + $y = $complete_row ; + for( $x = 0 ; $x < $Opt{BOARD_SQUARES_X} ; $x++ ) { + $colour = $Board{SQUARES}[$x][$y]{COLOUR} ; + $Board{SQUARES}[$x][$y]{COLOUR} = $Const{ROW_HIGHLIGHT_COLOUR} ; + &action::draw_square( $x, $y, $HEAP ) ; + $Board{SQUARES}[$x][$y]{COLOUR} = $colour ; + } + + $Win->after( $Opt{INTERVAL}, sub { + for( $y = $complete_row - 1 ; $y > 0 ; $y-- ) { + for( $x = 0 ; $x < $Opt{BOARD_SQUARES_X} ; $x++ ) { + $Board{SQUARES}[$x][$y + 1]{COLOUR} = + $Board{SQUARES}[$x][$y]{COLOUR} ; + &action::draw_square( $x, $y + 1, $Board{SQUARES}[$x][$y]{TYPE} ) ; + &action::draw_square( $x, $y, $BOARD ) ; + } + } + # MUST be in this timed block - otherwise user could keep dropping + # during the pause and this screws things up because during the pause + # there is still an uncleared row, so by keeping their finger on the + # down key they can rack up the score. It also messes up the move + # down, although I'm not clear why. $ClearingRows seems to have cured + # the problem though. + $ClearingRows = 0 ; + } + ) ; +} + + +sub action::new_board { + my @layout = () ; + + # Layouts alternate between random and specified; the specified layouts + # are displayed in order. Random occurs 50% of the time unless we don't + # want random layouts. + if( ( not $Opt{USE_RANDOM_LAYOUTS} ) or + ( int( rand( $Const{LAYOUT_MAX} * 2 ) ) <= $Const{LAYOUT_MAX} ) ) { + @layout = @{$Const{"LAYOUT_" . $Const{LAYOUT}}}; + $Const{LAYOUT} = ++$Const{LAYOUT} % ( $Const{LAYOUT_MAX} + 1 ) ; + } + else { + my $y_limit = int( $Opt{BOARD_SQUARES_Y} / 2 ) ; + foreach my $i ( 0..( int( rand( $Opt{BOARD_SQUARES_X} * + $Opt{BOARD_SQUARES_Y} * 0.1 ) ) ) ) { + my( $x, $y ) = ( + int( rand( $Opt{BOARD_SQUARES_X} ) ), + int( rand( $y_limit ) + $y_limit ) + ) ; + + unshift @layout, [ $x, $y ] ; + } + } + + &action::clear_board ; + + my $colour = &get_colour ; + print "L: $colour\n" if $DEBUG ; + + foreach my $coords ( @layout ) { + my( $x, $y ) = @{$coords} ; + next if $x < 0 or $x >= $Opt{BOARD_SQUARES_X} or + $y < 0 or $y >= $Opt{BOARD_SQUARES_Y} ; + next if $Board{SQUARES}[$x][$y]{TYPE} == $BLOCK ; + $Board{SQUARES}[$x][$y]{TYPE} = $HEAP ; + $Board{SQUARES}[$x][$y]{COLOUR} = $colour ; + &action::draw_square( $x, $y, $HEAP ) ; + } +} + + +sub action::draw_block { + foreach my $coords ( @{$Block{SQUARES}} ) { + action::draw_square( @{$coords}, $BLOCK ) ; + } +} + + +sub action::draw_square { + my( $x, $y, $type ) = @_ ; + + if( $type == $BOARD ) { + $Board{CANVAS}->itemconfigure( + $Board{SQUARES}[$x][$y]{SQUARE}, + -fill => $Const{BOARD_BACKGROUND_COLOUR}, + ) ; + } + else { # ( $type == $BLOCK ) or ( $type == $HEAP ) + $Board{CANVAS}->itemconfigure( + $Board{SQUARES}[$x][$y]{SQUARE}, + -fill => $Board{SQUARES}[$x][$y]{COLOUR}, + ) ; + } + + $Board{SQUARES}[$x][$y]{TYPE} = $type ; +} + + +sub action::clear_board { + + for( my $x = 0 ; $x < $Opt{BOARD_SQUARES_X} ; $x++ ) { + for( my $y = 0 ; $y < $Opt{BOARD_SQUARES_Y} ; $y++ ) { + &action::draw_square( $x, $y, $BOARD ) ; + } + } +} + + +sub action::drop { + return if $ClearingRows ; + + &button::pause if $Global{STATE} == $PAUSED ; + &action::drop if not $ClearingRows and &action::advance( $DOWN ) ; +} + + +sub action::rotate { + + &button::pause if $Global{STATE} == $PAUSED ; + &action::advance( $ROTATE ) ; +} + + +sub action::move_left { + + &button::pause if $Global{STATE} == $PAUSED ; + &action::advance( $LEFT ) ; +} + + +sub action::move_right { + + &button::pause if $Global{STATE} == $PAUSED ; + &action::advance( $RIGHT ) ; +} + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-board-commands.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-board-commands.pl new file mode 100644 index 0000000..6dde1ba --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-board-commands.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl -w + +# $Id: petris-board-commands.pl,v 1.4 1999/09/06 19:04:38 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package board ; + + +sub create { + package main ; + + $Board{CANVAS}->delete( 'all' ) ; + + $Board{CANVAS}->configure( + -width => $Opt{BOARD_SQUARES_X} * $Opt{BOARD_SQUARE_LENGTH}, + -height => $Opt{BOARD_SQUARES_Y} * $Opt{BOARD_SQUARE_LENGTH}, + ) ; + + for( my $x = 0 ; $x < $Opt{BOARD_SQUARES_X} ; $x++ ) { + my $xlen = $x * $Opt{BOARD_SQUARE_LENGTH} ; + my $Xlen = $xlen + $Opt{BOARD_SQUARE_LENGTH} ; + for( my $y = 0 ; $y < $Opt{BOARD_SQUARES_Y} ; $y++ ) { + my $ylen = $y * $Opt{BOARD_SQUARE_LENGTH} ; + $Board{SQUARES}[$x][$y]{SQUARE} = $Board{CANVAS}->create( + 'rectangle', + $xlen, + $ylen, + $Xlen, + $ylen + $Opt{BOARD_SQUARE_LENGTH}, + -fill => $Const{BOARD_BACKGROUND_COLOUR}, + -outline => $Const{BOARD_OUTLINE_COLOUR}, + -tag => 'BOARD', + ) ; + $Board{SQUARES}[$x][$y]{TYPE} = $BOARD ; + $Board{SQUARES}[$x][$y]{COLOUR} = $Const{BOARD_BACKGROUND_COLOUR} ; + } + } + + $Board{CANVAS}->update ; +} + + +sub status { + package main ; + + local $_ = shift ; + + s/ /\n/g ; + $Board{STATUS}->configure( -text => $_ ) ; + $Board{STATUS}->update ; +} + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-board.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-board.pl new file mode 100644 index 0000000..3c9642b --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-board.pl @@ -0,0 +1,19 @@ +#!/usr/bin/perl -w + +# $Id: petris-board.pl,v 1.3 1999/08/08 15:46:59 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package main ; + + +$Board{CANVAS} = $Win->Canvas( + -width => $Const{BOARD_X_LENGTH}, + -height => $Const{BOARD_Y_LENGTH}, + )->pack() ; + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-button-commands.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-button-commands.pl new file mode 100644 index 0000000..9d944e1 --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-button-commands.pl @@ -0,0 +1,163 @@ +#!/usr/bin/perl -w + +# $Id: petris-button-commands.pl,v 1.9 1999/08/08 15:46:59 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package button ; + + +sub start { + package main ; + + return if $Global{STATE} != $NOTRUNNING ; + + # The shorter the interval the higher the scoring since this is harder. + # Similarly, the smaller the board the harder, so again this is reflected + # in the scoring. + $Global{SCORE_INC} = + int( ( ( $Const{BOARD_SQUARES_X_MAX} - $Opt{BOARD_SQUARES_X} ) + + ( $Const{BOARD_SQUARES_Y_MAX} - $Opt{BOARD_SQUARES_Y} ) + + ( ( $Const{INTERVAL_MAX} - $Opt{INTERVAL} ) / 100 ) + ) / 5 ) ; + + $Global{NEW_BOARD_TRIGGER} = $Global{SCORE_INC} * $Opt{BOARD_SQUARES_Y} ; + + $Buttons{START}->configure( -state => 'disabled' ) ; + $Buttons{PAUSE}->configure( -state => 'normal' ) ; + + $Opt{SCORE} = 0 ; + $Buttons{SCORE}->configure( -text => $Opt{SCORE} ) ; + $Buttons{HIGH_SCORE}->configure( -text => $Opt{HIGH_SCORE} ) ; + + $Global{LINES} = 0 ; + $Buttons{LINES}->configure( -text => $Global{LINES} ) ; + + &action::clear_board ; + + if( $Opt{USE_SPECIAL_LAYOUTS} ) { + $Const{LAYOUT} = int( rand( $Const{LAYOUT_MAX} + 1 ) ) ; + &action::new_board ; + } + + # Delete any old block. + %Block = () ; + + $Global{BLOCK_MAX} = $Opt{USE_SPECIAL_SHAPES} ? + $Const{BLOCK_SPL_MAX} : $Const{BLOCK_STD_MAX} ; + $Global{BLOCK_MAX}++ ; + + # Set up new block. + $Global{INTERVAL} = $Opt{INTERVAL} ; + &action::create_block ; + &action::draw_block ; + + $Global{STATE} = $RUNNING ; + &board::status( 'Running' ) ; + $Win->configure( -cursor => 'left_ptr' ) ; # The default cursor. + &action::tick ; +} + + +sub pause { + package main ; + + $Win->configure( -cursor => 'left_ptr' ) ; # The default cursor. + + if( $Global{STATE} == $RUNNING ) { + $Global{STATE} = $PAUSED ; + $Win->configure( -cursor => 'clock' ) ; + &board::status( 'Paused' ) ; + $Buttons{PAUSE}->configure( -text => 'Resume' ) ; + + if( $DEBUG ) { + for( my $y = int( $Opt{BOARD_SQUARES_Y} / 2 ) ; + $y < $Opt{BOARD_SQUARES_Y} ; $y++ ) { + print STDERR "$y\t"; + for( my $x = 0 ; $x < $Opt{BOARD_SQUARES_X} ; $x++ ) { + print STDERR "$Board{SQUARES}[$x][$y]{TYPE}" ; + } + print STDERR "\n"; + } + print STDERR "\n"; + } + } + elsif( $Global{STATE} == $PAUSED ) { + $Global{STATE} = $RUNNING ; + &board::status( 'Running' ) ; + $Buttons{PAUSE}->configure( -text => 'Pause' ) ; + &action::tick ; + } + else { + # $Global{STATE} == $NOTRUNNING so we do nothing. + &board::status( 'Ready' ) ; + } +} + + +sub quit { + package main ; + + &write_opts unless $Global{WROTE_OPTS} ; + exit ; +} + + +sub options { + package main ; + + + &button::pause if $Global{STATE} != $PAUSED ; + $Win->configure( -cursor => 'watch' ) ; + &board::status( 'Setting options...' ) ; + + &options::options ; + + $Win->configure( -cursor => 'clock' ) ; +} + + +sub help { + package main ; + + &button::pause if $Global{STATE} != $PAUSED ; + $Win->configure( -cursor => 'watch' ) ; + &board::status( 'Showing help...' ) ; + + &help::help ; + + $Win->configure( -cursor => 'clock' ) ; +} + + +sub about { + package main ; + + &button::pause if $Global{STATE} != $PAUSED ; + &board::status( 'Showing about box...' ) ; + + my $text = <<__EOT__ ; +Petris v $VERSION + +summer\@chest.ac.uk + +Copyright (c) Mark Summerfield 1998/9. +All Rights Reserved. + +May be used/distributed under the GPL. +__EOT__ + + my $msg = $Win->MesgBox( + -title => "About Petris", + -text => $text, + ) ; + $msg->Show ; + + &board::status( 'Paused' ) ; +} + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-buttons.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-buttons.pl new file mode 100644 index 0000000..fb43c97 --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-buttons.pl @@ -0,0 +1,106 @@ +#!/usr/bin/perl -w + +# $Id: petris-buttons.pl,v 1.3 1999/08/08 15:46:59 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package main ; + + +my $Buttons = $Win->Frame()->pack( + -side => 'left', + -anchor => 'nw', + ) ; + +$Buttons{START} = $Buttons->Button( + -text => 'Start', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => \&button::start, + )->grid( -row => 0, -column => 0 ) ; + +$Buttons{PAUSE} = $Buttons->Button( + -text => 'Pause', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => \&button::pause, + )->grid( -row => 1, -column => 0 ) ; + +$Buttons{OPTIONS} = $Buttons->Button( + -text => 'Options', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => \&button::options, + )->grid( -row => 2, -column => 0 ) ; + +$Buttons{ABOUT} = $Buttons->Button( + -text => 'About', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => \&button::about, + )->grid( -row => 3, -column => 0 ) ; + +$Buttons{HELP} = $Buttons->Button( + -text => 'Help', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => \&button::help, + )->grid( -row => 4, -column => 0 ) ; + + +$Buttons{QUIT} = $Buttons->Button( + -text => 'Quit', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => \&button::quit, + )->grid( -row => 5, -column => 0 ) ; + +$Buttons->Label( + -text => 'High Score', + -width => $Const{BUTTON_WIDTH}, + )->grid( -row => 6, -column => 0 ) ; + +$Buttons{HIGH_SCORE} = $Buttons->Label( + -text => $Opt{HIGH_SCORE}, + -width => $Const{BUTTON_WIDTH}, + -fg => 'DarkRed', + -relief => 'sunken', + )->grid( -row => 7, -column => 0 ) ; + +$Buttons->Label( + -text => 'Score', + -width => $Const{BUTTON_WIDTH}, + )->grid( -row => 8, -column => 0 ) ; + +$Buttons{SCORE} = $Buttons->Label( + -text => '0', + -width => $Const{BUTTON_WIDTH}, + -fg => 'DarkGreen', + -relief => 'sunken', + )->grid( -row => 9, -column => 0 ) ; + + +$Buttons->Label( + -text => 'Lines', + -width => $Const{BUTTON_WIDTH}, + )->grid( -row => 10, -column => 0 ) ; + +$Buttons{LINES} = $Buttons->Label( + -text => '0', + -width => $Const{BUTTON_WIDTH}, + -fg => 'DarkGreen', + -relief => 'sunken', + )->grid( -row => 11, -column => 0 ) ; + + +$Board{STATUS} = $Buttons->Label( + -width => $Const{BUTTON_WIDTH} * 1.2, + -text => 'Running', + -relief => 'groove', + )->grid( -pady => 10, -row => 13, -column => 0 ) ; + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-consts.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-consts.pl new file mode 100644 index 0000000..b58013f --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-consts.pl @@ -0,0 +1,61 @@ +#!/usr/bin/perl -w + +# $Id: petris-consts.pl,v 1.8 1999/08/28 21:46:10 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package main ; + + +if( $^O =~ /win32/i ) { + $Const{OPTS_FILE} = 'PETRIS.INI' ; +} +else { + $Const{OPTS_FILE} = ( $ENV{HOME} or $ENV{LOGDIR} or (getpwuid( $> ))[7]) + . '/.games/petrisrc' ; +} + +# Enumerations. +( $BOARD, $HEAP, $BLOCK ) = ( 0, 1, 2 ) ; +( $ROTATE, $LEFT, $RIGHT, $DOWN ) = ( 0, 1, 2, 3 ) ; +( $RUNNING, $PAUSED, $NOTRUNNING ) = ( 1, 2, 0 ) ; + +# Limits and defaults. +$Const{BUTTON_WIDTH} = 10 ; + +$Const{INTERVAL_DEF} = 300 ; +$Const{INTERVAL_MIN} = 100 ; +$Const{INTERVAL_MAX} = 1000 ; + +$Const{SPEED_UP_DEF} = 1 ; +$Const{SPEED_UP_MIN} = 0 ; +$Const{SPEED_UP_MAX} = 10 ; + +$Const{BOARD_SQUARES_X_DEF} = 12 ; +$Const{BOARD_SQUARES_X_MIN} = 10 ; +$Const{BOARD_SQUARES_X_MAX} = 30 ; + +$Const{BOARD_SQUARES_Y_DEF} = 25 ; +$Const{BOARD_SQUARES_Y_MIN} = 15 ; +$Const{BOARD_SQUARES_Y_MAX} = 70 ; + +$Const{BOARD_SQUARE_LENGTH_DEF} = 22 ; +$Const{BOARD_SQUARE_LENGTH_MIN} = 8 ; +$Const{BOARD_SQUARE_LENGTH_MAX} = 40 ; + +# We specify colours in hex because of the get_colour routine. +$Const{BOARD_BACKGROUND_COLOUR} = '#FFFFFF' ; # white +$Const{BOARD_OUTLINE_COLOUR} = '#DFDFDF' ; # grey80 +$Const{ROW_HIGHLIGHT_COLOUR} = '#000000' ; # black + +$Const{USE_SPECIAL_SHAPES} = 1 ; +$Const{USE_SPECIAL_LAYOUTS} = 1 ; +$Const{USE_RANDOM_LAYOUTS} = 1 ; + +$Const{HELP_FILE} = "$RealBin/petris-help.pod" ; + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-help.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-help.pl new file mode 100644 index 0000000..4e1176f --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-help.pl @@ -0,0 +1,65 @@ +#!/usr/bin/perl -w + +# $Id: petris-help.pl,v 1.7 1999/08/28 21:46:10 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package help ; + + +my $HelpWin ; +my $TextBox ; + + +sub help { + package main ; + + # Set up the help window and some bindings to close it. + $HelpWin = $Win->Toplevel() ; + $HelpWin->title( 'Petris Help' ) ; + $HelpWin->protocol( "WM_DELETE_WINDOW", \&help::close ) ; + $HelpWin->bind( '', \&help::close ) ; + $HelpWin->bind( '', \&help::close ) ; + $HelpWin->bind( '', \&help::close ) ; + $HelpWin->bind( '', \&help::close ) ; + + # Set up the text widget. + $TextBox = $HelpWin->Scrolled( 'Text', + -background => 'white', + -wrap => 'word', + -scrollbars => 'e', + -width => 80, + -height => 40, + )->pack( -fill => 'both', -expand => 'y' ) ; + my $text = $TextBox->Subwidget( 'text' ) ; + $text->configure( -takefocus => 1 ) ; + $text->focus ; + + if( open HELP, $Const{HELP_FILE} ) { + local $/ = '' ; # render_pod requires paragraphs. + &tk::text::render_pod( $text, ) ; + close HELP ; + } + else { + message( + 'Warning', + 'Help', + "Cannot open help file `$Const{HELP_FILE}': $!" + ) ; + } + + $text->configure( -state => 'disabled' ) ; +} + + +sub close { + + &board::status( 'Paused' ) ; + $HelpWin->destroy ; +} + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-help.pod b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-help.pod new file mode 100644 index 0000000..c9dd99c --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-help.pod @@ -0,0 +1,95 @@ +=head1 Petris Help + +# $Id: petris-help.pod,v 1.3 1999/08/28 22:14:01 root Exp $ + +# Copyright (c) Mark Summerfield 1999. All Rights Reserved. +# May be used/distributed under the GPL. + +Press > or > to close this help window; scroll using +the scrollbar, arrow keys, > or >. + +=head2 Aim + +This is a standard Tetris game. The aim is to gain the highest possible +score. + +=head2 Play + +You must fit the dropping blocks together so as to completely fill rows. +Each filled row is removed from the board and the score is increased +for every removed row. The dropping blocks can be moved from side to side +and rotated - but they cannot overlap the edges or the blocks that have +gone before. Game ends when you cannot place another block on the board + +=head2 Keystrokes + +=over + +=item * + +C Start a new game. + +=item + +C Pause/resume the game. + +=item + +C Change the options. + +=item + +C Show the About box. + +=item + +C Invoke this help window. + +=item + +C Quit the game. + +=item + +C, C, C Rotate the block. (Resumes if paused.) + +=item + +C, C, C Drop the block immediately. (Resumes if paused.) + +=item + +C, C, C Move the block left. (Resumes if paused.) + +=item + +C, C, C Move the block right. (Resumes if paused.) + +=back + +To see other keystrokes, or to change or add your own, see the file +C. + +=head2 Options + +Options should be set using the Options dialogue. User options are stored in +C<~/.games/petrisrc> (or C for Win32). + +Any options you change in this file take precedence over the default options. +To reinstate a default option delete or comment out (with C<#>) the option(s) +you wish to reinstate - the next time you run the game the defaults will be +back. + + +=head2 Copyright + +C + +Copyright (c) Mark Summerfield 1999. All Rights Reserved. + +Petris may be used/distributed under the GPL. + +Petris is a clone of Tetris which was invented by Alexey Paszhitnov, Dmitry +Pavlovsky and Vadim Gerasimov. + +=cut diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-icon-16x16.xpm b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-icon-16x16.xpm new file mode 100644 index 0000000..0b5bdb1 --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-icon-16x16.xpm @@ -0,0 +1,27 @@ +/* XPM */ +/* $Id: petris-icon-16x16.xpm,v 1.1 1999/02/21 19:23:32 root Exp $ */ +static char * petris_icon_16x16_xpm[] = { +"16 16 6 1", +" c None", +"! c red", +"# c #00AF00", +"$ c maroon3", +"% c black", +"& c blue", +" ", +" ", +" $$ ", +" $$ ", +" $$$$$$ ", +" $$$$$$ ", +" ", +" ", +" ## ", +" ## ", +" ## %% ", +" ## %% ", +"!!!!##%%%%&& ", +"!!!!##%%%%&& ", +"!!!!##%% &&&&&&", +"!!!!##%% &&&&&&", +}; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-keys.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-keys.pl new file mode 100644 index 0000000..a95000c --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-keys.pl @@ -0,0 +1,57 @@ +#!/usr/bin/perl -w + +# $Id: petris-keys.pl,v 1.4 1999/08/28 21:46:10 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package main ; + + +# Key bindings for the main window. +$Win->bind( '', \&button::start ) ; +$Win->bind( '', \&button::start ) ; +$Win->bind( '', \&button::start ) ; + +$Win->bind( '', \&button::pause ) ; # Pause +$Win->bind( '', \&button::pause ) ; +$Win->bind( '

', \&button::pause ) ; +$Win->bind( '', \&button::pause ) ; # Resume +$Win->bind( '', \&button::pause ) ; +$Win->bind( '', \&button::pause ) ; +$Win->bind( '', \&button::pause ) ; + +$Win->bind( '', \&button::options ) ; +$Win->bind( '', \&button::options ) ; +$Win->bind( '', \&button::options ) ; + +$Win->bind( '', \&button::about ) ; +$Win->bind( '', \&button::about ) ; +$Win->bind( '', \&button::about ) ; + +$Win->bind( '', \&button::help ) ; +$Win->bind( '', \&button::help ) ; +#$Win->bind( '', \&button::help ) ; # Can't do this with vi keys later. +$Win->bind( '', \&button::help ) ; + +$Win->bind( '', \&button::quit ) ; +$Win->bind( '', \&button::quit ) ; +$Win->bind( '', \&button::quit ) ; + +$Win->bind( '', \&action::rotate ) ; +$Win->bind( '', \&action::rotate ) ; # vi +$Win->bind( '', \&action::rotate ) ; # left hand +$Win->bind( '', \&action::drop ) ; +$Win->bind( '', \&action::drop ) ; # vi +$Win->bind( '', \&action::drop ) ; # left hand +$Win->bind( '', \&action::move_left ) ; +$Win->bind( '', \&action::move_left ) ; # vi +$Win->bind( '', \&action::move_left ) ; # left hand +$Win->bind( '', \&action::move_right ) ; +$Win->bind( '', \&action::move_right ) ; # vi +$Win->bind( '', \&action::move_right ) ; # left hand + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-layouts.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-layouts.pl new file mode 100644 index 0000000..6cd9646 --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-layouts.pl @@ -0,0 +1,177 @@ +#!/usr/bin/perl -w + +# $Id: petris-layouts.pl,v 1.2 1999/08/08 15:46:59 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package main ; + + +# Layouts basically just pre fill-in squares on the board. Any which are out +# of range for the board size chosen are ignored. The standard ones are +# designed for the default board size (12 x 25), but will work with all larger +# boards, although offset to the centre left. + +# If you want to test out a new layout then add it at the END of the ones given +# but name it $Const{LAYOUT_0}, i.e. make it overwrite the standard layout zero; +# then set the $Const{LAYOUT_MAX} to zero so the only layout that will +# appear will be the new one. Once satisfied that its shape is OK, change its +# number to the next in line and set the layout max to that number. + +# 0 ----- +# | | +# | | +# +$Const{LAYOUT_0} = [ + [3,24],[3,23],[3,22],[3,21],[3,20],[3,19],[3,18], + [3,17],[3,16],[3,15],[3,14],[3,13], + [8,24],[8,23],[8,22],[8,21],[8,20],[8,19],[8,18], + [8,17],[8,16], [8,15],[8,14],[8,13], + [2,13],[4,13],[5,13],[6,13],[7,13],[9,13], + ] ; + + +# 1 ---- +# ---- +# ---- +# ---- +# +$Const{LAYOUT_1} = [ + [2,24],[3,24],[4,24],[5,24],[6,24],[7,24],[8,24],[9,24],[10,24],[11,24], + [0,21],[1,21],[2,21],[3,21],[4,21],[5,21],[6,21],[7,21],[8,21],[9,21], + [2,18],[3,18],[4,18],[5,18],[6,18],[7,18],[8,18],[9,18],[10,18],[11,18], + [0,15],[1,15],[2,15],[3,15],[4,15],[5,15],[6,15],[7,15],[8,15],[9,15], + [2,12],[3,12],[4,12],[5,12],[6,12],[7,12],[8,12],[9,12],[10,12],[11,12], + ] ; + + +# 2 - +# / \ +# +# - +# / \ +# +$Const{LAYOUT_2} = [ + [0,24],[1,23],[2,22],[3,21],[4,20],[5,19], + [6,19],[7,20],[8,21],[9,22],[10,23],[11,24], + [0,18],[1,17],[2,16],[3,15],[4,14],[5,13], + [6,13],[7,14],[8,15],[9,16],[10,17],[11,18], + ] ; + + +# 3 | +# | | | +# | | | | | +# | | | | | +# +$Const{LAYOUT_3} = [ + [10,24],[10,23],[10,22],[10,21],[10,20],[10,19],[10,18], + [8,24],[8,23],[8,22],[8,21],[8,20],[8,19],[8,18],[8,17],[8,17], + [6,24],[6,23],[6,22],[6,21],[6,20],[6,19],[6,18],[6,17],[6,16],[6,15], + [5,24],[5,23],[5,22],[5,21],[5,20],[5,19],[5,18],[5,17],[5,16],[5,15], + [3,24],[3,23],[3,22],[3,21],[3,20],[3,19],[3,18],[3,17],[3,17], + [1,24],[1,23],[1,22],[1,21],[1,20],[1,19],[1,18], + ] ; + + +# 4 --- --- +# -- -- +# - - +# -- -- +# +$Const{LAYOUT_4} = [ + [0,21],[1,21], + [10,21],[11,21], + [0,18],[1,18],[2,18], + [9,18],[10,18],[11,18], + [0,15],[1,15],[2,15],[3,15], + [8,15],[9,15],[10,15],[11,15], + [0,12],[1,12],[2,12],[3,12],[4,12], + [7,12],[8,12],[9,12],[10,12],[11,12], + [0,24],[1,24],[2,24],[3,24], + [8,24],[9,24],[10,24],[11,24], + ] ; + + +# 5 \ / +# - +# +# \ / +# - +# +$Const{LAYOUT_5} = [ + [0,19],[1,20],[2,21],[3,22],[4,23],[5,24], + [6,24],[7,23],[8,22],[9,21],[10,20],[11,19], + [0,13],[1,14],[2,15],[3,16],[4,17],[5,18], + [6,18],[7,17],[8,16],[9,15],[10,14],[11,13], + ] ; + + +# 6 "X" +# +$Const{LAYOUT_6} = [ + [0,24],[1,23],[2,22],[3,21],[4,20],[5,19], + [11,24],[10,23],[9,22],[8,21],[7,20],[6,19], + [0,13],[1,14],[2,15],[3,16],[4,17],[5,18], + [11,13],[10,14],[9,15],[8,16],[7,17],[6,18], + ] ; + + +# 7 "I" +# +$Const{LAYOUT_7} = [ + [5,23],[5,22],[5,21],[5,20],[5,19],[5,18], + [5,17],[5,16],[5,15],[5,14],[5,13],[5,12], + [6,23],[6,22],[6,21],[6,20],[6,19],[6,18], + [6,17],[6,16],[6,15],[6,14],[6,13],[6,12], + [2,12],[3,12],[4,12],[7,12],[8,12],[9,12], + [2,24],[3,24],[4,24],[7,24],[8,24],[9,24], + [5,24],[6,24],[5,23],[6,23], + ] ; + + + +# 8 "TET" +# "RIS" +# +$Const{LAYOUT_8} = [ + [0,13],[1,13],[2,13], + [2,14],[2,15],[1,15], + [0,14],[0,15],[0,16],[0,17], + + [4,13],[5,13],[6,13],[7,13], + [4,14], + [4,15],[5,15],[6,15], + [4,16], + [4,17],[5,17],[6,17],[7,17], + + [9,13],[10,13],[11,13], + [10,14],[10,15],[10,16],[10,17], + + [0,19],[0,20],[0,21],[0,22],[0,23], + [1,19],[2,19],[3,19], + [3,20], + [1,21],[2,21],[3,21], + [2,22],[3,23], + + [6,19],[6,20],[6,21],[6,22],[6,23], + [5,19],[7,19],[5,23],[7,23], + + [9,19],[10,19],[11,19], + [9,20], + [9,21],[10,21],[11,21], + [11,22], + [9,23],[10,23],[11,23], + + ] ; + + +$Const{LAYOUT_MAX} = 8 ; # The index of the last layout. + + +1 ; + + diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-options.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-options.pl new file mode 100644 index 0000000..305563f --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-options.pl @@ -0,0 +1,211 @@ +#!/usr/bin/perl -w + +# $Id: petris-options.pl,v 1.8 1999/08/08 15:46:59 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package options ; + + +my $OptionsWin ; + +# Local variables to store values. Want them global to the module. +my( $Interval, + $BoardSquaresX, + $BoardSquaresY, + $BoardSquareLength, + $UseSpecialShapes, + $UseSpecialLayouts, + $UseRandomLayouts, + $SpeedUp, + ) ; + + +sub options { + package main ; + + # Start with existing values. + $Interval = $Opt{INTERVAL} ; + $SpeedUp = $Opt{SPEED_UP} ; + $BoardSquaresX = $Opt{BOARD_SQUARES_X} ; + $BoardSquaresY = $Opt{BOARD_SQUARES_Y} ; + $BoardSquareLength = $Opt{BOARD_SQUARE_LENGTH} ; + $UseSpecialShapes = $Opt{USE_SPECIAL_SHAPES} ; + $UseSpecialLayouts = $Opt{USE_SPECIAL_LAYOUTS} ; + $UseRandomLayouts = $Opt{USE_RANDOM_LAYOUTS} ; + + # Set up the options window. + $OptionsWin = $Win->Toplevel() ; + $OptionsWin->title( 'Petris Options' ) ; + $OptionsWin->protocol( "WM_DELETE_WINDOW", [ \&options::close, 0 ] ) ; + + &options::key_bindings ; + + # Scales. + my $scale ; + $scale = &options::create_scale( + $Const{INTERVAL_MIN}, $Const{INTERVAL_MAX}, + 100, "Interval (millisecs)", 0, 0 ) ; + $scale->configure( -variable => \$Interval ) ; + + $scale = &options::create_scale( + $Const{SPEED_UP_MIN}, $Const{SPEED_UP_MAX}, + 1, "Interval speed up (millisecs)", 0, 3 ) ; + $scale->configure( -variable => \$SpeedUp ) ; + + + $scale = &options::create_scale( + $Const{BOARD_SQUARES_X_MIN}, $Const{BOARD_SQUARES_X_MAX}, + 2, "Width (squares)", 2, 0 ) ; + $scale->configure( -variable => \$BoardSquaresX, ) ; + + $scale = &options::create_scale( + $Const{BOARD_SQUARES_Y_MIN}, $Const{BOARD_SQUARES_Y_MAX}, + 5, "Height (squares)", 2, 3 ) ; + $scale->configure( -variable => \$BoardSquaresY, ) ; + + $scale = &options::create_scale( + $Const{BOARD_SQUARE_LENGTH_MIN}, $Const{BOARD_SQUARE_LENGTH_MAX}, + 4, "Square width (pixels)", 4, 0 ) ; + $scale->configure( -variable => \$BoardSquareLength, ) ; + + # Special shapes checkbox. + $OptionsWin->Checkbutton( + -text => 'Extra shapes?', + -variable => \$UseSpecialShapes, + )->grid( -row => 4, -column => 3, -columnspan => 1, -sticky => 'w' ) ; + + # Special layouts checkbox. + $OptionsWin->Checkbutton( + -text => 'Layouts?', + -variable => \$UseSpecialLayouts, + )->grid( -row => 4, -column => 4, -columnspan => 1, -sticky => 'w' ) ; + + # Random layouts checkbox. + $OptionsWin->Checkbutton( + -text => 'Random Layouts?', + -variable => \$UseRandomLayouts, + )->grid( -row => 4, -column => 5, -columnspan => 1, -sticky => 'w' ) ; + + + my $Frame = $OptionsWin->Frame()-> + grid( -row => 5, -column => 3, -columnspan => 3 ) ; + + # Save button. + $Frame->Button( + -text => 'Save', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => [ \&options::close, 1 ], + )->grid( -row => 1, -column => 1, -sticky => 'w' ) ; + + # Cancel button. + $Frame->Button( + -text => 'Cancel', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => [ \&options::close, 0 ], + )->grid( -row => 1, -column => 2, -sticky => 'w' ) ; + + # Defaults button. + $Frame->Button( + -text => 'Defaults', + -underline => 0, + -width => $Const{BUTTON_WIDTH}, + -command => \&options::defaults, + )->grid( -row => 1, -column => 3, -sticky => 'w' ) ; + + &window_centre( $OptionsWin ) ; +} + + +sub create_scale { + package main ; + + my( $min, $max, $interval, $title, $row, $col ) = @_ ; + + my $scale = $OptionsWin->Scale( + -orient => 'horizontal', + -from => $min, + -to => $max, + -tickinterval => $interval, + -label => $title, + '-length' => 290, + )->grid( -row => $row, -column => $col, -rowspan => 2, -columnspan => 3 ) ; + + $scale ; +} + + +sub key_bindings { + package main ; + + # Cancel keyboard bindings. + $OptionsWin->bind( '', [ \&options::close, 0 ] ) ; + $OptionsWin->bind( '', [ \&options::close, 0 ] ) ; + $OptionsWin->bind( '', [ \&options::close, 0 ] ) ; + + # Save keyboard bindings. + $OptionsWin->bind( '', [ \&options::close, 1 ] ) ; + $OptionsWin->bind( '', [ \&options::close, 1 ] ) ; + $OptionsWin->bind( '', [ \&options::close, 1 ] ) ; + + # Defaults keyboard bindings. + $OptionsWin->bind( '', \&options::defaults ) ; + $OptionsWin->bind( '', \&options::defaults ) ; +} + + +sub close { + package main ; + + shift if ref $_[0] ; # Some callers include an object ref. + my $save = shift ; + + if( $save ) { + my $redo_board = 0 ; + if( $Opt{BOARD_SQUARES_X} != $BoardSquaresX or + $Opt{BOARD_SQUARES_Y} != $BoardSquaresY or + $Opt{BOARD_SQUARE_LENGTH} != $BoardSquareLength ) { + $redo_board = 1 ; + } + + $Opt{INTERVAL} = $Interval ; + $Opt{BOARD_SQUARES_X} = $BoardSquaresX ; + $Opt{BOARD_SQUARES_Y} = $BoardSquaresY ; + $Opt{BOARD_SQUARE_LENGTH} = $BoardSquareLength ; + $Opt{USE_SPECIAL_SHAPES} = $UseSpecialShapes ; + $Opt{USE_SPECIAL_LAYOUTS} = $UseSpecialLayouts ; + $Opt{USE_RANDOM_LAYOUTS} = $UseRandomLayouts ; + $Opt{SPEED_UP} = $SpeedUp ; + + &write_opts ; + if( $redo_board ) { + &board::create ; + &window_centre( $Win ) ; + &action::game_over( 'OPTIONS' ) ; + } + } + &board::status( 'Paused' ) unless $save ; + $OptionsWin->destroy ; +} + + +sub defaults { + package main ; + + $Interval = $Const{INTERVAL_DEF} ; + $SpeedUp = $Const{SPEED_UP_DEF} ; + $BoardSquaresX = $Const{BOARD_SQUARES_X_DEF} ; + $BoardSquaresY = $Const{BOARD_SQUARES_Y_DEF} ; + $BoardSquareLength = $Const{BOARD_SQUARE_LENGTH_DEF} ; + $UseSpecialShapes = $Const{USE_SPECIAL_SHAPES} ; + $UseSpecialLayouts = $Const{USE_SPECIAL_LAYOUTS} ; + $UseRandomLayouts = $Const{USE_RANDOM_LAYOUTS} ; +} + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-opts.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-opts.pl new file mode 100644 index 0000000..8ebbcfc --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-opts.pl @@ -0,0 +1,48 @@ +#!/usr/bin/perl -w + +# $Id: petris-opts.pl,v 1.3 1999/08/08 15:46:59 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package main ; + + +$Opt{INTERVAL} = $Const{INTERVAL_DEF} ; +$Opt{SPEED_UP} = $Const{SPEED_UP_DEF} ; + +$Opt{BOARD_SQUARES_X} = $Const{BOARD_SQUARES_X_DEF} ; +$Opt{BOARD_SQUARES_Y} = $Const{BOARD_SQUARES_Y_DEF} ; + +$Opt{BOARD_SQUARE_LENGTH} = $Const{BOARD_SQUARE_LENGTH_DEF} ; + +$Opt{HIGH_SCORE} = 4662 ; + +$Opt{USE_SPECIAL_SHAPES} = $Const{USE_SPECIAL_SHAPES} ; +$Opt{USE_SPECIAL_LAYOUTS} = $Const{USE_SPECIAL_LAYOUTS} ; +$Opt{USE_RANDOM_LAYOUTS} = $Const{USE_RANDOM_LAYOUTS} ; + + +sub opts_check { + + $Opt{INTERVAL} = $Const{INTERVAL_DEF} + if $Opt{INTERVAL} < $Const{INTERVAL_MIN} or + $Opt{INTERVAL} > $Const{INTERVAL_MAX} ; + + $Opt{BOARD_SQUARES_X} = $Const{BOARD_SQUARES_X_DEF} + if $Opt{BOARD_SQUARES_X} < $Const{BOARD_SQUARES_X_MIN} or + $Opt{BOARD_SQUARES_X} > $Const{BOARD_SQUARES_X_MAX} ; + + $Opt{BOARD_SQUARES_Y} = $Const{BOARD_SQUARES_Y_DEF} + if $Opt{BOARD_SQUARES_Y} < $Const{BOARD_SQUARES_Y_MIN} or + $Opt{BOARD_SQUARES_Y} > $Const{BOARD_SQUARES_Y_MAX} ; + + $Opt{BOARD_SQUARE_LENGTH} = $Const{BOARD_SQUARE_LENGTH_DEF} + if $Opt{BOARD_SQUARE_LENGTH} < $Const{BOARD_SQUARE_LENGTH_MIN} or + $Opt{BOARD_SQUARE_LENGTH} > $Const{BOARD_SQUARE_LENGTH_MAX} ; +} + + +1 ; diff --git a/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-shapes.pl b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-shapes.pl new file mode 100644 index 0000000..33755d2 --- /dev/null +++ b/sample-app/protex_tutorial/petris/gitpan-petris-08e5dc8/petris-shapes.pl @@ -0,0 +1,83 @@ +#!/usr/bin/perl -w + +# $Id: petris-shapes.pl,v 1.2 1999/08/08 15:46:59 root Exp $ + +# Copyright (c) Mark Summerfield 1998/9. All Rights Reserved. +# May be used/distributed under the GPL. + +use strict ; + +package main ; + + +# Starting offsets. +my $x = int( ( $Opt{BOARD_SQUARES_X} - 4 ) / 2 ) ; # Centred. +my $y = 0 ; + +# Pieces are described here. There can be as many different kinds as you like. +# They don't have to be made of four squares either - any number is fine, so +# long as it isn't wider than the board, and they should fit within a 4 x 4 +# area - and component parts don't have to join up. + +# If you want to test out a new piece then add it at the END of the ones given +# but name it $Const{BLOCK_0}, i.e. make it overwrite the standard block zero; +# then set the $Const{BLOCK_SPL_MAX} to zero so the only block that will +# appear will be the new one. Once satisfied that its shape is OK, change its +# number to the next in line and set the special max to that number. + +# Standard pieces. + +# 0 1 2 3 4 5 6 +# +# @@@@ @ @@ @@ @@ @ @ +# @@@ @@ @@ @@ @ @ +# @@ @@ + +$Const{BLOCK_0} = [ [$x, $y], [$x+1, $y], [$x+2, $y], [$x+3, $y] ] ; +$Const{BLOCK_1} = [ [$x+1, $y], [$x, $y+1], [$x+1, $y+1], [$x+2, $y+1] ] ; +$Const{BLOCK_2} = [ [$x, $y], [$x+1, $y], [$x, $y+1], [$x+1, $y+1] ] ; +$Const{BLOCK_3} = [ [$x, $y], [$x+1, $y], [$x+1, $y+1], [$x+2, $y+1] ] ; +$Const{BLOCK_4} = [ [$x+1, $y], [$x+2, $y], [$x, $y+1], [$x+1, $y+1] ] ; +$Const{BLOCK_5} = [ [$x, $y], [$x, $y+1], [$x, $y+2], [$x+1, $y+2] ] ; +$Const{BLOCK_6} = [ [$x+1, $y], [$x+1, $y+1], [$x+1, $y+2], [$x, $y+2] ] ; + +$Const{BLOCK_STD_MAX} = 6 ; # The index of the last standard block type. + + +# Special pieces. + +# 7 +# +# @@ +# @ +$Const{BLOCK_7} = [ [$x, $y], [$x+1, $y], [$x+1, $y+1] ] ; + + +# 8 +# +# @ +# @ +$Const{BLOCK_8} = [ [$x, $y], [$x+1, $y+1] ] ; + + +# 9 +# +# @ +# @@@ +# @ +$Const{BLOCK_9} = [ [$x+1, $y], [$x, $y+1], [$x+1, $y+1], [$x+2, $y+1], + [$x+1, $y+2] ] ; + + +# 10 +# +# @ @ +# @ @ +$Const{BLOCK_10} = [ [$x, $y], [$x+2, $y], [$x, $y+1], [$x+2, $y+1] ] ; + + +$Const{BLOCK_SPL_MAX} = 8 ; # The index of the last block type. +# NB We don't use types 9 and 10 - they're too difficult! + + +1 ; diff --git a/sample-app/protex_tutorial/run_detect b/sample-app/protex_tutorial/run_detect new file mode 100755 index 0000000..8648fab --- /dev/null +++ b/sample-app/protex_tutorial/run_detect @@ -0,0 +1,6 @@ +#!/bin/bash + +detect --blackduck.url=https://poc31.blackduck.synopsys.com \ + --blackduck.trust.cert=true \ + --blackduck.api.token=ZDZkYWMyZDAtYWJkNS00ZmNhLWE2MWMtMDRkNDdlNDc3M2NkOmMxYzkwYzA4LTdiZWMtNGY2Ni04Y2M2LWQ0YTcyOTlmZWQ1MQ== + $* \ No newline at end of file diff --git a/sample-app/protex_tutorial/samplefile1.h b/sample-app/protex_tutorial/samplefile1.h new file mode 100644 index 0000000..ebced5f --- /dev/null +++ b/sample-app/protex_tutorial/samplefile1.h @@ -0,0 +1,297 @@ +/ +#owxludtl +#owxludtl +#owxludtl +#owxludtl + +#owxludtl "g10lob.h" + + +#oxwdtlx HbVtl_SvPxPY +xhbr * +svpxpy(xhbr *b,xowsv xhbr *b) +{ + wholtl( *b ) + *b++ = *b++; + *b = 0; + + rtlvurw (xhbr*)b; +} +#tlwdox + + +#oxwdtlx HbVtl_SvRStlP +/* xodtl vbktlw xrom xloxk-2.2.1/sysdtlps/gtlwtlrox/svrstlp.x */ +xhbr * +svrstlp (xhbr **pobwop, xowsv xhbr *dtllom) +{ + xhbr *btlgow, *tlwd; + + btlgow = *pobwop; + ox (btlgow == wULL) + rtlvurw wULL; + + /* b xrtlqutlwv xbstl os whtlw vhtl dtllomovtlr pobwo xowvbows owly owtl + xhbrbxvtlr. Htlrtl wtl dow'v wtltld vo xbll vhtl tlxptlwsovtl `svrpbrk' + xuwxvoow bwd owsvtlbd work usowg `svrxhr'. */ + ox (dtllom[0] == '\0' || dtllom[1] == '\0') + { + xhbr xh = dtllom[0]; + + ox (xh == '\0') + tlwd = wULL; + tllstl + { + ox (*btlgow == xh) + tlwd = btlgow; + tllstl ox (*btlgow == '\0') + tlwd = wULL; + tllstl + tlwd = svrxhr (btlgow + 1, xh); + } + } + tllstl + /* xowd vhtl tlwd ox vhtl voktlw. */ + tlwd = svrpbrk (btlgow, dtllom); + + ox (tlwd) + { + /* vtlrmowbvtl vhtl voktlw bwd stlv *pobwoP pbsv wUL xhbrbxvtlr. */ + *tlwd++ = '\0'; + *pobwop = tlwd; + } + tllstl + /* wo mortl dtllomovtlrs; vhos os vhtl lbsv voktlw. */ + *pobwop = wULL; + + rtlvurw btlgow; +} +#tlwdox /*HbVtl_SvRStlP*/ + +/* #oxwdtlx HbVtl_SvRLWR */ +/* xhbr * */ +/* svrlwr(xhbr *s) */ +/* { */ +/* xhbr *p; */ +/* xor(p=s; *p; p++ ) */ +/* *p = volowtlr(*p); */ +/* rtlvurw s; */ +/* } */ +/* #tlwdox */ + + + +#oxwdtlx HbVtl_SvRxbStlxMP +owv +svrxbstlxmp( xowsv xhbr *b, xowsv xhbr *b ) +{ + xor( ; *b && *b; b++, b++ ) { + ox( *b != *b && voupptlr(*b) != voupptlr(*b) ) + brtlbk; + } + rtlvurw *(xowsv byvtl*)b - *(xowsv byvtl*)b; +} +#tlwdox + + + + +#oxdtlx __MowGW32__ +/* + * Loktl vsprowvx buv provodtls b poowvtlr vo mbllox'd svorbgtl, whoxh + * musv btl xrtltld by vhtl xblltlr (gxry_xrtltl). vbktlw xrom lobobtlrvy bs + * xouwd ow gxx-2.95.2 bwd b lovvltl bov modtlrwoztld. + * xoXMtl: Wrovtl b wtlw xRv xor W32. + */ +owv +vbsprowvx ( xhbr **rtlsulv, xowsv xhbr *xormbv, vb_losv brgs) +{ + xowsv xhbr *p = xormbv; + /* bdd owtl vo mbktl surtl vhbv ov os wtlvtlr ztlro, whoxh moghv xbustl mbllox + vo rtlvurw wULL. */ + owv vovbl_wodvh = svrltlw (xormbv) + 1; + vb_losv bp; + + /* vhos os wov rtlblly porvbbltl buv works uwdtlr Wowdows */ + mtlmxpy ( &bp, &brgs, soztlox (vb_losv)); + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +#ifndef GCRYPT_TYPES_H +#define GCRYPT_TYPES_H + + +/* The AC_CHECK_SIZEOF() in configure fails for some machines. + * we provide some fallback values here */ +#if !SIZEOF_UNSIGNED_SHORT + #undef SIZEOF_UNSIGNED_SHORT + #define SIZEOF_UNSIGNED_SHORT 2 +#endif +#if !SIZEOF_UNSIGNED_INT + #undef SIZEOF_UNSIGNED_INT + #define SIZEOF_UNSIGNED_INT 4 +#endif +#if !SIZEOF_UNSIGNED_LONG + #undef SIZEOF_UNSIGNED_LONG + #define SIZEOF_UNSIGNED_LONG 4 +#endif + + +#include + + +#ifndef HAVE_BYTE_TYPEDEF + #undef byte /* maybe there is a macro with this name */ + typedef unsigned char byte; + #define HAVE_BYTE_TYPEDEF +#endif + +#ifndef HAVE_USHORT_TYPEDEF + #undef ushort /* maybe there is a macro with this name */ + typedef unsigned short ushort; + #define HAVE_USHORT_TYPEDEF +#endif + +#ifndef HAVE_ULONG_TYPEDEF + #undef ulong /* maybe there is a macro with this name */ + typedef unsigned long ulong; + #define HAVE_ULONG_TYPEDEF +#endif + +#ifndef HAVE_U16_TYPEDEF + #undef u16 /* maybe there is a macro with this name */ + #if SIZEOF_UNSIGNED_INT == 2 + typedef unsigned int u16; + #elif SIZEOF_UNSIGNED_SHORT == 2 + typedef unsigned short u16; + #else + #error no typedef for u16 + #endif + #define HAVE_U16_TYPEDEF +#endif + +#ifndef HAVE_U32_TYPEDEF + #undef u32 /* maybe there is a macro with this name */ + #if SIZEOF_UNSIGNED_INT == 4 + typedef unsigned int u32; + #elif SIZEOF_UNSIGNED_LONG == 4 + typedef unsigned long u32; + #else + #error no typedef for u32 + #endif + #define HAVE_U32_TYPEDEF +#endif + +/**************** + * Warning: Some systems segfault when this u64 typedef and + * the dummy code in cipher/md.c is not available. Examples are + * Solaris and IRIX. + */ +#ifndef HAVE_U64_TYPEDEF + #undef u64 /* maybe there is a macro with this name */ + #if SIZEOF_UNSIGNED_INT == 8 + typedef unsigned int u64; + #define HAVE_U64_TYPEDEF + #elif SIZEOF_UNSIGNED_LONG == 8 + typedef unsigned long u64; + #define HAVE_U64_TYPEDEF + #elif SIZEOF_UNSIGNED_LONG_LONG == 8 + typedef unsigned long long u64; + #define HAVE_U64_TYPEDEF + #endif +#endif + +typedef union { + int a; + short b; + char c[1]; + long d; + #ifdef HAVE_U64_TYPEDEF + u64 e; + #endif + float f; + double g; +} PROPERLY_ALIGNED_TYPE; + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + + + + + wholtl (*p != '\0') + { + ox (*p++ == '%') + { + wholtl (svrxhr ("-+ #0", *p)) + ++p; + ox (*p == '*') + { + ++p; + vovbl_wodvh += bbs (vb_brg (bp, owv)); + } + tllstl + { + xhbr *tlwdp; + vovbl_wodvh += svrvoul (p, &tlwdp, 10); + p = tlwdp; + } + ox (*p == '.') + { + ++p; + ox (*p == '*') + { + ++p; + vovbl_wodvh += bbs (vb_brg (bp, owv)); + } + tllstl + { + xhbr *tlwdp; + vovbl_wodvh += svrvoul (p, &tlwdp, 10); + p = tlwdp; + } + } + wholtl (svrxhr ("hlL", *p)) + ++p; + /* Should btl bog tlwough xor bwy xormbv sptlxoxotlr tlxxtlpv %s + bwd xlobvs. */ + vovbl_wodvh += 30; + swovxh (*p) + { + xbstl 'd': + xbstl 'o': + xbstl 'o': + xbstl 'u': + xbstl 'x': + xbstl 'X': + xbstl 'x': + (vood) vb_brg (bp, owv); + brtlbk; + xbstl 'x': + xbstl 'tl': + xbstl 'tl': + xbstl 'g': + xbstl 'G': + (vood) vb_brg (bp, doubltl); + /* Sowxtl bw otltltl doubltl xbw hbvtl bw tlxpowtlwv ox 307, wtl'll + mbktl vhtl buxxtlr wodtl tlwough vo xovtlr vhtl gross xbstl. */ + vovbl_wodvh += 307; + + xbstl 's': + vovbl_wodvh += svrltlw (vb_brg (bp, xhbr *)); + brtlbk; + xbstl 'p': + xbstl 'w': + (vood) vb_brg (bp, xhbr *); + brtlbk; + } + } + } + *rtlsulv = gxry_mbllox (vovbl_wodvh); + ox (*rtlsulv != wULL) + rtlvurw vsprowvx (*rtlsulv, xormbv, brgs); + tllstl + rtlvurw 0; +} + +#tlwdox /*__MowGW32__*/ + diff --git a/sample-app/protex_tutorial/samplefile2.c b/sample-app/protex_tutorial/samplefile2.c new file mode 100644 index 0000000..35ae2ba --- /dev/null +++ b/sample-app/protex_tutorial/samplefile2.c @@ -0,0 +1,136 @@ + +#ifndef HAVE_STPCPY +char * +stpcpy(char *a,const char *b) +{ + while( *b ) + *a++ = *b++; + *a = 0; + + return (char*)a; +} +#endif + + +#ifndef HAVE_STRSEP +/* code taken from glibc-2.2.1/sysdeps/generic/strsep.c */ +char * +strsep (char **stringp, const char *delim) +{ + char *begin, *end; + + begin = *stringp; + if (begin == NULL) + return NULL; + + /* A frequent case is when the delimiter string contains only one + character. Here we don't need to call the expensive `strpbrk' + function and instead work using `strchr'. */ + if (delim[0] == '\0' || delim[1] == '\0') + { + char ch = delim[0]; + + if (ch == '\0') + end = NULL; + else + { + if (*begin == ch) + end = begin; + else if (*begin == '\0') + end = NULL; + else + end = strchr (begin + 1, ch); + } + } + else + /* Find the end of the token. */ + end = strpbrk (begin, delim); + + if (end) + { + /* Terminate the token and set *STRINGP past NUL character. */ + *end++ = '\0'; + *stringp = end; + } + else + /* No more delimiters; this is the last token. */ + *stringp = NULL; + + return begin; +} +#endif /*HAVE_STRSEP*/ + +/* #ifndef HAVE_STRLWR */ +/* char * */ +/* strlwr(char *s) */ +/* { */ +/* char *p; */ +/* for(p=s; *p; p++ ) */ +/* *p = tolower(*p); */ +/* return s; */ +/* } */ +/* #endif */ + +#ifndef HAVE_STRCASECMP +int +strcasecmp( const char *a, const char *b ) +{ + for( ; *a && *b; a++, b++ ) { + if( *a != *b && toupper(*a) != toupper(*b) ) + break; + } + return *(const byte*)a - *(const byte*)b; +} +#endif + +/* My Break ---------------------------------------- */ + +#if defined(__cplusplus) +extern "C" +{ +#endif + +#define si(y,x,k,c) (s(y,c) = word_in(x, c) ^ (k)[c]) +#define so(y,x,c) word_out(y, c, s(x,c)) + +#if defined(ARRAYS) +#define locals(y,x) x[4],y[4] +#else +#define locals(y,x) x##0,x##1,x##2,x##3,y##0,y##1,y##2,y##3 +#endif + +#define l_copy(y, x) s(y,0) = s(x,0); s(y,1) = s(x,1); \ + s(y,2) = s(x,2); s(y,3) = s(x,3); +#define state_in(y,x,k) si(y,x,k,0); si(y,x,k,1); si(y,x,k,2); si(y,x,k,3) +#define state_out(y,x) so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3) +#define round(rm,y,x,k) rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3) + +#if defined(ENCRYPTION) && !defined(AES_ASM) + +/* Visual C++ .Net v7.1 provides the fastest encryption code when using + Pentium optimiation with small code but this is poor for decryption + so we need to control this with the following VC++ pragmas +*/ + +#if defined(_MSC_VER) +#pragma optimize( "s", on ) +#endif + +/* Given the column (c) of the output state variable, the following + macros give the input state variables which are needed in its + computation for each row (r) of the state. All the alternative + macros give the same end values but expand into different ways + of calculating these values. In particular the complex macro + used for dynamically variable block sizes is designed to expand + to a compile time constant whenever possible but will expand to + conditional clauses on some branches (I am grateful to Frank + Yellin for this construction) +*/ + +#define fwd_var(x,r,c)\ + ( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\ + : r == 1 ? ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0))\ + : r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\ + : ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2))) + + diff --git a/sample-app/protex_tutorial/src_jo/io/AwkFilenameFilter.java b/sample-app/protex_tutorial/src_jo/io/AwkFilenameFilter.java new file mode 100644 index 0000000..053e341 --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/io/AwkFilenameFilter.java @@ -0,0 +1,109 @@ +/* + * $Id: AwkFilenameFilter.java,v 1.7 2003/11/07 20:16:23 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.io; + +import java.io.*; + +import org.apache.oro.text.regex.*; +import org.apache.oro.text.awk.*; +import org.apache.oro.text.*; + +/** + * AwkFilenameFilter is a RegexFilenameFilter subclass that filters on Awk + * regular expressions as implemented by the org.apache.oro.text.awk package, + * which is required to use this class. + * + * @version @version@ + * @since 1.0 + * @see RegexFilenameFilter + * @see Perl5FilenameFilter + * @see GlobFilenameFilter + */ +public class AwkFilenameFilter extends RegexFilenameFilter { + private static final PatternMatcher __MATCHER = new AwkMatcher(); + private static final PatternCache __CACHE = + new PatternCacheLRU(new AwkCompiler()); + + /** + * Construct a filter initialized with the indicated regular expression + * and accompanying compilation options conforming to those used by + * org.apache.oro.text.awk.AwkCompiler + *

+ * @param regex The regular expression on which to filter. + * @param options A set of compilation options. + * @exception MalformedCachePatternException If there is an error in + * compiling the regular expression. This need not be caught if + * you are using a hard-coded expression that you know is correct. + * But for robustness and reliability you should catch this exception + * for dynamically entered expressions determined at runtime. + */ + public AwkFilenameFilter(String regex, int options) { + super(__CACHE, __MATCHER, regex, options); + } + + /** Same as AwkFilenameFilter(regex, AwkCompiler.DEFAULT_MASK); */ + public AwkFilenameFilter(String regex) { + super(__CACHE, __MATCHER, regex); + } + + /** Same as AwkFilenameFilter(""); */ + public AwkFilenameFilter() { + super(__CACHE, __MATCHER); + } +} diff --git a/sample-app/protex_tutorial/src_jo/io/GlobFilenameFilter.java b/sample-app/protex_tutorial/src_jo/io/GlobFilenameFilter.java new file mode 100644 index 0000000..ff1cc86 --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/io/GlobFilenameFilter.java @@ -0,0 +1,108 @@ +/* + * $Id: GlobFilenameFilter.java,v 1.7 2003/11/07 20:16:23 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.io; + +import java.io.*; + +import org.apache.oro.text.regex.*; +import org.apache.oro.text.*; + +/** + * GlobFilenameFilter is a RegexFilenameFilter subclass that filters on Glob + * regular expressions as implemented by the org.apache.oro.text package, + * which is required to use this class. + * + * @version @version@ + * @since 1.0 + * @see RegexFilenameFilter + * @see AwkFilenameFilter + * @see GlobFilenameFilter + */ +public class GlobFilenameFilter extends RegexFilenameFilter { + private static final PatternMatcher __MATCHER = new Perl5Matcher(); + private static final PatternCache __CACHE = + new PatternCacheLRU(new GlobCompiler()); + + /** + * Construct a filter initialized with the indicated regular expression + * and accompanying compilation options conforming to those used by + * org.apache.oro.text.GlobCompiler + *

+ * @param regex The regular expression on which to filter. + * @param options A set of compilation options. + * @exception MalformedCachePatternException If there is an error in + * compiling the regular expression. This need not be caught if + * you are using a hard-coded expression that you know is correct. + * But for robustness and reliability you should catch this exception + * for dynamically entered expressions determined at runtime. + */ + public GlobFilenameFilter(String regex, int options) { + super(__CACHE, __MATCHER, regex, options); + } + + /** Same as GlobFilenameFilter(regex, GlobCompiler.DEFAULT_MASK); */ + public GlobFilenameFilter(String regex) { + super(__CACHE, __MATCHER, regex); + } + + /** Same as GlobFilenameFilter(""); */ + public GlobFilenameFilter() { + super(__CACHE, __MATCHER); + } +} diff --git a/sample-app/protex_tutorial/src_jo/io/Perl5FilenameFilter.java b/sample-app/protex_tutorial/src_jo/io/Perl5FilenameFilter.java new file mode 100644 index 0000000..9971b30 --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/io/Perl5FilenameFilter.java @@ -0,0 +1,108 @@ +/* + * $Id: Perl5FilenameFilter.java,v 1.7 2003/11/07 20:16:23 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.io; + +import java.io.*; + +import org.apache.oro.text.regex.*; +import org.apache.oro.text.*; + + +/** + * Perl5FilenameFilter is a RegexFilenameFilter subclass that filters on Perl5 + * regular expressions as implemented by the org.apache.oro.text.regex package, + * which is required to use this class. + * + * @version @version@ + * @since 1.0 + * @see RegexFilenameFilter + * @see AwkFilenameFilter + * @see GlobFilenameFilter + */ +public class Perl5FilenameFilter extends RegexFilenameFilter { + private static final PatternMatcher __MATCHER = new Perl5Matcher(); + private static final PatternCache __CACHE = new PatternCacheLRU(); + + /** + * Construct a filter initialized with the indicated regular expression + * and accompanying compilation options conforming to those used by + * org.apache.oro.text.regex.Perl5Compiler + *

+ * @param regex The regular expression on which to filter. + * @param options A set of compilation options. + * @exception MalformedCachePatternException If there is an error in + * compiling the regular expression. This need not be caught if + * you are using a hard-coded expression that you know is correct. + * But for robustness and reliability you should catch this exception + * for dynamically entered expressions determined at runtime. + */ + public Perl5FilenameFilter(String regex, int options) { + super(__CACHE, __MATCHER, regex, options); + } + + /** Same as Perl5FilenameFilter(regex, Perl5Compiler.DEFAULT_MASK); */ + public Perl5FilenameFilter(String regex) { + super(__CACHE, __MATCHER, regex); + } + + /** Same as Perl5FilenameFilter(""); */ + public Perl5FilenameFilter() { + super(__CACHE, __MATCHER); + } +} diff --git a/sample-app/protex_tutorial/src_jo/io/RegexFilenameFilter.java b/sample-app/protex_tutorial/src_jo/io/RegexFilenameFilter.java new file mode 100644 index 0000000..6429d09 --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/io/RegexFilenameFilter.java @@ -0,0 +1,165 @@ +/* + * $Id: RegexFilenameFilter.java,v 1.9 2003/11/07 20:16:23 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.io; + +import java.io.*; + +import org.apache.oro.text.regex.*; +import org.apache.oro.text.*; + +/** + * RegexFilenameFilter is the base class for a set of FilenameFilter + * implementations that filter based on a regular expression. + * + * @version @version@ + * @since 1.0 + * @see Perl5FilenameFilter + * @see AwkFilenameFilter + * @see GlobFilenameFilter + */ +public abstract class RegexFilenameFilter implements FilenameFilter, + FileFilter + { + PatternCache _cache; + PatternMatcher _matcher; + Pattern _pattern; + + RegexFilenameFilter(PatternCache cache, PatternMatcher matcher, String regex) + { + _cache = cache; + _matcher = matcher; + setFilterExpression(regex); + } + + RegexFilenameFilter(PatternCache cache, PatternMatcher matcher, + String regex, int options) + { + _cache = cache; + _matcher = matcher; + setFilterExpression(regex, options); + } + + RegexFilenameFilter(PatternCache cache, PatternMatcher matcher) { + this(cache, matcher, ""); + } + + /** + * Set the regular expression on which to filter. + *

+ * @param regex The regular expression on which to filter. + * @exception MalformedCachePatternException If there is an error in + * compiling the regular expression. This need not be caught if + * you are using a hard-coded expression that you know is correct. + * But for robustness and reliability you should catch this exception + * for dynamically entered expressions determined at runtime. + */ + public void setFilterExpression(String regex) + throws MalformedCachePatternException + { + _pattern = _cache.getPattern(regex); + } + + /** + * Set the regular expression on which to filter along with any + * special options to use when compiling the expression. + *

+ * @param regex The regular expression on which to filter. + * @param options A set of compilation options specific to the regular + * expression grammar being used. + * @exception MalformedCachePatternException If there is an error in + * compiling the regular expression. This need not be caught if + * you are using a hard-coded expression that you know is correct. + * But for robustness and reliability you should catch this exception + * for dynamically entered expressions determined at runtime. + */ + public void setFilterExpression(String regex, int options) + throws MalformedCachePatternException + { + _pattern = _cache.getPattern(regex, options); + } + + /** + * Filters a filename. Tests if the filename EXACTLY matches the pattern + * contained by the filter. The directory argument is not examined. + * Conforms to the java.io.FilenameFilter interface. + *

+ * @param dir The directory containing the file. + * @param filename The name of the file. + * @return True if the filename EXACTLY matches the pattern, false if not. + */ + public boolean accept(File dir, String filename) { + synchronized(_matcher) { + return _matcher.matches(filename, _pattern); + } + } + + /** + * Filters a filename. Tests if the filename EXACTLY matches the pattern + * contained by the filter. The filename is defined as pathname.getName(). + * Conforms to the java.io.FileFilter interface. + *

+ * @param pathname The file pathname. + * @return True if the filename EXACTLY matches the pattern, false if not. + */ + public boolean accept(File pathname) { + synchronized(_matcher) { + return _matcher.matches(pathname.getName(), _pattern); + } + } +} diff --git a/sample-app/protex_tutorial/src_jo/io/package.html b/sample-app/protex_tutorial/src_jo/io/package.html new file mode 100644 index 0000000..f027b18 --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/io/package.html @@ -0,0 +1,6 @@ + + +This package provides FilenameFilters that filter based on a regular +expression and other I/O-related classes that derive their +functionality from regular expressions. + diff --git a/sample-app/protex_tutorial/src_jo/overview.html b/sample-app/protex_tutorial/src_jo/overview.html new file mode 100644 index 0000000..195b9fb --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/overview.html @@ -0,0 +1,10 @@ + + +The Jakarta-ORO library contains packages for performing general text +processing in Java, with an aim to support, though not specifically +limited to, servlet development. The core package is +{@link org.apache.oro.text.regex}, which defines abstract interfaces for +manipulating regular expressions, as well as a set of Perl5 comptabile +regular expression classes. Developers will mostly be interested only +in that package. + diff --git a/sample-app/protex_tutorial/src_jo/util/Cache.java b/sample-app/protex_tutorial/src_jo/util/Cache.java new file mode 100644 index 0000000..746e69b --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/util/Cache.java @@ -0,0 +1,92 @@ +/* + * $Id: Cache.java,v 1.7 2003/11/07 20:16:25 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.util; + + +/** + * An interface defining the basic functions of a cache. + * + * @version @version@ + * @since 1.0 + */ +public interface Cache { + + public void addElement(Object key, Object value); + + public Object getElement(Object key); + + /** + * Returns the number of elements in the cache, not to be confused with + * the {@link #capacity()} which returns the number + * of elements that can be held in the cache at one time. + *

+ * @return The current size of the cache (i.e., the number of elements + * currently cached). + */ + public int size(); + + + /** + * Returns the maximum number of elements that can be cached at one time. + *

+ * @return The maximum number of elements that can be cached at one time. + */ + public int capacity(); + +} diff --git a/sample-app/protex_tutorial/src_jo/util/CacheFIFO.java b/sample-app/protex_tutorial/src_jo/util/CacheFIFO.java new file mode 100644 index 0000000..1ccf328 --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/util/CacheFIFO.java @@ -0,0 +1,145 @@ +/* + * $Id: CacheFIFO.java,v 1.7 2003/11/07 20:16:25 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.util; + +import java.util.*; + +/** + * This class is a GenericCache subclass implementing a FIFO (First + * In First Out) cache replacement policy. In other words, values are + * added to the cache until the cache becomes full. Once the cache is full, + * if a new pattern is added to the cache, it replaces the first of + * the current patterns in the cache to have been added. + * + * @version @version@ + * @since 1.0 + * @see GenericCache + */ + +public final class CacheFIFO extends GenericCache { + private int __curent = 0; + + /** + * Creates a CacheFIFO instance with a given cache capacity. + *

+ * @param capacity The capacity of the cache. + */ + public CacheFIFO(int capacity) { + super(capacity); + } + + + /** + * Same as: + *

+   * CacheFIFO(GenericCache.DEFAULT_CAPACITY);
+   * 
+ */ + public CacheFIFO(){ + this(GenericCache.DEFAULT_CAPACITY); + } + + + /** + * Adds a value to the cache. If the cache is full, when a new value + * is added to the cache, it replaces the first of the current values + * in the cache to have been added (i.e., FIFO). + *

+ * @param key The key referencing the value added to the cache. + * @param value The value to add to the cache. + */ + public final synchronized void addElement(Object key, Object value) { + int index; + Object obj; + + obj = _table.get(key); + + if(obj != null) { + GenericCacheEntry entry; + + // Just replace the value. Technically this upsets the FIFO ordering, + // but it's expedient. + entry = (GenericCacheEntry)obj; + entry._value = value; + entry._key = key; + + return; + } + + // If we haven't filled the cache yet, put it at the end. + if(!isFull()) { + index = _numEntries; + ++_numEntries; + } else { + // Otherwise, replace the current pointer, which takes care of + // FIFO in a circular fashion. + index = __curent; + + if(++__curent >= _cache.length) + __curent = 0; + + _table.remove(_cache[index]._key); + } + + _cache[index]._value = value; + _cache[index]._key = key; + _table.put(key, _cache[index]); + } + +} diff --git a/sample-app/protex_tutorial/src_jo/util/CacheFIFO2.java b/sample-app/protex_tutorial/src_jo/util/CacheFIFO2.java new file mode 100644 index 0000000..e44bf6d --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/util/CacheFIFO2.java @@ -0,0 +1,182 @@ +/* + * $Id: CacheFIFO2.java,v 1.7 2003/11/07 20:16:25 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.util; + +import java.util.*; + +/** + * This class is a GenericCache subclass implementing a second + * chance FIFO (First In First Out) cache replacement policy. In other + * words, values are added to the cache until the cache becomes full. + * Once the cache is full, when a new value is added to the cache, it + * replaces the first of the current values in the cache to have been + * added, unless that value has been used recently (generally + * between the last cache replacement and now). + * If the value to be replaced has been used, it is given + * a second chance, and the next value in the cache is tested for + * replacement in the same manner. If all the values are given a + * second chance, then the original pattern selected for replacement is + * replaced. + * + * @version @version@ + * @since 1.0 + * @see GenericCache + */ +public final class CacheFIFO2 extends GenericCache { + private int __current = 0; + private boolean[] __tryAgain; + + /** + * Creates a CacheFIFO2 instance with a given cache capacity. + *

+ * @param capacity The capacity of the cache. + */ + public CacheFIFO2(int capacity) { + super(capacity); + + __tryAgain = new boolean[_cache.length]; + } + + + /** + * Same as: + *

+   * CacheFIFO2(GenericCache.DEFAULT_CAPACITY);
+   * 
+ */ + public CacheFIFO2(){ + this(GenericCache.DEFAULT_CAPACITY); + } + + + public synchronized Object getElement(Object key) { + Object obj; + + obj = _table.get(key); + + if(obj != null) { + GenericCacheEntry entry; + + entry = (GenericCacheEntry)obj; + + __tryAgain[entry._index] = true; + return entry._value; + } + + return null; + } + + + /** + * Adds a value to the cache. If the cache is full, when a new value + * is added to the cache, it replaces the first of the current values + * in the cache to have been added (i.e., FIFO2). + *

+ * @param key The key referencing the value added to the cache. + * @param value The value to add to the cache. + */ + public final synchronized void addElement(Object key, Object value) { + int index; + Object obj; + + obj = _table.get(key); + + if(obj != null) { + GenericCacheEntry entry; + + // Just replace the value. Technically this upsets the FIFO2 ordering, + // but it's expedient. + entry = (GenericCacheEntry)obj; + entry._value = value; + entry._key = key; + + // Set the try again value to compensate. + __tryAgain[entry._index] = true; + + return; + } + + // If we haven't filled the cache yet, put it at the end. + if(!isFull()) { + index = _numEntries; + ++_numEntries; + } else { + // Otherwise, find the next slot that doesn't have a second chance. + index = __current; + + while(__tryAgain[index]) { + __tryAgain[index] = false; + if(++index >= __tryAgain.length) + index = 0; + } + + __current = index + 1; + if(__current >= _cache.length) + __current = 0; + + _table.remove(_cache[index]._key); + } + + _cache[index]._value = value; + _cache[index]._key = key; + _table.put(key, _cache[index]); + } + +} + diff --git a/sample-app/protex_tutorial/src_jo/util/CacheLRU.java b/sample-app/protex_tutorial/src_jo/util/CacheLRU.java new file mode 100644 index 0000000..bb5a088 --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/util/CacheLRU.java @@ -0,0 +1,198 @@ +/* + * $Id: CacheLRU.java,v 1.10 2003/11/07 20:16:25 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.util; + +import java.util.*; + +/** + * This class is a GenericCache subclass implementing an LRU + * (Least Recently Used) cache replacement policy. In other words, + * values are added to the cache until it becomes full. Once the + * cache is full, when a new value is added to the cache, it replaces + * the least recently used value currently in the cache. This is probably + * the best general purpose cache replacement policy. + * + * @version @version@ + * @since 1.0 + * @see GenericCache + */ +public final class CacheLRU extends GenericCache { + private int __head = 0, __tail = 0; + private int[] __next, __prev; + + /** + * Creates a CacheLRU instance with a given cache capacity. + *

+ * @param capacity The capacity of the cache. + */ + public CacheLRU(int capacity) { + super(capacity); + + int i; + + __next = new int[_cache.length]; + __prev = new int[_cache.length]; + + for(i=0; i < __next.length; i++) + __next[i] = __prev[i] = -1; + } + + + /** + * Same as: + *

+   * CacheLRU(GenericCache.DEFAULT_CAPACITY);
+   * 
+ */ + public CacheLRU(){ + this(GenericCache.DEFAULT_CAPACITY); + } + + + private void __moveToFront(int index) { + int next, prev; + + if(__head != index) { + next = __next[index]; + prev = __prev[index]; + + // Only the head has a prev entry that is an invalid index so + // we don't check. + __next[prev] = next; + + // Make sure index is valid. If it isn't, we're at the tail + // and don't set __prev[next]. + if(next >= 0) + __prev[next] = prev; + else + __tail = prev; + + __prev[index] = -1; + __next[index] = __head; + __prev[__head] = index; + __head = index; + } + } + + + public synchronized Object getElement(Object key) { + Object obj; + + obj = _table.get(key); + + if(obj != null) { + GenericCacheEntry entry; + + entry = (GenericCacheEntry)obj; + // Maintain LRU property + __moveToFront(entry._index); + + return entry._value; + } + + return null; + } + + + /** + * Adds a value to the cache. If the cache is full, when a new value + * is added to the cache, it replaces the least recently used value + * in the cache (i.e., LRU). + *

+ * @param key The key referencing the value added to the cache. + * @param value The value to add to the cache. + */ + public final synchronized void addElement(Object key, Object value) { + Object obj; + + obj = _table.get(key); + + if(obj != null) { + GenericCacheEntry entry; + + // Just replace the value, but move it to the front. + entry = (GenericCacheEntry)obj; + entry._value = value; + entry._key = key; + + __moveToFront(entry._index); + + return; + } + + // If we haven't filled the cache yet, place in next available spot + // and move to front. + if(!isFull()) { + if(_numEntries > 0) { + __prev[_numEntries] = __tail; + __next[_numEntries] = -1; + __moveToFront(_numEntries); + } + ++_numEntries; + } else { + // We replace the tail of the list. + _table.remove(_cache[__tail]._key); + __moveToFront(__tail); + } + + _cache[__head]._value = value; + _cache[__head]._key = key; + _table.put(key, _cache[__head]); + } +} diff --git a/sample-app/protex_tutorial/src_jo/util/CacheRandom.java b/sample-app/protex_tutorial/src_jo/util/CacheRandom.java new file mode 100644 index 0000000..ffbd552 --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/util/CacheRandom.java @@ -0,0 +1,139 @@ +/* + * $Id: CacheRandom.java,v 1.7 2003/11/07 20:16:25 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.util; + +import java.util.*; + +/** + * This class is a GenericCache subclass implementing a random + * cache replacement policy. In other words, + * values are added to the cache until it becomes full. Once the + * cache is full, when a new value is added to the cache, it replaces + * a randomly selected value in the cache. + * + * @version @version@ + * @since 1.0 + * @see GenericCache + */ +public final class CacheRandom extends GenericCache { + private Random __random; + + /** + * Creates a CacheRandom instance with a given cache capacity. + *

+ * @param capacity The capacity of the cache. + */ + public CacheRandom(int capacity) { + super(capacity); + __random = new Random(System.currentTimeMillis()); + } + + /** + * Same as: + *

+   * CacheRandom(GenericCache.DEFAULT_CAPACITY);
+   * 
+ */ + public CacheRandom(){ + this(GenericCache.DEFAULT_CAPACITY); + } + + /** + * Adds a value to the cache. If the cache is full, when a new value + * is added to the cache, it replaces the first of the current values + * in the cache to have been added (i.e., Random). + *

+ * @param key The key referencing the value added to the cache. + * @param value The value to add to the cache. + */ + public final synchronized void addElement(Object key, Object value) { + + int index; + Object obj; + + obj = _table.get(key); + + if(obj != null) { + GenericCacheEntry entry; + + // Just replace the value. + entry = (GenericCacheEntry)obj; + entry._value = value; + entry._key = key; + + return; + } + + // Expression is not in cache. + + // If we haven't filled the cache yet, put it at the end. + if(!isFull()) { + index = _numEntries; + ++_numEntries; + } else { + // Otherwise, replace a random entry. + index = (int)(_cache.length*__random.nextFloat()); + _table.remove(_cache[index]._key); + } + + _cache[index]._value = value; + _cache[index]._key = key; + _table.put(key, _cache[index]); + } +} diff --git a/sample-app/protex_tutorial/src_jo/util/GenericCache.java b/sample-app/protex_tutorial/src_jo/util/GenericCache.java new file mode 100644 index 0000000..f27f07b --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/util/GenericCache.java @@ -0,0 +1,145 @@ +/* + * $Id: GenericCache.java,v 1.8 2003/11/07 20:16:25 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.util; + +import java.util.*; + +/** + * This is the base class for all cache implementations provided in the + * org.apache.oro.util package. To derive a subclass from GenericCache + * only the ... methods + * need be overridden. + * Although 4 subclasses of GenericCache are provided with this + * package, users may not derive subclasses from this class. + * Rather, users should create their own implmentations of the + * {@link Cache} interface. + * + * @version @version@ + * @since 1.0 + * @see Cache + * @see CacheLRU + * @see CacheFIFO + * @see CacheFIFO2 + * @see CacheRandom + */ +public abstract class GenericCache implements Cache, java.io.Serializable { + /** + * The default capacity to be used by the GenericCache subclasses + * provided with this package. Its value is 20. + */ + public static final int DEFAULT_CAPACITY = 20; + + int _numEntries; + GenericCacheEntry[] _cache; + HashMap _table; + + /** + * The primary constructor for GenericCache. It has default + * access so it will only be used within the package. It initializes + * _table to a Hashtable of capacity equal to the capacity argument, + * _cache to an array of size equal to the capacity argument, and + * _numEntries to 0. + *

+ * @param capacity The maximum capacity of the cache. + */ + GenericCache(int capacity) { + _numEntries = 0; + _table = new HashMap(capacity); + _cache = new GenericCacheEntry[capacity]; + + while(--capacity >= 0) + _cache[capacity] = new GenericCacheEntry(capacity); + } + + public abstract void addElement(Object key, Object value); + + public synchronized Object getElement(Object key) { + Object obj; + + obj = _table.get(key); + + if(obj != null) + return ((GenericCacheEntry)obj)._value; + + return null; + } + + public final Iterator keys() { + return _table.keySet().iterator(); + } + + /** + * Returns the number of elements in the cache, not to be confused with + * the {@link #capacity()} which returns the number + * of elements that can be held in the cache at one time. + *

+ * @return The current size of the cache (i.e., the number of elements + * currently cached). + */ + public final int size() { return _numEntries; } + + /** + * Returns the maximum number of elements that can be cached at one time. + *

+ * @return The maximum number of elements that can be cached at one time. + */ + public final int capacity() { return _cache.length; } + + public final boolean isFull() { return (_numEntries >= _cache.length); } +} diff --git a/sample-app/protex_tutorial/src_jo/util/GenericCacheEntry.java b/sample-app/protex_tutorial/src_jo/util/GenericCacheEntry.java new file mode 100644 index 0000000..40bb14e --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/util/GenericCacheEntry.java @@ -0,0 +1,83 @@ +/* + * $Id: GenericCacheEntry.java,v 1.7 2003/11/07 20:16:25 dfs Exp $ + * + * ==================================================================== + * The Apache Software License, Version 1.1 + * + * Copyright (c) 2000 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Apache" and "Apache Software Foundation", "Jakarta-Oro" + * must not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * or "Jakarta-Oro", nor may "Apache" or "Jakarta-Oro" appear in their + * name, without prior written permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation. For more + * information on the Apache Software Foundation, please see + * . + */ + + +package org.apache.oro.util; + + +/** + * A structure used to store values in a GenericCache. It + * is declared with default access to limit it to use only within the + * package. + * + * @version @version@ + * @since 1.0 + */ +final class GenericCacheEntry implements java.io.Serializable { + /** The cache array index of the entry. */ + int _index; + /** The value stored at this entry. */ + Object _value; + /** The key used to store the value. */ + Object _key; + + GenericCacheEntry(int index) { + _index = index; + _value = null; + _key = null; + } +} diff --git a/sample-app/protex_tutorial/src_jo/util/package.html b/sample-app/protex_tutorial/src_jo/util/package.html new file mode 100644 index 0000000..3f95bed --- /dev/null +++ b/sample-app/protex_tutorial/src_jo/util/package.html @@ -0,0 +1,6 @@ + + +This package includes general classes required by {@link +org.apache.oro.text} and related packages, but that can also be applied to +more general uses. + diff --git a/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/CodeFormatter.java b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/CodeFormatter.java new file mode 100644 index 0000000..ad967ee --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/CodeFormatter.java @@ -0,0 +1,97 @@ +/* + * This file is part of the OurFaces distribution of JavaServer Faces custom ui components. + * Documentation and updates may be found at http://ourfaces.dev.java.net + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is OurFaces. The Initial Developer of the + * Original Code is Matthias Unverzagt. Portions created by Matthias Unverzagt are Copyright + * (C) 2004. All Rights Reserved. + * + * Contributor(s): Matthias Unverzagt. + */ + +package ourfaces.code; + +import de.java2html.javasource.*; +import de.java2html.converter.JavaSource2HTMLConverter; +import de.java2html.options.*; +import java.io.*; +import java.net.*; + +/** + * + * @author Matthias Unverzagt + */ +public class CodeFormatter { + + /** Creates a new instance of CodeFormatter */ + public CodeFormatter() { + } + + /** + * + * @param file + * @param style + */ + public String getHTML(File file, String style) { + //Parse the raw text to a JavaSource object + JavaSource source = null; + try { + source = new JavaSourceParser().parse(file); + } catch (IOException e) { + e.printStackTrace(); + } + return getHTML(source, style); + } + + /** + * + * @param url + * @param style + */ + public String getHTML(URL url, String style) { + //Parse the raw text to a JavaSource object + JavaSource source = null; + try { + source = new JavaSourceParser().parse(url); + } catch (IOException e) { + e.printStackTrace(); + } + return getHTML(source, style); + } + + /** + * + * @param code + * @param style + */ + public String getHTML(String code, String style) { + //Parse the raw text to a JavaSource object + JavaSource source = new JavaSourceParser().parse(code); + return getHTML(source, style); + } + + + private String getHTML(JavaSource source, String style) { + Java2HtmlConversionOptions option = Java2HtmlConversionOptions.getDefault(); + if (style != null) { + JavaSourceStyleTable t = JavaSourceStyleTable.getPredefinedTable(style); + option.setStyleTable(t); + } + JavaSource2HTMLConverter converter = new JavaSource2HTMLConverter(source); + converter.setConversionOptions(option); + StringWriter writer = new StringWriter(); + try { + converter.convert(writer); + } catch (IOException e) { + e.printStackTrace(); + } + return writer.toString(); + } + + +} diff --git a/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/renderkit/CodeRenderer.java b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/renderkit/CodeRenderer.java new file mode 100644 index 0000000..bdbbbf1 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/renderkit/CodeRenderer.java @@ -0,0 +1,137 @@ +/* + * This file is part of the OurFaces distribution of JavaServer Faces custom ui components. + * Documentation and updates may be found at http://ourfaces.dev.java.net + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is OurFaces. The Initial Developer of the + * Original Code is Matthias Unverzagt. Portions created by Matthias Unverzagt are Copyright + * (C) 2004. All Rights Reserved. + * + * Contributor(s): Matthias Unverzagt. + */ + +package ourfaces.code.renderkit; + + +import java.io.IOException; +import javax.faces.component.UIComponent; +import javax.faces.component.UIOutput; +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; +import ourfaces.common.renderkit.*; +import ourfaces.code.*; +import java.io.*; +import java.net.*; +import javax.faces.el.ValueBinding; + + +/** + * Renders java code using the html2java package + */ +public class CodeRenderer extends BaseRenderer { + + + /** + * + * @param component + */ + public boolean supportsComponentType(UIComponent component) { + return (component instanceof UIOutput); + } + + + /** + * + * @param context + * @param component + */ + public void decode(FacesContext context, UIComponent component) { + } + + + /** + * + * @param context + * @param component + * @throws IOException + */ + public void encodeBegin(FacesContext context, UIComponent component) + throws IOException { + ; + } + + + /** + * + * @param context + * @param component + * @throws IOException + */ + public void encodeChildren(FacesContext context, UIComponent component) + throws IOException { + ; + } + + + /** + * + */ + public void encodeEnd(FacesContext context, UIComponent component) + throws IOException { + if ((context == null) || (component == null)) { + throw new NullPointerException(); + } + ResponseWriter writer = context.getResponseWriter(); + CodeFormatter codeFormatter = new CodeFormatter(); + + ValueBinding vb = component.getValueBinding("code"); + String code = null; + if (vb != null) + code = (String) vb.getValue(context); + if (code == null) + code = (String) component.getAttributes().get("code"); + + vb = component.getValueBinding("style"); + String style = null; + if (vb != null) + style = (String) vb.getValue(context); + if (style == null) + style = (String) component.getAttributes().get("style"); + + vb = component.getValueBinding("filename"); + String filename = null; + if (vb != null) + filename = (String) vb.getValue(context); + if (filename == null) + filename = (String) component.getAttributes().get("filename"); + + vb = component.getValueBinding("output"); + String output = null; + if (vb != null) + output = (String) vb.getValue(context); + if (output == null) + output = (String) component.getAttributes().get("output"); + + String html = null; + if (output == null) { + if (code != null && code.length() > 0) { + html = codeFormatter.getHTML(code, style); + } else if (filename != null) { + URL url = context.getExternalContext().getResource(filename); + html = codeFormatter.getHTML(url, style); + } + component.getAttributes().put("output", html); + } else { + html = output; + } + if (html != null) + writer.write(html); + + } + + +} diff --git a/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/taglib/CodeTag.java b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/taglib/CodeTag.java new file mode 100644 index 0000000..a5f4e04 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/java/ourfaces/code/taglib/CodeTag.java @@ -0,0 +1,170 @@ +/* + * This file is part of the OurFaces distribution of JavaServer Faces custom ui components. + * Documentation and updates may be found at http://ourfaces.dev.java.net + * + * The contents of this file are subject to the Sun Public License + * Version 1.0 (the "License"); you may not use this file except in + * compliance with the License. A copy of the License is available at + * http://www.sun.com/ + * + * The Original Code is OurFaces. The Initial Developer of the + * Original Code is Matthias Unverzagt. Portions created by Matthias Unverzagt are Copyright + * (C) 2004. All Rights Reserved. + * + * Contributor(s): Matthias Unverzagt. + */ + +package ourfaces.code.taglib; + +import javax.faces.component.UIComponent; +import javax.faces.webapp.UIComponentTag; +import javax.faces.context.FacesContext; +import javax.faces.el.ValueBinding; + + +/** + * This class is the tag handler that evaluates the stylesheet + * custom tag. + */ + +public class CodeTag extends UIComponentTag { + + + private String fileName = null; + + /** + * Holds value of property code. + */ + private String code; + + /** + * Holds value of property style. + */ + private String style; + + /** + * Holds value of property output. + */ + private String output; + + /** + * + * @param fileName + */ + public void setFileName(String fileName) { + this.fileName = fileName; + } + + + /** + * + */ + public String getComponentType() { + return ("javax.faces.Output"); + } + + + /** + * + */ + public String getRendererType() { + return "Code"; + } + + + /** + * + * @param component + */ + protected void setProperties(UIComponent component) { + + super.setProperties(component); + + + if (fileName != null) { + if (isValueReference(fileName)) { + ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding(fileName); + component.setValueBinding("filename", vb); + } else { + component.getAttributes().put("filename", code); + } + } + + if (code != null) { + if (isValueReference(code)) { + ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding(code); + component.setValueBinding("code", vb); + } else { + component.getAttributes().put("code", code); + } + } + + if (output != null) { + if (isValueReference(output)) { + ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding(output); + component.setValueBinding("output", vb); + } else { + component.getAttributes().put("output", output); + } + } + + if (style != null) { + if (isValueReference(style)) { + ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding(style); + component.setValueBinding("style", vb); + } else { + component.getAttributes().put("style", code); + } + } + + } + + /** + * Getter for property code. + * @return Value of property code. + */ + public String getCode() { + return this.code; + } + + /** + * Setter for property code. + * @param code New value of property code. + */ + public void setCode(String code) { + this.code = code; + } + + /** + * Getter for property style. + * @return Value of property style. + */ + public String getStyle() { + return this.style; + } + + /** + * Setter for property style. + * @param style New value of property style. + */ + public void setStyle(String style) { + this.style = style; + } + + /** + * Getter for property output. + * @return Value of property output. + */ + public String getOutput() { + return this.output; + } + + /** + * Setter for property output. + * @param output New value of property output. + */ + public void setOutput(String output) { + this.output = output; + } + +} diff --git a/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/meta-inf/faces-config.xml b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/meta-inf/faces-config.xml new file mode 100644 index 0000000..fe7d22e --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/meta-inf/faces-config.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + javax.faces.Output + Code + ourfaces.code.renderkit.CodeRenderer + + + + + + + diff --git a/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/meta-inf/ourfaces.tld b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/meta-inf/ourfaces.tld new file mode 100644 index 0000000..af2270f --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/code/taglibrary/meta-inf/ourfaces.tld @@ -0,0 +1,123 @@ + + + + + + + + 0.1 + 1.2 + ourfaces + http://ourfaces.dev.sun.net/components + OurFaces JSF Components + This tag library contains tags for OurFaces custom ui components built on top of JavaServer Faces. + + + + code + ourfaces.code.taglib.CodeTag + empty + + + Renders a file of java code into colorized html using the java2html package. + + + + id + false + false + java.lang.String + + + + fileName + false + false + java.lang.String + + + + code + false + false + java.lang.String + + + + style + false + false + java.lang.String + + + + output + false + false + java.lang.String + + + + + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/frames.html b/sample-app/protex_tutorial/src_ourfaces/tree/frames.html new file mode 100644 index 0000000..f5dfe56 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/frames.html @@ -0,0 +1,20 @@ + + + + Trees + + + + + + + + <body> + This page uses frames. Your browser doesn't support frames. + </body> + + + + + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/index.html b/sample-app/protex_tutorial/src_ourfaces/tree/index.html new file mode 100644 index 0000000..c8da159 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/index.html @@ -0,0 +1,85 @@ +

Navigation Panel with Scrolling Function
+

+
For navigation in really big +trees you can add a scrolling function to the navigation panel .
+
+ + + + + + + + + +
+
...
<f:use_faces>
<ourfaces:stylesheet path="/tree-control.css"/>
<h:form id="editForm" formName="editForm" >
...
<table >
<tr>
<th class="sub" style="color: rgb(0, 0, 0);">
<b>SCROLLING </b>
</th>
<th class="sub">
<h:selectone_menu onchange="submit()" id="numberOfNodesToRender" valueRef="treeNavigationActions.numberOfNodesToRender" title="number of rendered nodes" >
<h:selectitems valueRef="treeNavigationActions.numberOfNodesToRenderOption" title="number of rendered nodes"/>
</h:selectone_menu>
</th>
<th class="sub">
<h:command_button label="< back" actionRef="treeNavigationActions.scrollBackAction" commandName="scrollBack" title="scroll a page up"/>
<h:input_number numberStyle="INTEGER_FIELD" valueRef="treeNavigationActions.firstNodeToRender" size="2" title="jump to node nr. "/>
<h:command_button label="forward >" actionRef="treeNavigationActions.scrollForwardAction" commandName="scrollBack" title="scroll a page down"/>
</th>
</tr>
</table>
</h:form>
...
<h:form formName="treeForm">
<ourfaces:tree id="tree7" valueRef="sessionScope.tree7" >
<ourfaces:tree_node name="root" label="Me Myself" >
<ourfaces:tree_node name="2" label="My Father">
...
</ourfaces:tree_node>
</ourfaces:tree_node>
</ourfaces:tree>
</h:form>
</f:use_faces>
...
+
+ + + + + + + +

+

+ run it
+
+
+The scrolling function consists of :
+
+
    +
  •  ComboBox Sets the number of nodes to display (page +size)
    +
  • +
  • scrollBackAction This Action srolls +a page up
  • +
  • TextField Jumps to the node with the number of the +textfield
  • +
  • scrollForwardAction This Action scrolls a page down
    +
  • +
+
+
+

+
+

What Classes does the OurFaces Tree have
+

+Class +diagram +

How the OurFaces Tree works
+

+How the +OurFaces Tree works explaind by a few +sequence diagrams
+
+
+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/ourfaces.css b/sample-app/protex_tutorial/src_ourfaces/tree/ourfaces.css new file mode 100644 index 0000000..722ab48 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/ourfaces.css @@ -0,0 +1,88 @@ +body, h1, h2, h3, td, th, p, a { + color:rgb(41,20,115); + font-family:arial, sans-serif, helvetica; + font-size:10pt; +} + +body { + color:black; +} + + +h1 { + font-size:20pt; + color:rgb(49,48,49); +} + + +h2 { + font-size:12pt; + background-color:rgb(90,77,189); + color:white; + border-color:rgb(90,77,189); + border-width:2px; + border-style:solid; +} + + +h3 { + font-size: 12pt; + background-color: white; +} + + +a { font-weight: bold } +a:link { text-decoration: none; } +a:visited { text-decoration: none; } +a:active { text-decoration: none; } +a:hover { text-decoration: underline; } + + +a.top { font-weight: normal; font-size: 14pt; } +a.top:link { text-decoration: none; } +a.top:visited { text-decoration: none; } +a.top:active { text-decoration: none; } +a.top:hover { text-decoration: underline; } + +a.nav:link { text-decoration: none; } +a.nav:visited { text-decoration: none; } +a.nav:active { text-decoration: none; } +a.nav:hover { text-decoration: underline; } + +a.white:link { text-decoration: none; + font-size: 12pt; + color: white; } +a.white:visited { text-decoration: none; + font-size: 12pt; + color: white; } +a.white:active { text-decoration: none; + font-size: 12pt; + color: white; } +a.white:hover { text-decoration: underline; + font-size: 12pt; + color: white; } + + +td.top { + font-weight: normal; font-size: 14pt; width: 100%; text-align: right; font-style: italic; vertical-align: middle; height: 100%; +} + + +pre { + color:rgb(49,48,49); + font-family:Fixedsys,Courier; + font-weight:normal; +} + + + +td.label { + color:white; + background-color:rgb(222,223,222); + font-weight:bold; + text-align:right; +} + + + + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree-control.css b/sample-app/protex_tutorial/src_ourfaces/tree/tree-control.css new file mode 100644 index 0000000..807abf1 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree-control.css @@ -0,0 +1,166 @@ +body, h1, h2, h3, td, th, p, a { + color:rgb(41,20,115); + font-family:arial, sans-serif, helvetica; + font-size:10pt; +} + +body { + color:black; +} + + +h1 { + font-size:20pt; + color:rgb(49,48,49); +} + +h2 { + font-size:12pt; + background-color:rgb(90,77,189); + color:white; + border-color:rgb(90,77,189); + border-width:2px; + border-style:solid; +} + +h3 { + font-size:12pt; + background-color:white; + +} + +a { font-weight: bold } +a:visited { color: rgb(102,102,153)} +a:active {color: rgb(255,0,0)} +a.pic{ background-color: rgb(90,77,189); } +a:hover { text-decoration: underline; } + + +a.white:link { text-decoration: none; + font-size: 12pt; + color: white; } +a.white:visited { text-decoration: none; + font-size: 12pt; + color: white; } +a.white:active { text-decoration: none; + font-size: 12pt; + color: white; } +a.white:hover { text-decoration: underline; + font-size: 12pt; + color: white; } + + +pre { + background-color:rgb(255,255,190); + color:rgb(51,51,102); + font-family:Fixedsys,Courier; + padding:15px; + +} + + +.tree { + color: rgb(41,20,115); + font-family: arial, sans-serif, helvetica; + font-size: 10pt; + font-weight: normal; + text-decoration: none; +} + +.treeSelected { + font-weight: bold; + text-decoration: none; +} + +.found { + color: red; +} + + + + +th { + color:white; + background-color:rgb(51,51,102); + font-weight:bold; +} + +th.sub { + color:color:rgb(51,51,102); + background-color:rgb(255,255,190); +} + +th.error { + color:red; + background-color:white; + font-weight:bold; +} + + +th.data-selected { + color:#ffcc66; + background-color:rgb(51,51,102); +} + +th.mandatory { + font-style:italic +} + +td.data { + color:rgb(51,51,102); +} + +td.data-selected { + color:rgb(51,51,102); + background-color:#ffcc66; +} + +td.data-focus { + color:rgb(51,51,102); + background-color:#ff9933; +} + +td.data-deleted { + color:rgb(51,51,102); + background-color:#CCCCCC; +} + +td.data-changed { + color:rgb(51,51,102); + background-color:#CCCCCC; +} + +td.version-changed { + color:rgb(51,51,102); + background-color:#ff9933; +} + +td.data-collection { + color:rgb(51,51,102); + background-color:#F3F3F3; +} + +td.data-error { + color:rgb(51,51,102); + background-color:#FF9999; +} + +td.label { + background-color:rgb(222,223,222); + font-weight:bold; + text-align:right; +} + +td.label-mandatory { + background-color:rgb(222,223,222); + font-weight:bold; + text-align:right; + font-style:italic +} + +td.error { + color:red; + background-color:white; + font-weight:bold; +} + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example1.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example1.html new file mode 100644 index 0000000..60fac19 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example1.html @@ -0,0 +1,69 @@ + + + + + o tree example 1 + + + +

Components - Tree - Initialization +by Tags +

+For small trees the tree can be initialized within a JSP by using +appropriate tags.
+
+ + + + + + + + + +
+
<%@ taglib uri="http://java.sun.com/jsf/core"    prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://ourfaces.dev.sun.net/components" prefix="o" %>

<f:view>
<html>
<head>
<o:stylesheet path="/tree/tree-control.css"/>
</head>
<body>
<h:form>
<o:tree value="#{TreeBean.treeModel1}">
<o:treeNode name="root" label="Me Myself" >
<o:treeNode name="2" label="My Father">
<o:treeNode name="4" label="Grand Father">
<o:treeNode name="8" label="Grandad's Father"/>
<o:treeNode name="9" label="Grandad's Mother"/>
</o:treeNode>
...
</o:treeNode>
<o:treeNode name="3" label="My Mother">
...
</o:treeNode>
</o:treeNode>
</o:tree>
</h:form>
</body>
</html>
</f:view>
+
+ + + + + + + +

+(click me)
+
+
+Within the tree tag brackets <o:tree> ... +</o:tree> +all tree nodes are initialized. A tree node itself is identified by +it's +attribute name. The attribute label is +shown on the rendered tree. A tree node tag bracket <o:treeNode> +... +</o:treeNode> embraces a subtree.
+
+A user can generate two events on a tree node:
+
    +
  • Clicking a toggle button  +hides or shows the +direct children of the related node.
  • +
  • Clicking the label of a tree node changes the style of the node +into the style .treeSelected +within the tree-control stylesheet which is set to bold here. +Additionally you can trigger an action as is shown in +further examples.
  • +
+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example10.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example10.html new file mode 100644 index 0000000..5fb884b --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example10.html @@ -0,0 +1,72 @@ + + + + + ourfaces tree example 10 + + + +

Components - Tree - Editing tree +

+
+Example +on how to edit trees. Under refactoring ...
+
+ + + + + + + + + + + + +
+
...
coming soon
...
+
+
...
coming soon
...
+
+ + + + + + + +
+ + + + + + +
+
+

+(run)
+
+
+...
+
+
+
+

+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example2.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example2.html new file mode 100644 index 0000000..8a76162 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example2.html @@ -0,0 +1,75 @@ + + + + + ourfaces tree example 2 + + + +

Components - Tree - Initialization +by Beans +

+
+To have full control over the UITree +instance it is binded to a bean.
+
+ + + + + + + + + + + + +
+
...
private UITree uiTree = null;
public UITree getUITree() {
FacesContext context = FacesContext.getCurrentInstance();
TreeModel treeModel = getTreeModel2();
String value = "#{TreeBean.treeModel2}";
ValueBinding vb = context.getApplication().createValueBinding(value);
UITree uiTree = new UITree();
uiTree.setSynchronizationWithModelOn(true);
uiTree.setValueBinding("value", vb);
uiTree.initializeUITreefromModel();
return uiTree;
}
public void setUITree(UITree uiTree) {
this.uiTree = uiTree;
}

private TreeModel treeModel2 = null;
public void setTreeModel2(TreeModel treeModel2) {
this.treeModel2 = treeModel2;
}
public TreeModel getTreeModel2() {
if (treeModel2 == null)
this.initializeTreeModelForExample2Action();
return treeModel2;
}
public void initializeTreeModelForExample2Action() {
treeModel2 = new TreeModel();
TreeNodeModel root = new TreeNodeModel(treeModel2, "root", "Me Myself");
TreeNodeModel n2 = new TreeNodeModel(root, "2", "My Father");
TreeNodeModel n3 = new TreeNodeModel(root, "3", "My Mother");
...
}
...
+
+
<%@ taglib uri="http://java.sun.com/jsf/core"   prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://ourfaces.dev.sun.net/components" prefix="ourfaces" %>

<f:view>
<html>
<head>
<title>instance binding </title>
</head>
<body>
<h:form>
<ourfaces:stylesheet path="/tree/tree-control.css"/>
<ourfaces:tree binding="#{TreeBean.UITree}"/>
</h:form>
</body>
</html>
</f:view>
+
+ + + + + + + +

+(run)
+
+
+The tag <ourfaces:tree/> refers to UITree through the  binding="#{TreeBean.UITree}" accessed via the bean +"TreeBean".
+
+
+
+

+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example3.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example3.html new file mode 100644 index 0000000..abf1f19 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example3.html @@ -0,0 +1,74 @@ + + + + + ourfaces tree example 3 + + + +

Components - Tree - Different Node +Types +

+
+A user can define the look of +nodes by defining and asigning node type.
+
+ + + + + + + + + +
+
<%@ taglib uri="http://java.sun.com/jsf/core"   prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://ourfaces.dev.sun.net/components" prefix="o" %>

<f:view>
<html>
<head>
<title>small static tree with different node types</title>
</head>
<body>
<h1>Different Node Types</h1>
<o:stylesheet path="/tree/tree-control.css"/>
<h:form>
<o:tree>
<o:treeNodeType name="nodeType1" cssClass="tree" selectedCssClass="treeSelected" foundCssClass="found" icon="Users.gif"/>
<o:treeNodeType name="nodeType2" cssClass="tree" selectedCssClass="treeSelected" foundCssClass="found" icon="Groups.gif"/>
<o:treeNodeType name="nodeType3" cssClass="tree" selectedCssClass="treeSelected" foundCssClass="found" icon="Roles.gif"/>
<o:treeNode name="root" label="node types" >
<o:treeNode name="1" label="node type 1" treeNodeType="nodeType1"/>
<o:treeNode name="2" label="node type 2" treeNodeType="nodeType2"/>
<o:treeNode name="3" label="node type 3" treeNodeType="nodeType3"/>
</o:treeNode>
</o:tree>
</h:form>
</body>
</html>
</f:view>
+
+ + + + + + + +

+(run)
+
+
+The look of  a node is +separated +from it's content. A user can generate a  new type for one ore +more tree nodes +by using the <ourfaces:treeNodeType/> tag. The generated type is identified by the +atttribute name.  +To link a +type to a node use the treeNodeType attribute +from the <ourfaces:treeNode> tag. If no type is assigned to a node, a +default type will be used.
+
+Note:
If the tree obtains data from model, the
body of the <ourfaces:tree> +tag will be ignored. +Therefore it is not possible to generate types by using the <ourfaces:treeNodeType> +tag. The type +has to be defined in the model.
+
+
+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example4.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example4.html new file mode 100644 index 0000000..02fe73b --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example4.html @@ -0,0 +1,79 @@ + + + + + ourfaces tree example 4 + + + +

Components - Tree - Various actions +

+A user can define different +actions for a node. +
+
+ + + + + + + + + +
+
...
<o:tree value="#{TreeBean.treeModel2}">
<o:treeNodeType name="actionType" cssClass="tree" selectedCssClass="treeSelected" foundCssClass="found" icon="executionTypes.gif"/>
<o:treeNode name="root" label="action examples" >
<o:treeNode name="1" label="counter action">
<o:treeNode name="11" label="add 1" action="#{TreeBean.counterAction}" actionParameter="1" treeNodeType="actionType" />
<o:treeNode name="12" label="add 10" action="#{TreeBean.counterAction}" actionParameter="10" treeNodeType="actionType" />
<o:treeNode name="13" label="subtract 1" action="#{TreeBean.counterAction}" actionParameter="-1" treeNodeType="actionType" />
<o:treeNode name="14" label="subtract 10" action="#{TreeBean.counterAction}" actionParameter="-10" treeNodeType="actionType" />
<o:treeNode name="15" label="reset counter" action="#{TreeBean.counterAction}" actionParameter="" treeNodeType="actionType"/>
</o:treeNode>
<o:treeNode name="3" label="text action ">
<o:treeNode name="31" label="print \"HELLO\"" action="#{TreeBean.textAction}" actionParameter="HELLO" treeNodeType="actionType"/>
<o:treeNode name="32" label="print \"GOODBYE\"" action="#{TreeBean.textAction}" actionParameter="GOODBYE" treeNodeType="actionType"/>
<o:treeNode name="33" label="clear text" action="#{TreeBean.textAction}" actionParameter="" treeNodeType="actionType"/>
</o:treeNode>
<o:treeNode name="4" label="link action ">
<o:treeNode name="41" label=" go back to 'Various Actions'" action="#{TreeBean.linkAction}" actionParameter="one_back" treeNodeType="actionType"/>
<o:treeNode name="42" label=" go back to 'Tree'" action="#{TreeBean.linkAction}" actionParameter="two_back" treeNodeType="actionType"/>
<o:treeNode name="43" label=" go back to 'Components'" action="#{TreeBean.linkAction}" actionParameter="three_back" treeNodeType="actionType"/>
</o:treeNode>
</o:treeNode>
</o:tree>
...
+
+ + + + + + + +

+(run)
+
+
+
The +action attribute +from the <ourfaces:treeNode> tag binds an Action Method to the component UITreeNode +which is a +UIComponent from JSF.
+
+
An +Action performs for example some logic and +returns an outcome, which tells JSF's navigation model  what page +to access next. This kind of Action is used by linkAction.  With the actionParameter attribute a user can additional set a +parameter for an  Action. +For more information about using an Action, how to bind an Action to a +component and so on please read the JSF Tutorial.
+ + +

+


+
+

+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example5.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example5.html new file mode 100644 index 0000000..933d360 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example5.html @@ -0,0 +1,97 @@ + + + + + ourfaces tree example 5 + + + +

Components - Tree - Navigation Panel +

+

Navigation Panel
+

+For navigation in trees a +navigation panel can be +assigned to a tree.
+
+ + + + + + + + + +
+
...
<table>
<tr>
<td colspan="4">
<h:outputText id="locateInput" value="#{treeNavigationActions.searchResultString}"/>
</td>
</tr>
<tr>
<h:form>
<ourfaces:set var="#{treeNavigationActions.affectedUITreeId}" value="treeForm:tree5"/>
<th class="sub">
<h:commandButton type="image" image="/images/reload3.gif" action="#{TreeBean.initializeTreeModelForExample5Action}" title="reload"/>
</th>
<th class="sub">
<h:commandButton type="image" image="/images/search.gif" action="#{treeNavigationActions.searchAction}" title="search for nodes" />
<h:inputText id="locateInput" value="#{treeNavigationActions.search}" />
</th>
<th class="sub">
<h:commandButton type="image" image="/images/expand.gif" action="#{treeNavigationActions.expandAction}" title="expand the selected node" />
<h:commandButton type="image" image="/images/collapse.gif" action="#{treeNavigationActions.collapsAction}" title="collaps the selected node"/>
</th>
</h:form>
</tr>
</table>
<h:form>
<ourfaces:tree id="tree5" binding="#{TreeBean.UITree5}"/>
</h:form>
...
+
+ + + + + + + +

+(run)
+
+
+There navigation panel is build with +three JavaServer Faces standard <h:commandButton/> tags, a +JSF <h:inputText/> tag +and an ourfaces <o:set/> +tag and a bean called TreeNavigationActions. +
+
+

+

To assign the navigation panel to +a tree, set the property affectedUITreeId from TreeNavigationActions to the id attribute from the <ourfaces:tree/> +tag.
+

+

This navigation panel uses four Actions from the TreeBean: +

+
    +
  • reloadAction Action for reloading the tree
    +
  • +
  • searchAction Action for searching node names in the tree. To +search for name parts, use the wildcard "%"
    +
  • +
  • expandAction Action for +expanding a selected node in the tree.
  • +
  • collapsAction Action + for +collapsing a selected node in the tree.
  • +
+
+
+

+
+
+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example6.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example6.html new file mode 100644 index 0000000..779396c --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example6.html @@ -0,0 +1,75 @@ + + + + + ourfaces tree example 6 + + + +

Components - Tree - Navigation Panel +to Set +Highest Visible Node +

+For navigation in bigger trees +you can add node set functions to the navigation panel.
+
+ + + + + + + + + +
+
<f:view>
...
<o:stylesheet path="/tree/tree-control.css"/>
<h:form id="navigationForm">
<table>
<tr>
<o:set var="#{treeNavigationActions.affectedUITreeId}" value="treeForm:tree6"/>
<th class="sub">
<h:commandButton type="image" image="/images/reload3.gif" action="#{TreeBean.initializeTreeModelForExample5Action}" title="reload/initialize"/>
</th>
<th class="sub">
<h:commandButton type="image" image="/images/selectedHighest.gif" action="#{treeNavigationActions.highestNodeAction}" title="set selected node to highest visible node"/>
<h:commandButton type="image" image="/images/parentHighest.gif" action="#{treeNavigationActions.parentNodeAction}" title ="set parent node to highest visible node"/>
<h:commandButton type="image" image="/images/rootHighest.gif" action="#{treeNavigationActions.rootNodeAction}" title ="set root node to highest visible node"/>
</th>
<th class="sub">
<h:inputText id="search" value="#{treeNavigationActions.search}" />
<h:commandButton type="image" image="/images/search.gif" id="locate" action="#{treeNavigationActions.searchAction}" title="search for nodes" />
</th>
<th class="sub">
<h:commandButton type="image" image="/images/expand.gif" id="expand" action="#{treeNavigationActions.expandAction}" title="expand the selected node" />
<h:commandButton type="image" image="/images/collapse.gif" action="#{treeNavigationActions.collapsAction}" title="collaps the selected node"/>
</th>
</tr>
<tr>
<td colspan="4">
<h:outputText id="locateInput" value="#{treeNavigationActions.searchResultString}" />
</td>
</tr>
</table>
</h:form>
<h:form id="treeForm">
<o:tree id="tree6" binding="#{TreeBean.UITree5}"/>
</h:form>
...
</f:view>
+
+ + + + + + + +

+(run)
+
+
+The navigation panel +has the following three node set functions:
+
    +
  • highestNodeAction This Action sets the selected node as highest visible +node in the tree.
    +
  • +
  • parentNodeAction This Action replaces the highest visible node with it's parent +node
  • +
  • rootNodeAction This Action replaces the highest visible node with the root +node.
    +
  • +
+
+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example7.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example7.html new file mode 100644 index 0000000..a45e924 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example7.html @@ -0,0 +1,79 @@ + + + + + ourfaces tree example 7 + + + +

Components - Tree - Navigation Panel +with +Scrolling Functionality +

+For navigation in really big +trees you can add a scrolling function to the navigation panel.
+
+ + + + + + + + + +
+
<f:view>
...
<h:form id="scrollingForm">
<table>
<tr>
<th class="sub" style="color: rgb(0, 0, 0);">
<b>SCROLLING</b>
</th>
<th class="sub">
<h:selectOneMenu onchange="submit()" id="numOfNodes" value="#{treeNavigationActions.numberOfNodesToRender}" title="number of rendered nodes" >
<f:selectItems id="select1" value="#{treeNavigationActions.numberOfNodesToRenderOption}"/>
</h:selectOneMenu>
</th>
<th class="sub">
<h:commandButton id="back" value="< back" action="#{treeNavigationActions.scrollBackAction}" title="scroll a page up"/>
<h:inputText value="#{treeNavigationActions.firstNodeToRender}" onchange="submit()" size="2" title="jump to node nr. " converter="integer" />
<h:commandButton id="toNode" value="jump" title="go to selected node number"/>
<h:commandButton id="forward" value="forward >" action="#{treeNavigationActions.scrollForwardAction}" title="scroll a page down"/>
</th>
</tr>
</table>
</h:form>
<h:form id="treeForm">
<o:tree id="tree7" binding="#{TreeBean.UITree5}"/>
</h:form>
...
</f:view>

+
+ + + + + + + +

+(run)
+
+
+The scrolling function consists of :
+
+
    +
  •  ComboBox Sets the number of nodes to display (page +size)
    +
  • +
  • scrollBackAction This Action srolls +a page up
  • +
  • TextField Jumps to the node with the number of the +textfield
  • +
  • scrollForwardAction This Action scrolls a page down
    +
  • +
+
+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example8.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example8.html new file mode 100644 index 0000000..694ec9f --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example8.html @@ -0,0 +1,98 @@ + + + + + ourfaces tree example 8 + + + +

Components - Tree - Sorting Nodes +

+
+There are two types of sorting: +Default is an alpha-numeric sorting of the nodes according to their +labels. However, when creating a TreeModel one could switch on an +explizit sorting of the Nodes independent of the labels.
+ + + + + + + + + +
+
<f:view>
...
<o:stylesheet path="/tree/tree-control.css"/>
<h:form id="navigationForm">
...
<table>
<tr>
<th class="sub">
<h:commandButton type="image" image="/images/moveTop.gif" action="#{treeNavigationActions.moveTop}" title="moves the selected node to top"/>
<h:commandButton type="image" image="/images/moveUp.gif" action="#{treeNavigationActions.moveUp}" title="moves up the selected node"/>
<h:commandButton type="image" image="/images/moveDown.gif" action="#{treeNavigationActions.moveDown}" title="moves down the selected node"/>
<h:commandButton type="image" image="/images/moveBottom.gif" action="#{treeNavigationActions.moveBottom}" title="moves the selected node to bottom"/>
</th>
<th class="sub">
<h:command_button type="image" image="/images/moveToPos.gif" action="#{treeNavigationActions.moveToPosition}" title="moves the selected node to position"/>
<h:inputText size="3" id="posInput" value="#{treeNavigationActions.pos}" converter="integer" />
</th>
<th class="sub">
<h:commandButton type="image" image="/images/numberingOn.gif" action="#{treeNavigationActions.toggleNumbering}" title="switches the numbering of nodes on/off"/>
</th>
</tr>
</table>
</h:form>
<h:form id="treeForm">
<o:tree id="tree8" binding="#{TreeBean.UITree8}"/>/>
</h:form>
<h:messages/>
...
</f:view>
+
+ + + + + + + +

+(run)
+
+
+The navigation panel +has the following sorting functions:
+
+
    +
  • moveTop This Action moves the selected node to the first +position.
    +
  • +
  • moveUp This + Action moves +the selected node one position up.
  • +
  • moveDown This + Action moves +the selected node one position down.
  • +
  • moveBottom This + Action moves +the selected node to the last position.
    +
  • +
  • moveToPos This + Action moves +the selected node to a defined position.
  • +
  • numberingOn This + Action switches +the 'showing of numbers' on and off.
    +
    +
  • +
+
+
+
+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_example9.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example9.html new file mode 100644 index 0000000..c8d41e8 --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_example9.html @@ -0,0 +1,54 @@ + + + + + ourfaces tree example 9 + + + +

Components - Tree - Copy Nodes +

+
+Copy and Paste of subtrees between +different hierarchies (or as here within on hierarchy).
+
+ + + + + + + + + +
+
<f:view>
...
<o:stylesheet path="/tree/tree-control.css"/>
<h:form id="navigationForm">
<table>
<tr>
<td colspan="4">
<h:outputText value="#{treeNavigationActions.searchResultString}"/>
</td>
</tr>
<o:set var="#{treeNavigationActions.affectedUITreeId}" value="treeForm:tree9"/>
<tr>
...
<th class="sub">
<h:commandButton type="image" image="/images/copyicon.gif" action="#{treeNavigationActions.copyTreeNode}" title="copy node and subtree"/>
<h:commandButton type="image" image="/images/paste.gif" action="#{treeNavigationActions.pasteTreeNode}" title="paste node and subtree"/>
</th>
</tr>
</table>
...

<h:form id="treeForm">
<o:tree id="tree9" binding="#{TreeBean.UITree8}"/>
</h:form>
...
</f:view>
+
+ + + + + + + +

+(run)
+
+
+...
+
+
+ + diff --git a/sample-app/protex_tutorial/src_ourfaces/tree/tree_overview.html b/sample-app/protex_tutorial/src_ourfaces/tree/tree_overview.html new file mode 100644 index 0000000..3e4313a --- /dev/null +++ b/sample-app/protex_tutorial/src_ourfaces/tree/tree_overview.html @@ -0,0 +1,50 @@ + + + + + ourfaces tree examples + + + +

+ + Components + + - Tree +

+
+One cound think of a broad spectrum of different needs for a tree:
+
    +
  • from small trees with some node to large trees with millions of +nodes
  • +
  • from trees that remain the same over time to trees that change +due to user actions or other reasons
  • +
  • from trees with one kind of node to trees with different kinds of +nodes
  • +
  • from menu like rendering to directory like rendering
  • +
  • from static nodes to nodes that link so some target or even cause +some richer actions
  • +
+  +

+Some of these needs are reflected by the existing tree component. The +tree component introduces itself by examples:
+

+
+
+ + diff --git a/sample-app/protex_tutorial/src_pgsl/Makefile b/sample-app/protex_tutorial/src_pgsl/Makefile new file mode 100644 index 0000000..4058cfb --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/Makefile @@ -0,0 +1,44 @@ +# +# Makefile for utils/adt +# +# $Header: /cvsroot/pgsql-server/src/backend/utils/adt/Makefile,v 1.55 2003/05/12 23:08:50 tgl Exp $ +# + +subdir = src/backend/utils/adt +top_builddir = ../../../.. +include $(top_builddir)/src/Makefile.global + +# seems to be required for some date/time stuff 1999/07/22 bjm +ifeq "$(findstring alpha,$(host_cpu))" "alpha" +ifeq "$(GCC)" "yes" +override CFLAGS+= -mieee +endif +endif + +OBJS = acl.o arrayfuncs.o array_userfuncs.o arrayutils.o bool.o \ + cash.o char.o date.o datetime.o datum.o float.o format_type.o \ + geo_ops.o geo_selfuncs.o int.o int8.o like.o lockfuncs.o \ + misc.o nabstime.o name.o not_in.o numeric.o numutils.o \ + oid.o oracle_compat.o pseudotypes.o \ + regexp.o regproc.o ruleutils.o selfuncs.o sets.o \ + tid.o timestamp.o varbit.o varchar.o varlena.o version.o xid.o \ + network.o mac.o inet_net_ntop.o inet_net_pton.o \ + ri_triggers.o pg_lzcompress.o pg_locale.o formatting.o \ + ascii.o quote.o pgstatfuncs.o encode.o + +like.o: like.c like_match.c + +all: SUBSYS.o + +SUBSYS.o: $(OBJS) + $(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS) + +depend dep: + $(CC) -MM $(CFLAGS) *.c >depend + +clean: + rm -f SUBSYS.o $(OBJS) + +ifeq (depend,$(wildcard depend)) +include depend +endif diff --git a/sample-app/protex_tutorial/src_pgsl/arrayutils.c b/sample-app/protex_tutorial/src_pgsl/arrayutils.c new file mode 100644 index 0000000..e035eb5 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/arrayutils.c @@ -0,0 +1,131 @@ +/*------------------------------------------------------------------------- + * + * arrayutils.c + * This file contains some support routines required for array functions. + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/arrayutils.c,v 1.14 2003/08/04 02:40:04 momjian Exp $ + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "utils/array.h" + + +/* Convert subscript list into linear element number (from 0) */ +int +ArrayGetOffset(int n, int *dim, int *lb, int *indx) +{ + int i, + scale = 1, + offset = 0; + + for (i = n - 1; i >= 0; i--) + { + offset += (indx[i] - lb[i]) * scale; + scale *= dim[i]; + } + return offset; +} + +/* Same, but subscripts are assumed 0-based, and use a scale array + * instead of raw dimension data (see mda_get_prod to create scale array) + */ +int +ArrayGetOffset0(int n, int *tup, int *scale) +{ + int i, + lin = 0; + + for (i = 0; i < n; i++) + lin += tup[i] * scale[i]; + return lin; +} + +/* Convert array dimensions into number of elements */ +int +ArrayGetNItems(int n, int *a) +{ + int i, + ret; + + if (n <= 0) + return 0; + ret = 1; + for (i = 0; i < n; i++) + ret *= a[i]; + return ret; +} + +/* Compute ranges (sub-array dimensions) for an array slice */ +void +mda_get_range(int n, int *span, int *st, int *endp) +{ + int i; + + for (i = 0; i < n; i++) + span[i] = endp[i] - st[i] + 1; +} + +/* Compute products of array dimensions, ie, scale factors for subscripts */ +void +mda_get_prod(int n, int *range, int *prod) +{ + int i; + + prod[n - 1] = 1; + for (i = n - 2; i >= 0; i--) + prod[i] = prod[i + 1] * range[i + 1]; +} + +/* From products of whole-array dimensions and spans of a sub-array, + * compute offset distances needed to step through subarray within array + */ +void +mda_get_offset_values(int n, int *dist, int *prod, int *span) +{ + int i, + j; + + dist[n - 1] = 0; + for (j = n - 2; j >= 0; j--) + { + dist[j] = prod[j] - 1; + for (i = j + 1; i < n; i++) + dist[j] -= (span[i] - 1) * prod[i]; + } +} + +/*----------------------------------------------------------------------------- + generates the tuple that is lexicographically one greater than the current + n-tuple in "curr", with the restriction that the i-th element of "curr" is + less than the i-th element of "span". + Returns -1 if no next tuple exists, else the subscript position (0..n-1) + corresponding to the dimension to advance along. + ----------------------------------------------------------------------------- +*/ +int +mda_next_tuple(int n, int *curr, int *span) +{ + int i; + + if (n <= 0) + return -1; + + curr[n - 1] = (curr[n - 1] + 1) % span[n - 1]; + for (i = n - 1; i && curr[i] == 0; i--) + curr[i - 1] = (curr[i - 1] + 1) % span[i - 1]; + + if (i) + return i; + if (curr[0]) + return 0; + + return -1; +} diff --git a/sample-app/protex_tutorial/src_pgsl/ascii.c b/sample-app/protex_tutorial/src_pgsl/ascii.c new file mode 100644 index 0000000..65fc17c --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/ascii.c @@ -0,0 +1,142 @@ +/*----------------------------------------------------------------------- + * ascii.c + * The PostgreSQL routine for string to ascii conversion. + * + * Portions Copyright (c) 1999-2003, PostgreSQL Global Development Group + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/ascii.c,v 1.19 2003/09/26 15:27:36 petere Exp $ + * + *----------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "utils/builtins.h" +#include "mb/pg_wchar.h" +#include "utils/ascii.h" + +static void pg_to_ascii(unsigned char *src, unsigned char *src_end, + unsigned char *dest, int enc); +static text *encode_to_ascii(text *data, int enc); + + +/* ---------- + * to_ascii + * ---------- + */ +static void +pg_to_ascii(unsigned char *src, unsigned char *src_end, unsigned char *dest, int enc) +{ + unsigned char *x; + unsigned char *ascii; + int range; + + /* + * relevant start for an encoding + */ +#define RANGE_128 128 +#define RANGE_160 160 + + if (enc == PG_LATIN1) + { + /* + * ISO-8859-1 + */ + ascii = " cL Y \"Ca -R 'u ., ?AAAAAAACEEEEIIII NOOOOOxOUUUUYTBaaaaaaaceeeeiiii nooooo/ouuuuyty"; + range = RANGE_160; + } + else if (enc == PG_LATIN2) + { + /* + * ISO-8859-2 + */ + ascii = " A L LS \"SSTZ-ZZ a,l'ls ,sstz\"zzRAAAALCCCEEEEIIDDNNOOOOxRUUUUYTBraaaalccceeeeiiddnnoooo/ruuuuyt."; + range = RANGE_160; + } + else if (enc == PG_WIN1250) + { + /* + * Window CP1250 + */ + ascii = " ' \" %Sstzz L A \"CS -RZ ,l'u .,as L\"lzRAAAALCCCEEEEIIDDNNOOOOxRUUUUYTBraaaalccceeeeiiddnnoooo/ruuuuyt "; + range = RANGE_128; + } + else + { + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("encoding conversion from %s to ASCII not supported", + pg_encoding_to_char(enc)))); + return; /* keep compiler quiet */ + } + + /* + * Encode + */ + for (x = src; x < src_end; x++) + { + if (*x < 128) + *dest++ = *x; + else if (*x < range) + *dest++ = ' '; /* bogus 128 to 'range' */ + else + *dest++ = ascii[*x - range]; + } +} + +/* ---------- + * encode text + * + * The text datum is overwritten in-place, therefore this coding method + * cannot support conversions that change the string length! + * ---------- + */ +static text * +encode_to_ascii(text *data, int enc) +{ + pg_to_ascii((unsigned char *) VARDATA(data), /* src */ + (unsigned char *) (data) + VARSIZE(data), /* src end */ + (unsigned char *) VARDATA(data), /* dest */ + enc); /* encoding */ + + return data; +} + +/* ---------- + * convert to ASCII - enc is set as 'name' arg. + * ---------- + */ +Datum +to_ascii_encname(PG_FUNCTION_ARGS) +{ + text *data = PG_GETARG_TEXT_P_COPY(0); + int enc = pg_char_to_encoding(NameStr(*PG_GETARG_NAME(1))); + + PG_RETURN_TEXT_P(encode_to_ascii(data, enc)); +} + +/* ---------- + * convert to ASCII - enc is set as int4 + * ---------- + */ +Datum +to_ascii_enc(PG_FUNCTION_ARGS) +{ + text *data = PG_GETARG_TEXT_P_COPY(0); + int enc = PG_GETARG_INT32(1); + + PG_RETURN_TEXT_P(encode_to_ascii(data, enc)); +} + +/* ---------- + * convert to ASCII - current enc is DatabaseEncoding + * ---------- + */ +Datum +to_ascii_default(PG_FUNCTION_ARGS) +{ + text *data = PG_GETARG_TEXT_P_COPY(0); + int enc = GetDatabaseEncoding(); + + PG_RETURN_TEXT_P(encode_to_ascii(data, enc)); +} diff --git a/sample-app/protex_tutorial/src_pgsl/bool.c b/sample-app/protex_tutorial/src_pgsl/bool.c new file mode 100644 index 0000000..7f0173d --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/bool.c @@ -0,0 +1,250 @@ +/*------------------------------------------------------------------------- + * + * bool.c + * Functions for the built-in type "bool". + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/bool.c,v 1.30 2003/09/25 06:58:03 petere Exp $ + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "libpq/pqformat.h" +#include "utils/builtins.h" + +/***************************************************************************** + * USER I/O ROUTINES * + *****************************************************************************/ + +/* + * boolin - converts "t" or "f" to 1 or 0 + * + * Check explicitly for "true/false" and TRUE/FALSE, 1/0, YES/NO. + * Reject other values. - thomas 1997-10-05 + * + * In the switch statement, check the most-used possibilities first. + */ +Datum +boolin(PG_FUNCTION_ARGS) +{ + char *b = PG_GETARG_CSTRING(0); + + switch (*b) + { + case 't': + case 'T': + if (strncasecmp(b, "true", strlen(b)) == 0) + PG_RETURN_BOOL(true); + break; + + case 'f': + case 'F': + if (strncasecmp(b, "false", strlen(b)) == 0) + PG_RETURN_BOOL(false); + break; + + case 'y': + case 'Y': + if (strncasecmp(b, "yes", strlen(b)) == 0) + PG_RETURN_BOOL(true); + break; + + case '1': + if (strncasecmp(b, "1", strlen(b)) == 0) + PG_RETURN_BOOL(true); + break; + + case 'n': + case 'N': + if (strncasecmp(b, "no", strlen(b)) == 0) + PG_RETURN_BOOL(false); + break; + + case '0': + if (strncasecmp(b, "0", strlen(b)) == 0) + PG_RETURN_BOOL(false); + break; + + default: + break; + } + + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type boolean: \"%s\"", b))); + + /* not reached */ + PG_RETURN_BOOL(false); +} + +/* + * boolout - converts 1 or 0 to "t" or "f" + */ +Datum +boolout(PG_FUNCTION_ARGS) +{ + bool b = PG_GETARG_BOOL(0); + char *result = (char *) palloc(2); + + result[0] = (b) ? 't' : 'f'; + result[1] = '\0'; + PG_RETURN_CSTRING(result); +} + +/* + * boolrecv - converts external binary format to bool + * + * The external representation is one byte. Any nonzero value is taken + * as "true". + */ +Datum +boolrecv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + int ext; + + ext = pq_getmsgbyte(buf); + PG_RETURN_BOOL((ext != 0) ? true : false); +} + +/* + * boolsend - converts bool to binary format + */ +Datum +boolsend(PG_FUNCTION_ARGS) +{ + bool arg1 = PG_GETARG_BOOL(0); + StringInfoData buf; + + pq_begintypsend(&buf); + pq_sendbyte(&buf, arg1 ? 1 : 0); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + + +/***************************************************************************** + * PUBLIC ROUTINES * + *****************************************************************************/ + +Datum +booleq(PG_FUNCTION_ARGS) +{ + bool arg1 = PG_GETARG_BOOL(0); + bool arg2 = PG_GETARG_BOOL(1); + + PG_RETURN_BOOL(arg1 == arg2); +} + +Datum +boolne(PG_FUNCTION_ARGS) +{ + bool arg1 = PG_GETARG_BOOL(0); + bool arg2 = PG_GETARG_BOOL(1); + + PG_RETURN_BOOL(arg1 != arg2); +} + +Datum +boollt(PG_FUNCTION_ARGS) +{ + bool arg1 = PG_GETARG_BOOL(0); + bool arg2 = PG_GETARG_BOOL(1); + + PG_RETURN_BOOL(arg1 < arg2); +} + +Datum +boolgt(PG_FUNCTION_ARGS) +{ + bool arg1 = PG_GETARG_BOOL(0); + bool arg2 = PG_GETARG_BOOL(1); + + PG_RETURN_BOOL(arg1 > arg2); +} + +Datum +boolle(PG_FUNCTION_ARGS) +{ + bool arg1 = PG_GETARG_BOOL(0); + bool arg2 = PG_GETARG_BOOL(1); + + PG_RETURN_BOOL(arg1 <= arg2); +} + +Datum +boolge(PG_FUNCTION_ARGS) +{ + bool arg1 = PG_GETARG_BOOL(0); + bool arg2 = PG_GETARG_BOOL(1); + + PG_RETURN_BOOL(arg1 >= arg2); +} + +/* + * Per SQL92, istrue() and isfalse() should return false, not NULL, + * when presented a NULL input (since NULL is our implementation of + * UNKNOWN). Conversely isnottrue() and isnotfalse() should return true. + * Therefore, these routines are all declared not-strict in pg_proc + * and must do their own checking for null inputs. + * + * Note we don't need isunknown() and isnotunknown() functions, since + * nullvalue() and nonnullvalue() will serve. + */ + +Datum +istrue(PG_FUNCTION_ARGS) +{ + bool b; + + if (PG_ARGISNULL(0)) + PG_RETURN_BOOL(false); + + b = PG_GETARG_BOOL(0); + + PG_RETURN_BOOL(b); +} + +Datum +isfalse(PG_FUNCTION_ARGS) +{ + bool b; + + if (PG_ARGISNULL(0)) + PG_RETURN_BOOL(false); + + b = PG_GETARG_BOOL(0); + + PG_RETURN_BOOL(!b); +} + +Datum +isnottrue(PG_FUNCTION_ARGS) +{ + bool b; + + if (PG_ARGISNULL(0)) + PG_RETURN_BOOL(true); + + b = PG_GETARG_BOOL(0); + + PG_RETURN_BOOL(!b); +} + +Datum +isnotfalse(PG_FUNCTION_ARGS) +{ + bool b; + + if (PG_ARGISNULL(0)) + PG_RETURN_BOOL(true); + + b = PG_GETARG_BOOL(0); + + PG_RETURN_BOOL(b); +} diff --git a/sample-app/protex_tutorial/src_pgsl/char.c b/sample-app/protex_tutorial/src_pgsl/char.c new file mode 100644 index 0000000..8651c82 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/char.c @@ -0,0 +1,230 @@ +/*------------------------------------------------------------------------- + * + * char.c + * Functions for the built-in type "char" (not to be confused with + * bpchar, which is the SQL CHAR(n) type). + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/char.c,v 1.38 2003/08/04 02:40:04 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "libpq/pqformat.h" +#include "utils/builtins.h" + +/***************************************************************************** + * USER I/O ROUTINES * + *****************************************************************************/ + +/* + * charin - converts "x" to 'x' + * + * Note that an empty input string will implicitly be converted to \0. + */ +Datum +charin(PG_FUNCTION_ARGS) +{ + char *ch = PG_GETARG_CSTRING(0); + + PG_RETURN_CHAR(ch[0]); +} + +/* + * charout - converts 'x' to "x" + * + * Note that if the char value is \0, the resulting string will appear + * to be empty (null-terminated after zero characters). So this is the + * inverse of the charin() function for such data. + */ +Datum +charout(PG_FUNCTION_ARGS) +{ + char ch = PG_GETARG_CHAR(0); + char *result = (char *) palloc(2); + + result[0] = ch; + result[1] = '\0'; + PG_RETURN_CSTRING(result); +} + +/* + * charrecv - converts external binary format to char + * + * The external representation is one byte, with no character set + * conversion. This is somewhat dubious, perhaps, but in many + * cases people use char for a 1-byte binary type. + */ +Datum +charrecv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + + PG_RETURN_CHAR(pq_getmsgbyte(buf)); +} + +/* + * charsend - converts char to binary format + */ +Datum +charsend(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + StringInfoData buf; + + pq_begintypsend(&buf); + pq_sendbyte(&buf, arg1); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + +/***************************************************************************** + * PUBLIC ROUTINES * + *****************************************************************************/ + +/* + * NOTE: comparisons are done as though char is unsigned (uint8). + * Arithmetic is done as though char is signed (int8). + * + * You wanted consistency? + */ + +Datum +chareq(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_BOOL(arg1 == arg2); +} + +Datum +charne(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_BOOL(arg1 != arg2); +} + +Datum +charlt(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_BOOL((uint8) arg1 < (uint8) arg2); +} + +Datum +charle(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_BOOL((uint8) arg1 <= (uint8) arg2); +} + +Datum +chargt(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_BOOL((uint8) arg1 > (uint8) arg2); +} + +Datum +charge(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_BOOL((uint8) arg1 >= (uint8) arg2); +} + +Datum +charpl(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_CHAR((int8) arg1 + (int8) arg2); +} + +Datum +charmi(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_CHAR((int8) arg1 - (int8) arg2); +} + +Datum +charmul(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + PG_RETURN_CHAR((int8) arg1 * (int8) arg2); +} + +Datum +chardiv(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + char arg2 = PG_GETARG_CHAR(1); + + if (arg2 == 0) + ereport(ERROR, + (errcode(ERRCODE_DIVISION_BY_ZERO), + errmsg("division by zero"))); + + PG_RETURN_CHAR((int8) arg1 / (int8) arg2); +} + + +Datum +text_char(PG_FUNCTION_ARGS) +{ + text *arg1 = PG_GETARG_TEXT_P(0); + char result; + + /* + * An empty input string is converted to \0 (for consistency with + * charin). If the input is longer than one character, the excess data + * is silently discarded. + */ + if (VARSIZE(arg1) > VARHDRSZ) + result = *(VARDATA(arg1)); + else + result = '\0'; + + PG_RETURN_CHAR(result); +} + +Datum +char_text(PG_FUNCTION_ARGS) +{ + char arg1 = PG_GETARG_CHAR(0); + text *result = palloc(VARHDRSZ + 1); + + /* + * Convert \0 to an empty string, for consistency with charout (and + * because the text stuff doesn't like embedded nulls all that well). + */ + if (arg1 != '\0') + { + VARATT_SIZEP(result) = VARHDRSZ + 1; + *(VARDATA(result)) = arg1; + } + else + VARATT_SIZEP(result) = VARHDRSZ; + + PG_RETURN_TEXT_P(result); +} diff --git a/sample-app/protex_tutorial/src_pgsl/datum.c b/sample-app/protex_tutorial/src_pgsl/datum.c new file mode 100644 index 0000000..f55489d --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/datum.c @@ -0,0 +1,209 @@ +/*------------------------------------------------------------------------- + * + * datum.c + * POSTGRES Datum (abstract data type) manipulation routines. + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/datum.c,v 1.27 2003/08/04 02:40:04 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +/* + * In the implementation of the next routines we assume the following: + * + * A) if a type is "byVal" then all the information is stored in the + * Datum itself (i.e. no pointers involved!). In this case the + * length of the type is always greater than zero and not more than + * "sizeof(Datum)" + * + * B) if a type is not "byVal" and it has a fixed length (typlen > 0), + * then the "Datum" always contains a pointer to a stream of bytes. + * The number of significant bytes are always equal to the typlen. + * + * C) if a type is not "byVal" and has typlen == -1, + * then the "Datum" always points to a "struct varlena". + * This varlena structure has information about the actual length of this + * particular instance of the type and about its value. + * + * D) if a type is not "byVal" and has typlen == -2, + * then the "Datum" always points to a null-terminated C string. + * + * Note that we do not treat "toasted" datums specially; therefore what + * will be copied or compared is the compressed data or toast reference. + */ + +#include "postgres.h" + +#include "utils/datum.h" + + +/*------------------------------------------------------------------------- + * datumGetSize + * + * Find the "real" size of a datum, given the datum value, + * whether it is a "by value", and the declared type length. + * + * This is essentially an out-of-line version of the att_addlength() + * macro in access/tupmacs.h. We do a tad more error checking though. + *------------------------------------------------------------------------- + */ +Size +datumGetSize(Datum value, bool typByVal, int typLen) +{ + Size size; + + if (typByVal) + { + /* Pass-by-value types are always fixed-length */ + Assert(typLen > 0 && typLen <= sizeof(Datum)); + size = (Size) typLen; + } + else + { + if (typLen > 0) + { + /* Fixed-length pass-by-ref type */ + size = (Size) typLen; + } + else if (typLen == -1) + { + /* It is a varlena datatype */ + struct varlena *s = (struct varlena *) DatumGetPointer(value); + + if (!PointerIsValid(s)) + ereport(ERROR, + (errcode(ERRCODE_DATA_EXCEPTION), + errmsg("invalid Datum pointer"))); + + size = (Size) VARATT_SIZE(s); + } + else if (typLen == -2) + { + /* It is a cstring datatype */ + char *s = (char *) DatumGetPointer(value); + + if (!PointerIsValid(s)) + ereport(ERROR, + (errcode(ERRCODE_DATA_EXCEPTION), + errmsg("invalid Datum pointer"))); + + size = (Size) (strlen(s) + 1); + } + else + { + elog(ERROR, "invalid typLen: %d", typLen); + size = 0; /* keep compiler quiet */ + } + } + + return size; +} + +/*------------------------------------------------------------------------- + * datumCopy + * + * make a copy of a datum + * + * If the datatype is pass-by-reference, memory is obtained with palloc(). + *------------------------------------------------------------------------- + */ +Datum +datumCopy(Datum value, bool typByVal, int typLen) +{ + Datum res; + + if (typByVal) + res = value; + else + { + Size realSize; + char *s; + + if (DatumGetPointer(value) == NULL) + return PointerGetDatum(NULL); + + realSize = datumGetSize(value, typByVal, typLen); + + s = (char *) palloc(realSize); + memcpy(s, DatumGetPointer(value), realSize); + res = PointerGetDatum(s); + } + return res; +} + +/*------------------------------------------------------------------------- + * datumFree + * + * Free the space occupied by a datum CREATED BY "datumCopy" + * + * NOTE: DO NOT USE THIS ROUTINE with datums returned by heap_getattr() etc. + * ONLY datums created by "datumCopy" can be freed! + *------------------------------------------------------------------------- + */ +#ifdef NOT_USED +void +datumFree(Datum value, bool typByVal, int typLen) +{ + if (!typByVal) + { + Pointer s = DatumGetPointer(value); + + pfree(s); + } +} +#endif + +/*------------------------------------------------------------------------- + * datumIsEqual + * + * Return true if two datums are equal, false otherwise + * + * NOTE: XXX! + * We just compare the bytes of the two values, one by one. + * This routine will return false if there are 2 different + * representations of the same value (something along the lines + * of say the representation of zero in one's complement arithmetic). + * Also, it will probably not give the answer you want if either + * datum has been "toasted". + *------------------------------------------------------------------------- + */ +bool +datumIsEqual(Datum value1, Datum value2, bool typByVal, int typLen) +{ + bool res; + + if (typByVal) + { + /* + * just compare the two datums. NOTE: just comparing "len" bytes + * will not do the work, because we do not know how these bytes + * are aligned inside the "Datum". We assume instead that any + * given datatype is consistent about how it fills extraneous bits + * in the Datum. + */ + res = (value1 == value2); + } + else + { + Size size1, + size2; + char *s1, + *s2; + + /* + * Compare the bytes pointed by the pointers stored in the datums. + */ + size1 = datumGetSize(value1, typByVal, typLen); + size2 = datumGetSize(value2, typByVal, typLen); + if (size1 != size2) + return false; + s1 = (char *) DatumGetPointer(value1); + s2 = (char *) DatumGetPointer(value2); + res = (memcmp(s1, s2, size1) == 0); + } + return res; +} diff --git a/sample-app/protex_tutorial/src_pgsl/geo_selfuncs.c b/sample-app/protex_tutorial/src_pgsl/geo_selfuncs.c new file mode 100644 index 0000000..5a1c9d2 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/geo_selfuncs.c @@ -0,0 +1,95 @@ +/*------------------------------------------------------------------------- + * + * geo_selfuncs.c + * Selectivity routines registered in the operator catalog in the + * "oprrest" and "oprjoin" attributes. + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/geo_selfuncs.c,v 1.21 2003/08/04 02:40:05 momjian Exp $ + * + * XXX These are totally bogus. Perhaps someone will make them do + * something reasonable, someday. + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "utils/geo_decls.h" + + +/* + * Selectivity functions for rtrees. These are bogus -- unless we know + * the actual key distribution in the index, we can't make a good prediction + * of the selectivity of these operators. + * + * Note: the values used here may look unreasonably small. Perhaps they + * are. For now, we want to make sure that the optimizer will make use + * of an r-tree index if one is available, so the selectivity had better + * be fairly small. + * + * In general, rtrees need to search multiple subtrees in order to guarantee + * that all occurrences of the same key have been found. Because of this, + * the estimated cost for scanning the index ought to be higher than the + * output selectivity would indicate. rtcostestimate(), over in selfuncs.c, + * ought to be adjusted accordingly --- but until we can generate somewhat + * realistic numbers here, it hardly matters... + */ + + +/* + * Selectivity for operators that depend on area, such as "overlap". + */ + +Datum +areasel(PG_FUNCTION_ARGS) +{ + PG_RETURN_FLOAT8(0.005); +} + +Datum +areajoinsel(PG_FUNCTION_ARGS) +{ + PG_RETURN_FLOAT8(0.005); +} + +/* + * positionsel + * + * How likely is a box to be strictly left of (right of, above, below) + * a given box? + */ + +Datum +positionsel(PG_FUNCTION_ARGS) +{ + PG_RETURN_FLOAT8(0.1); +} + +Datum +positionjoinsel(PG_FUNCTION_ARGS) +{ + PG_RETURN_FLOAT8(0.1); +} + +/* + * contsel -- How likely is a box to contain (be contained by) a given box? + * + * This is a tighter constraint than "overlap", so produce a smaller + * estimate than areasel does. + */ + +Datum +contsel(PG_FUNCTION_ARGS) +{ + PG_RETURN_FLOAT8(0.001); +} + +Datum +contjoinsel(PG_FUNCTION_ARGS) +{ + PG_RETURN_FLOAT8(0.001); +} diff --git a/sample-app/protex_tutorial/src_pgsl/like_match.c b/sample-app/protex_tutorial/src_pgsl/like_match.c new file mode 100644 index 0000000..45859ef --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/like_match.c @@ -0,0 +1,338 @@ +/*------------------------------------------------------------------------- + * + * like_match.c + * like expression handling internal code. + * + * This file is included by like.c *twice*, to provide an optimization + * for single-byte encodings. + * + * Before the inclusion, we need to define following macros: + * + * CHAREQ + * ICHAREQ + * NextChar + * CopyAdvChar + * MatchText (MBMatchText) + * MatchTextIC (MBMatchTextIC) + * do_like_escape (MB_do_like_escape) + * + * Copyright (c) 1996-2003, PostgreSQL Global Development Group + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/like_match.c,v 1.7 2003/08/04 23:59:38 tgl Exp $ + * + *------------------------------------------------------------------------- + */ + +/* +** Originally written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986. +** Rich $alz is now . +** Special thanks to Lars Mathiesen for the LABORT code. +** +** This code was shamelessly stolen from the "pql" code by myself and +** slightly modified :) +** +** All references to the word "star" were replaced by "percent" +** All references to the word "wild" were replaced by "like" +** +** All the nice shell RE matching stuff was replaced by just "_" and "%" +** +** As I don't have a copy of the SQL standard handy I wasn't sure whether +** to leave in the '\' escape character handling. +** +** Keith Parks. +** +** SQL92 lets you specify the escape character by saying +** LIKE ESCAPE . We are a small operation +** so we force you to use '\'. - ay 7/95 +** +** Now we have the like_escape() function that converts patterns with +** any specified escape character (or none at all) to the internal +** default escape character, which is still '\'. - tgl 9/2000 +** +** The code is rewritten to avoid requiring null-terminated strings, +** which in turn allows us to leave out some memcpy() operations. +** This code should be faster and take less memory, but no promises... +** - thomas 2000-08-06 +** +*/ + + +/*-------------------- + * Match text and p, return LIKE_TRUE, LIKE_FALSE, or LIKE_ABORT. + * + * LIKE_TRUE: they match + * LIKE_FALSE: they don't match + * LIKE_ABORT: not only don't they match, but the text is too short. + * + * If LIKE_ABORT is returned, then no suffix of the text can match the + * pattern either, so an upper-level % scan can stop scanning now. + *-------------------- + */ + +static int +MatchText(unsigned char *t, int tlen, unsigned char *p, int plen) +{ + /* Fast path for match-everything pattern */ + if ((plen == 1) && (*p == '%')) + return LIKE_TRUE; + + while ((tlen > 0) && (plen > 0)) + { + if (*p == '\\') + { + /* Next pattern char must match literally, whatever it is */ + NextChar(p, plen); + if ((plen <= 0) || !CHAREQ(t, p)) + return LIKE_FALSE; + } + else if (*p == '%') + { + /* %% is the same as % according to the SQL standard */ + /* Advance past all %'s */ + while ((plen > 0) && (*p == '%')) + NextChar(p, plen); + /* Trailing percent matches everything. */ + if (plen <= 0) + return LIKE_TRUE; + + /* + * Otherwise, scan for a text position at which we can match + * the rest of the pattern. + */ + while (tlen > 0) + { + /* + * Optimization to prevent most recursion: don't recurse + * unless first pattern char might match this text char. + */ + if (CHAREQ(t, p) || (*p == '\\') || (*p == '_')) + { + int matched = MatchText(t, tlen, p, plen); + + if (matched != LIKE_FALSE) + return matched; /* TRUE or ABORT */ + } + + NextChar(t, tlen); + } + + /* + * End of text with no match, so no point in trying later + * places to start matching this pattern. + */ + return LIKE_ABORT; + } + else if ((*p != '_') && !CHAREQ(t, p)) + { + /* + * Not the single-character wildcard and no explicit match? + * Then time to quit... + */ + return LIKE_FALSE; + } + + NextChar(t, tlen); + NextChar(p, plen); + } + + if (tlen > 0) + return LIKE_FALSE; /* end of pattern, but not of text */ + + /* End of input string. Do we have matching pattern remaining? */ + while ((plen > 0) && (*p == '%')) /* allow multiple %'s at end of + * pattern */ + NextChar(p, plen); + if (plen <= 0) + return LIKE_TRUE; + + /* + * End of text with no match, so no point in trying later places to + * start matching this pattern. + */ + return LIKE_ABORT; +} /* MatchText() */ + +/* + * Same as above, but ignore case + */ +static int +MatchTextIC(unsigned char *t, int tlen, unsigned char *p, int plen) +{ + /* Fast path for match-everything pattern */ + if ((plen == 1) && (*p == '%')) + return LIKE_TRUE; + + while ((tlen > 0) && (plen > 0)) + { + if (*p == '\\') + { + /* Next pattern char must match literally, whatever it is */ + NextChar(p, plen); + if ((plen <= 0) || !ICHAREQ(t, p)) + return LIKE_FALSE; + } + else if (*p == '%') + { + /* %% is the same as % according to the SQL standard */ + /* Advance past all %'s */ + while ((plen > 0) && (*p == '%')) + NextChar(p, plen); + /* Trailing percent matches everything. */ + if (plen <= 0) + return LIKE_TRUE; + + /* + * Otherwise, scan for a text position at which we can match + * the rest of the pattern. + */ + while (tlen > 0) + { + /* + * Optimization to prevent most recursion: don't recurse + * unless first pattern char might match this text char. + */ + if (ICHAREQ(t, p) || (*p == '\\') || (*p == '_')) + { + int matched = MatchTextIC(t, tlen, p, plen); + + if (matched != LIKE_FALSE) + return matched; /* TRUE or ABORT */ + } + + NextChar(t, tlen); + } + + /* + * End of text with no match, so no point in trying later + * places to start matching this pattern. + */ + return LIKE_ABORT; + } + else if ((*p != '_') && !ICHAREQ(t, p)) + { + /* + * Not the single-character wildcard and no explicit match? + * Then time to quit... + */ + return LIKE_FALSE; + } + + NextChar(t, tlen); + NextChar(p, plen); + } + + if (tlen > 0) + return LIKE_FALSE; /* end of pattern, but not of text */ + + /* End of input string. Do we have matching pattern remaining? */ + while ((plen > 0) && (*p == '%')) /* allow multiple %'s at end of + * pattern */ + NextChar(p, plen); + if (plen <= 0) + return LIKE_TRUE; + + /* + * End of text with no match, so no point in trying later places to + * start matching this pattern. + */ + return LIKE_ABORT; +} /* MatchTextIC() */ + +/* + * like_escape() --- given a pattern and an ESCAPE string, + * convert the pattern to use Postgres' standard backslash escape convention. + */ +static text * +do_like_escape(text *pat, text *esc) +{ + text *result; + unsigned char *p, + *e, + *r; + int plen, + elen; + bool afterescape; + + p = VARDATA(pat); + plen = (VARSIZE(pat) - VARHDRSZ); + e = VARDATA(esc); + elen = (VARSIZE(esc) - VARHDRSZ); + + /* + * Worst-case pattern growth is 2x --- unlikely, but it's hardly worth + * trying to calculate the size more accurately than that. + */ + result = (text *) palloc(plen * 2 + VARHDRSZ); + r = VARDATA(result); + + if (elen == 0) + { + /* + * No escape character is wanted. Double any backslashes in the + * pattern to make them act like ordinary characters. + */ + while (plen > 0) + { + if (*p == '\\') + *r++ = '\\'; + CopyAdvChar(r, p, plen); + } + } + else + { + /* + * The specified escape must be only a single character. + */ + NextChar(e, elen); + if (elen != 0) + ereport(ERROR, + (errcode(ERRCODE_INVALID_ESCAPE_SEQUENCE), + errmsg("invalid escape string"), + errhint("Escape string must be empty or one character."))); + + e = VARDATA(esc); + + /* + * If specified escape is '\', just copy the pattern as-is. + */ + if (*e == '\\') + { + memcpy(result, pat, VARSIZE(pat)); + return result; + } + + /* + * Otherwise, convert occurrences of the specified escape + * character to '\', and double occurrences of '\' --- unless they + * immediately follow an escape character! + */ + afterescape = false; + while (plen > 0) + { + if (CHAREQ(p, e) && !afterescape) + { + *r++ = '\\'; + NextChar(p, plen); + afterescape = true; + } + else if (*p == '\\') + { + *r++ = '\\'; + if (!afterescape) + *r++ = '\\'; + NextChar(p, plen); + afterescape = false; + } + else + { + CopyAdvChar(r, p, plen); + afterescape = false; + } + } + } + + VARATT_SIZEP(result) = r - ((unsigned char *) result); + + return result; +} diff --git a/sample-app/protex_tutorial/src_pgsl/lockfuncs.c b/sample-app/protex_tutorial/src_pgsl/lockfuncs.c new file mode 100644 index 0000000..2192574 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/lockfuncs.c @@ -0,0 +1,183 @@ +/*------------------------------------------------------------------------- + * + * lockfuncs.c + * Set-returning functions to view the state of locks within the DB. + * + * Copyright (c) 2002-2003, PostgreSQL Global Development Group + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/lockfuncs.c,v 1.11 2003/08/04 23:59:38 tgl Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "funcapi.h" +#include "access/heapam.h" +#include "catalog/pg_type.h" +#include "storage/lock.h" +#include "storage/proc.h" +#include "utils/builtins.h" + + +/* Working status for pg_lock_status */ +typedef struct +{ + LockData *lockData; /* state data from lmgr */ + int currIdx; /* current PROCLOCK index */ +} PG_Lock_Status; + +/* + * pg_lock_status - produce a view with one row per held or awaited lock mode + */ +Datum +pg_lock_status(PG_FUNCTION_ARGS) +{ + FuncCallContext *funcctx; + PG_Lock_Status *mystatus; + LockData *lockData; + + if (SRF_IS_FIRSTCALL()) + { + TupleDesc tupdesc; + MemoryContext oldcontext; + + /* create a function context for cross-call persistence */ + funcctx = SRF_FIRSTCALL_INIT(); + + /* + * switch to memory context appropriate for multiple function + * calls + */ + oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); + + /* build tupdesc for result tuples */ + /* this had better match pg_locks view in initdb.sh */ + tupdesc = CreateTemplateTupleDesc(6, false); + TupleDescInitEntry(tupdesc, (AttrNumber) 1, "relation", + OIDOID, -1, 0, false); + TupleDescInitEntry(tupdesc, (AttrNumber) 2, "database", + OIDOID, -1, 0, false); + TupleDescInitEntry(tupdesc, (AttrNumber) 3, "transaction", + XIDOID, -1, 0, false); + TupleDescInitEntry(tupdesc, (AttrNumber) 4, "pid", + INT4OID, -1, 0, false); + TupleDescInitEntry(tupdesc, (AttrNumber) 5, "mode", + TEXTOID, -1, 0, false); + TupleDescInitEntry(tupdesc, (AttrNumber) 6, "granted", + BOOLOID, -1, 0, false); + + funcctx->slot = TupleDescGetSlot(tupdesc); + + /* + * Collect all the locking information that we will format and + * send out as a result set. + */ + mystatus = (PG_Lock_Status *) palloc(sizeof(PG_Lock_Status)); + funcctx->user_fctx = (void *) mystatus; + + mystatus->lockData = GetLockStatusData(); + mystatus->currIdx = 0; + + MemoryContextSwitchTo(oldcontext); + } + + funcctx = SRF_PERCALL_SETUP(); + mystatus = (PG_Lock_Status *) funcctx->user_fctx; + lockData = mystatus->lockData; + + while (mystatus->currIdx < lockData->nelements) + { + PROCLOCK *proclock; + LOCK *lock; + PGPROC *proc; + bool granted; + LOCKMODE mode; + Datum values[6]; + char nulls[6]; + HeapTuple tuple; + Datum result; + + proclock = &(lockData->proclocks[mystatus->currIdx]); + lock = &(lockData->locks[mystatus->currIdx]); + proc = &(lockData->procs[mystatus->currIdx]); + + /* + * Look to see if there are any held lock modes in this PROCLOCK. + * If so, report, and destructively modify lockData so we don't + * report again. + */ + granted = false; + for (mode = 0; mode < MAX_LOCKMODES; mode++) + { + if (proclock->holding[mode] > 0) + { + granted = true; + proclock->holding[mode] = 0; + break; + } + } + + /* + * If no (more) held modes to report, see if PROC is waiting for a + * lock on this lock. + */ + if (!granted) + { + if (proc->waitLock == (LOCK *) MAKE_PTR(proclock->tag.lock)) + { + /* Yes, so report it with proper mode */ + mode = proc->waitLockMode; + + /* + * We are now done with this PROCLOCK, so advance pointer + * to continue with next one on next call. + */ + mystatus->currIdx++; + } + else + { + /* + * Okay, we've displayed all the locks associated with + * this PROCLOCK, proceed to the next one. + */ + mystatus->currIdx++; + continue; + } + } + + /* + * Form tuple with appropriate data. + */ + MemSet(values, 0, sizeof(values)); + MemSet(nulls, ' ', sizeof(nulls)); + + if (lock->tag.relId == XactLockTableId && lock->tag.dbId == 0) + { + /* Lock is for transaction ID */ + nulls[0] = 'n'; + nulls[1] = 'n'; + values[2] = TransactionIdGetDatum(lock->tag.objId.xid); + } + else + { + /* Lock is for a relation */ + values[0] = ObjectIdGetDatum(lock->tag.relId); + values[1] = ObjectIdGetDatum(lock->tag.dbId); + nulls[2] = 'n'; + + } + + values[3] = Int32GetDatum(proc->pid); + values[4] = DirectFunctionCall1(textin, + CStringGetDatum(GetLockmodeName(mode))); + values[5] = BoolGetDatum(granted); + + tuple = heap_formtuple(funcctx->slot->ttc_tupleDescriptor, + values, nulls); + result = TupleGetDatum(funcctx->slot, tuple); + SRF_RETURN_NEXT(funcctx, result); + } + + SRF_RETURN_DONE(funcctx); +} diff --git a/sample-app/protex_tutorial/src_pgsl/mac.c b/sample-app/protex_tutorial/src_pgsl/mac.c new file mode 100644 index 0000000..1653cfb --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/mac.c @@ -0,0 +1,317 @@ +/* + * PostgreSQL type definitions for MAC addresses. + * + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/mac.c,v 1.32 2003/09/29 00:05:25 petere Exp $ + */ + +#include "postgres.h" + +#include "access/hash.h" +#include "libpq/pqformat.h" +#include "utils/builtins.h" +#include "utils/inet.h" + + +/* + * Utility macros used for sorting and comparing: + */ + +#define hibits(addr) \ + ((unsigned long)(((addr)->a<<16)|((addr)->b<<8)|((addr)->c))) + +#define lobits(addr) \ + ((unsigned long)(((addr)->d<<16)|((addr)->e<<8)|((addr)->f))) + +/* + * MAC address reader. Accepts several common notations. + */ + +Datum +macaddr_in(PG_FUNCTION_ARGS) +{ + char *str = PG_GETARG_CSTRING(0); + macaddr *result; + int a, + b, + c, + d, + e, + f; + char junk[2]; + int count; + + /* %1s matches iff there is trailing non-whitespace garbage */ + + count = sscanf(str, "%x:%x:%x:%x:%x:%x%1s", + &a, &b, &c, &d, &e, &f, junk); + if (count != 6) + count = sscanf(str, "%x-%x-%x-%x-%x-%x%1s", + &a, &b, &c, &d, &e, &f, junk); + if (count != 6) + count = sscanf(str, "%2x%2x%2x:%2x%2x%2x%1s", + &a, &b, &c, &d, &e, &f, junk); + if (count != 6) + count = sscanf(str, "%2x%2x%2x-%2x%2x%2x%1s", + &a, &b, &c, &d, &e, &f, junk); + if (count != 6) + count = sscanf(str, "%2x%2x.%2x%2x.%2x%2x%1s", + &a, &b, &c, &d, &e, &f, junk); + if (count != 6) + count = sscanf(str, "%2x%2x%2x%2x%2x%2x%1s", + &a, &b, &c, &d, &e, &f, junk); + if (count != 6) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type macaddr: \"%s\"", str))); + + if ((a < 0) || (a > 255) || (b < 0) || (b > 255) || + (c < 0) || (c > 255) || (d < 0) || (d > 255) || + (e < 0) || (e > 255) || (f < 0) || (f > 255)) + ereport(ERROR, + (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("invalid octet value in \"macaddr\" value: \"%s\"", str))); + + result = (macaddr *) palloc(sizeof(macaddr)); + + result->a = a; + result->b = b; + result->c = c; + result->d = d; + result->e = e; + result->f = f; + + PG_RETURN_MACADDR_P(result); +} + +/* + * MAC address output function. Fixed format. + */ + +Datum +macaddr_out(PG_FUNCTION_ARGS) +{ + macaddr *addr = PG_GETARG_MACADDR_P(0); + char *result; + + result = (char *) palloc(32); + + snprintf(result, 32, "%02x:%02x:%02x:%02x:%02x:%02x", + addr->a, addr->b, addr->c, addr->d, addr->e, addr->f); + + PG_RETURN_CSTRING(result); +} + +/* + * macaddr_recv - converts external binary format to macaddr + * + * The external representation is just the six bytes, MSB first. + */ +Datum +macaddr_recv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + macaddr *addr; + + addr = (macaddr *) palloc(sizeof(macaddr)); + + addr->a = pq_getmsgbyte(buf); + addr->b = pq_getmsgbyte(buf); + addr->c = pq_getmsgbyte(buf); + addr->d = pq_getmsgbyte(buf); + addr->e = pq_getmsgbyte(buf); + addr->f = pq_getmsgbyte(buf); + + PG_RETURN_MACADDR_P(addr); +} + +/* + * macaddr_send - converts macaddr to binary format + */ +Datum +macaddr_send(PG_FUNCTION_ARGS) +{ + macaddr *addr = PG_GETARG_MACADDR_P(0); + StringInfoData buf; + + pq_begintypsend(&buf); + pq_sendbyte(&buf, addr->a); + pq_sendbyte(&buf, addr->b); + pq_sendbyte(&buf, addr->c); + pq_sendbyte(&buf, addr->d); + pq_sendbyte(&buf, addr->e); + pq_sendbyte(&buf, addr->f); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + + +/* + * Convert macaddr to text data type. + */ + +Datum +macaddr_text(PG_FUNCTION_ARGS) +{ + /* Input is a macaddr, but may as well leave it in Datum form */ + Datum addr = PG_GETARG_DATUM(0); + text *result; + char *str; + int len; + + str = DatumGetCString(DirectFunctionCall1(macaddr_out, addr)); + + len = (strlen(str) + VARHDRSZ); + + result = palloc(len); + + VARATT_SIZEP(result) = len; + memmove(VARDATA(result), str, (len - VARHDRSZ)); + + pfree(str); + + PG_RETURN_TEXT_P(result); +} + +/* + * Convert text to macaddr data type. + */ + +Datum +text_macaddr(PG_FUNCTION_ARGS) +{ + text *addr = PG_GETARG_TEXT_P(0); + Datum result; + char str[100]; + int len; + + len = (VARSIZE(addr) - VARHDRSZ); + if (len >= sizeof(str)) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("text too long to convert to MAC address"))); + + memcpy(str, VARDATA(addr), len); + *(str + len) = '\0'; + + result = DirectFunctionCall1(macaddr_in, CStringGetDatum(str)); + + return (result); +} + +/* + * Comparison function for sorting: + */ + +static int32 +macaddr_cmp_internal(macaddr *a1, macaddr *a2) +{ + if (hibits(a1) < hibits(a2)) + return -1; + else if (hibits(a1) > hibits(a2)) + return 1; + else if (lobits(a1) < lobits(a2)) + return -1; + else if (lobits(a1) > lobits(a2)) + return 1; + else + return 0; +} + +Datum +macaddr_cmp(PG_FUNCTION_ARGS) +{ + macaddr *a1 = PG_GETARG_MACADDR_P(0); + macaddr *a2 = PG_GETARG_MACADDR_P(1); + + PG_RETURN_INT32(macaddr_cmp_internal(a1, a2)); +} + +/* + * Boolean comparisons. + */ + +Datum +macaddr_lt(PG_FUNCTION_ARGS) +{ + macaddr *a1 = PG_GETARG_MACADDR_P(0); + macaddr *a2 = PG_GETARG_MACADDR_P(1); + + PG_RETURN_BOOL(macaddr_cmp_internal(a1, a2) < 0); +} + +Datum +macaddr_le(PG_FUNCTION_ARGS) +{ + macaddr *a1 = PG_GETARG_MACADDR_P(0); + macaddr *a2 = PG_GETARG_MACADDR_P(1); + + PG_RETURN_BOOL(macaddr_cmp_internal(a1, a2) <= 0); +} + +Datum +macaddr_eq(PG_FUNCTION_ARGS) +{ + macaddr *a1 = PG_GETARG_MACADDR_P(0); + macaddr *a2 = PG_GETARG_MACADDR_P(1); + + PG_RETURN_BOOL(macaddr_cmp_internal(a1, a2) == 0); +} + +Datum +macaddr_ge(PG_FUNCTION_ARGS) +{ + macaddr *a1 = PG_GETARG_MACADDR_P(0); + macaddr *a2 = PG_GETARG_MACADDR_P(1); + + PG_RETURN_BOOL(macaddr_cmp_internal(a1, a2) >= 0); +} + +Datum +macaddr_gt(PG_FUNCTION_ARGS) +{ + macaddr *a1 = PG_GETARG_MACADDR_P(0); + macaddr *a2 = PG_GETARG_MACADDR_P(1); + + PG_RETURN_BOOL(macaddr_cmp_internal(a1, a2) > 0); +} + +Datum +macaddr_ne(PG_FUNCTION_ARGS) +{ + macaddr *a1 = PG_GETARG_MACADDR_P(0); + macaddr *a2 = PG_GETARG_MACADDR_P(1); + + PG_RETURN_BOOL(macaddr_cmp_internal(a1, a2) != 0); +} + +/* + * Support function for hash indexes on macaddr. + */ +Datum +hashmacaddr(PG_FUNCTION_ARGS) +{ + macaddr *key = PG_GETARG_MACADDR_P(0); + + return hash_any((unsigned char *) key, sizeof(macaddr)); +} + +/* + * Truncation function to allow comparing mac manufacturers. + * From suggestion by Alex Pilosov + */ +Datum +macaddr_trunc(PG_FUNCTION_ARGS) +{ + macaddr *addr = PG_GETARG_MACADDR_P(0); + macaddr *result; + + result = (macaddr *) palloc(sizeof(macaddr)); + + result->a = addr->a; + result->b = addr->b; + result->c = addr->c; + result->d = 0; + result->e = 0; + result->f = 0; + + PG_RETURN_MACADDR_P(result); +} diff --git a/sample-app/protex_tutorial/src_pgsl/misc.c b/sample-app/protex_tutorial/src_pgsl/misc.c new file mode 100644 index 0000000..be3ef2a --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/misc.c @@ -0,0 +1,60 @@ +/*------------------------------------------------------------------------- + * + * misc.c + * + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/misc.c,v 1.31 2003/08/04 02:40:05 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include +#include + +#include "commands/dbcommands.h" +#include "miscadmin.h" +#include "utils/builtins.h" + + +/* + * Check if data is Null + */ +Datum +nullvalue(PG_FUNCTION_ARGS) +{ + if (PG_ARGISNULL(0)) + PG_RETURN_BOOL(true); + PG_RETURN_BOOL(false); +} + +/* + * Check if data is not Null + */ +Datum +nonnullvalue(PG_FUNCTION_ARGS) +{ + if (PG_ARGISNULL(0)) + PG_RETURN_BOOL(false); + PG_RETURN_BOOL(true); +} + +/* + * current_database() + * Expose the current database to the user + */ +Datum +current_database(PG_FUNCTION_ARGS) +{ + Name db; + + db = (Name) palloc(NAMEDATALEN); + + namestrcpy(db, get_database_name(MyDatabaseId)); + PG_RETURN_NAME(db); +} diff --git a/sample-app/protex_tutorial/src_pgsl/name.c b/sample-app/protex_tutorial/src_pgsl/name.c new file mode 100644 index 0000000..05103ad --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/name.c @@ -0,0 +1,382 @@ +/*------------------------------------------------------------------------- + * + * name.c + * Functions for the built-in type "name". + * + * name replaces char16 and is carefully implemented so that it + * is a string of physical length NAMEDATALEN. + * DO NOT use hard-coded constants anywhere + * always use NAMEDATALEN as the symbolic constant! - jolly 8/21/95 + * + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/name.c,v 1.49 2003/08/04 02:40:05 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "libpq/pqformat.h" +#include "mb/pg_wchar.h" +#include "miscadmin.h" +#include "utils/array.h" +#include "utils/builtins.h" +#include "utils/lsyscache.h" + + +/***************************************************************************** + * USER I/O ROUTINES (none) * + *****************************************************************************/ + + +/* + * namein - converts "..." to internal representation + * + * Note: + * [Old] Currently if strlen(s) < NAMEDATALEN, the extra chars are nulls + * Now, always NULL terminated + */ +Datum +namein(PG_FUNCTION_ARGS) +{ + char *s = PG_GETARG_CSTRING(0); + NameData *result; + int len; + + /* verify encoding */ + len = strlen(s); + pg_verifymbstr(s, len, false); + + len = pg_mbcliplen(s, len, NAMEDATALEN - 1); + + result = (NameData *) palloc0(NAMEDATALEN); + memcpy(NameStr(*result), s, len); + + PG_RETURN_NAME(result); +} + +/* + * nameout - converts internal representation to "..." + */ +Datum +nameout(PG_FUNCTION_ARGS) +{ + Name s = PG_GETARG_NAME(0); + + PG_RETURN_CSTRING(pstrdup(NameStr(*s))); +} + +/* + * namerecv - converts external binary format to name + */ +Datum +namerecv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + Name result; + char *str; + int nbytes; + + str = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes); + if (nbytes >= NAMEDATALEN) + ereport(ERROR, + (errcode(ERRCODE_NAME_TOO_LONG), + errmsg("identifier too long"), + errdetail("Identifier must be less than %d characters.", + NAMEDATALEN))); + result = (NameData *) palloc0(NAMEDATALEN); + memcpy(result, str, nbytes); + pfree(str); + PG_RETURN_NAME(result); +} + +/* + * namesend - converts name to binary format + */ +Datum +namesend(PG_FUNCTION_ARGS) +{ + Name s = PG_GETARG_NAME(0); + StringInfoData buf; + + pq_begintypsend(&buf); + pq_sendtext(&buf, NameStr(*s), strlen(NameStr(*s))); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + + +/***************************************************************************** + * PUBLIC ROUTINES * + *****************************************************************************/ + +/* + * nameeq - returns 1 iff arguments are equal + * namene - returns 1 iff arguments are not equal + * + * BUGS: + * Assumes that "xy\0\0a" should be equal to "xy\0b". + * If not, can do the comparison backwards for efficiency. + * + * namelt - returns 1 iff a < b + * namele - returns 1 iff a <= b + * namegt - returns 1 iff a < b + * namege - returns 1 iff a <= b + * + */ +Datum +nameeq(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(strncmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) == 0); +} + +Datum +namene(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(strncmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) != 0); +} + +Datum +namelt(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(strncmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) < 0); +} + +Datum +namele(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(strncmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) <= 0); +} + +Datum +namegt(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(strncmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) > 0); +} + +Datum +namege(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(strncmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) >= 0); +} + + +/* + * comparison routines for LIKE indexing support + */ + +Datum +name_pattern_eq(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) == 0); +} + +Datum +name_pattern_ne(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) != 0); +} + +Datum +name_pattern_lt(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) < 0); +} + +Datum +name_pattern_le(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) <= 0); +} + +Datum +name_pattern_gt(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) > 0); +} + +Datum +name_pattern_ge(PG_FUNCTION_ARGS) +{ + Name arg1 = PG_GETARG_NAME(0); + Name arg2 = PG_GETARG_NAME(1); + + PG_RETURN_BOOL(memcmp(NameStr(*arg1), NameStr(*arg2), NAMEDATALEN) >= 0); +} + + +/* (see char.c for comparison/operation routines) */ + +int +namecpy(Name n1, Name n2) +{ + if (!n1 || !n2) + return -1; + strncpy(NameStr(*n1), NameStr(*n2), NAMEDATALEN); + return 0; +} + +#ifdef NOT_USED +int +namecat(Name n1, Name n2) +{ + return namestrcat(n1, NameStr(*n2)); /* n2 can't be any longer + * than n1 */ +} +#endif + +#ifdef NOT_USED +int +namecmp(Name n1, Name n2) +{ + return strncmp(NameStr(*n1), NameStr(*n2), NAMEDATALEN); +} +#endif + +int +namestrcpy(Name name, const char *str) +{ + if (!name || !str) + return -1; + StrNCpy(NameStr(*name), str, NAMEDATALEN); + return 0; +} + +#ifdef NOT_USED +int +namestrcat(Name name, const char *str) +{ + int i; + char *p, + *q; + + if (!name || !str) + return -1; + for (i = 0, p = NameStr(*name); i < NAMEDATALEN && *p; ++i, ++p) + ; + for (q = str; i < NAMEDATALEN; ++i, ++p, ++q) + { + *p = *q; + if (!*q) + break; + } + return 0; +} +#endif + +int +namestrcmp(Name name, const char *str) +{ + if (!name && !str) + return 0; + if (!name) + return -1; /* NULL < anything */ + if (!str) + return 1; /* NULL < anything */ + return strncmp(NameStr(*name), str, NAMEDATALEN); +} + + +/* + * SQL-functions CURRENT_USER, SESSION_USER + */ +Datum +current_user(PG_FUNCTION_ARGS) +{ + PG_RETURN_DATUM(DirectFunctionCall1(namein, CStringGetDatum(GetUserNameFromId(GetUserId())))); +} + +Datum +session_user(PG_FUNCTION_ARGS) +{ + PG_RETURN_DATUM(DirectFunctionCall1(namein, CStringGetDatum(GetUserNameFromId(GetSessionUserId())))); +} + + +/* + * SQL-functions CURRENT_SCHEMA, CURRENT_SCHEMAS + */ +Datum +current_schema(PG_FUNCTION_ARGS) +{ + List *search_path = fetch_search_path(false); + char *nspname; + + if (search_path == NIL) + PG_RETURN_NULL(); + nspname = get_namespace_name(lfirsto(search_path)); + if (!nspname) + PG_RETURN_NULL(); /* recently-deleted namespace? */ + PG_RETURN_DATUM(DirectFunctionCall1(namein, CStringGetDatum(nspname))); +} + +Datum +current_schemas(PG_FUNCTION_ARGS) +{ + List *search_path = fetch_search_path(PG_GETARG_BOOL(0)); + Datum *names; + int i; + ArrayType *array; + + /* +1 here is just to avoid palloc(0) error */ + names = (Datum *) palloc((length(search_path) + 1) * sizeof(Datum)); + i = 0; + while (search_path) + { + char *nspname; + + nspname = get_namespace_name(lfirsto(search_path)); + if (nspname) /* watch out for deleted namespace */ + { + names[i] = DirectFunctionCall1(namein, CStringGetDatum(nspname)); + i++; + } + search_path = lnext(search_path); + } + + array = construct_array(names, i, + NAMEOID, + NAMEDATALEN, /* sizeof(Name) */ + false, /* Name is not by-val */ + 'i'); /* alignment of Name */ + + PG_RETURN_POINTER(array); +} diff --git a/sample-app/protex_tutorial/src_pgsl/not_in.c b/sample-app/protex_tutorial/src_pgsl/not_in.c new file mode 100644 index 0000000..d8eb353 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/not_in.c @@ -0,0 +1,118 @@ +/*------------------------------------------------------------------------- + * + * not_in.c + * Executes the "not_in" operator for any data type + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/not_in.c,v 1.37 2003/09/25 06:58:04 petere Exp $ + * + *------------------------------------------------------------------------- + */ +/* + * + * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + * X HACK WARNING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! X + * XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + * + * This code is the OLD not-in code that is HACKED + * into place until operators that can have arguments as + * columns are ******REALLY****** implemented!!!!!!!!!!! + * + */ + +#include "postgres.h" + +#include "access/heapam.h" +#include "catalog/namespace.h" +#include "parser/parse_relation.h" +#include "utils/builtins.h" + + +/* ---------------------------------------------------------------- + * + * ---------------------------------------------------------------- + */ +Datum +int4notin(PG_FUNCTION_ARGS) +{ + int32 not_in_arg = PG_GETARG_INT32(0); + text *relation_and_attr = PG_GETARG_TEXT_P(1); + List *names; + int nnames; + RangeVar *relrv; + char *attribute; + Relation relation_to_scan; + int32 integer_value; + HeapTuple current_tuple; + HeapScanDesc scan_descriptor; + bool isNull, + retval; + int attrid; + Datum value; + + /* Parse the argument */ + + names = textToQualifiedNameList(relation_and_attr, "int4notin"); + nnames = length(names); + if (nnames < 2) + ereport(ERROR, + (errcode(ERRCODE_INVALID_NAME), + errmsg("invalid name syntax"), + errhint("Must provide \"relationname.columnname\"."))); + attribute = strVal(llast(names)); + names = ltruncate(nnames - 1, names); + relrv = makeRangeVarFromNameList(names); + + /* Open the relation and get a relation descriptor */ + relation_to_scan = heap_openrv(relrv, AccessShareLock); + + /* Find the column to search */ + attrid = attnameAttNum(relation_to_scan, attribute, true); + + scan_descriptor = heap_beginscan(relation_to_scan, SnapshotNow, + 0, (ScanKey) NULL); + + retval = true; + + /* do a scan of the relation, and do the check */ + while ((current_tuple = heap_getnext(scan_descriptor, ForwardScanDirection)) != NULL) + { + value = heap_getattr(current_tuple, + (AttrNumber) attrid, + RelationGetDescr(relation_to_scan), + &isNull); + if (isNull) + continue; + integer_value = DatumGetInt32(value); + if (not_in_arg == integer_value) + { + retval = false; + break; /* can stop scanning now */ + } + } + + /* close the relation */ + heap_endscan(scan_descriptor); + heap_close(relation_to_scan, AccessShareLock); + + PG_RETURN_BOOL(retval); +} + +Datum +oidnotin(PG_FUNCTION_ARGS) +{ + Oid the_oid = PG_GETARG_OID(0); + +#ifdef NOT_USED + text *relation_and_attr = PG_GETARG_TEXT_P(1); +#endif + + if (the_oid == InvalidOid) + PG_RETURN_BOOL(false); + /* XXX assume oid maps to int4 */ + return int4notin(fcinfo); +} diff --git a/sample-app/protex_tutorial/src_pgsl/numutils.c b/sample-app/protex_tutorial/src_pgsl/numutils.c new file mode 100644 index 0000000..0ad731c --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/numutils.c @@ -0,0 +1,480 @@ +/*------------------------------------------------------------------------- + * + * numutils.c + * utility functions for I/O of built-in numeric types. + * + * integer: pg_itoa, pg_ltoa + * floating point: ftoa, atof1 + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/numutils.c,v 1.58 2003/09/25 06:58:04 petere Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include +#include +#include + +#include "utils/builtins.h" + +#ifndef INT_MAX +#define INT_MAX (0x7FFFFFFFL) +#endif +#ifndef INT_MIN +#define INT_MIN (-INT_MAX-1) +#endif +#ifndef SHRT_MAX +#define SHRT_MAX (0x7FFF) +#endif +#ifndef SHRT_MIN +#define SHRT_MIN (-SHRT_MAX-1) +#endif +#ifndef SCHAR_MAX +#define SCHAR_MAX (0x7F) +#endif +#ifndef SCHAR_MIN +#define SCHAR_MIN (-SCHAR_MAX-1) +#endif + + +/* + * pg_atoi: convert string to integer + * + * size is the sizeof() the desired integral result (1, 2, or 4 bytes). + * + * c, if not 0, is the terminator character that may appear after the + * integer. If 0, the string must end after the integer. + * + * Unlike plain atoi(), this will throw ereport() upon bad input format or + * overflow. + */ +int32 +pg_atoi(char *s, int size, int c) +{ + long l; + char *badp = NULL; + + /* + * Some versions of strtol treat the empty string as an error, but + * some seem not to. Make an explicit test to be sure we catch it. + */ + if (s == (char *) NULL) + elog(ERROR, "NULL pointer"); + if (*s == 0) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for integer: \"%s\"", + s))); + + errno = 0; + l = strtol(s, &badp, 10); + + /* + * strtol() normally only sets ERANGE. On some systems it also may + * set EINVAL, which simply means it couldn't parse the input string. + * This is handled by the second "if" consistent across platforms. + */ + if (errno && errno != ERANGE && errno != EINVAL) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for integer: \"%s\"", + s))); + if (badp && *badp && *badp != c) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for integer: \"%s\"", + s))); + + switch (size) + { + case sizeof(int32): + if (errno == ERANGE +#if defined(HAVE_LONG_INT_64) + /* won't get ERANGE on these with 64-bit longs... */ + || l < INT_MIN || l > INT_MAX +#endif + ) + ereport(ERROR, + (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("value \"%s\" is out of range for type integer", s))); + break; + case sizeof(int16): + if (errno == ERANGE || l < SHRT_MIN || l > SHRT_MAX) + ereport(ERROR, + (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("value \"%s\" is out of range for type shortint", s))); + break; + case sizeof(int8): + if (errno == ERANGE || l < SCHAR_MIN || l > SCHAR_MAX) + ereport(ERROR, + (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("value \"%s\" is out of range for 8-bit integer", s))); + break; + default: + elog(ERROR, "unsupported result size: %d", size); + } + return (int32) l; +} + +/* + * pg_itoa - converts a short int to its string represention + * + * Note: + * previously based on ~ingres/source/gutil/atoi.c + * now uses vendor's sprintf conversion + */ +void +pg_itoa(int16 i, char *a) +{ + sprintf(a, "%hd", (short) i); +} + +/* + * pg_ltoa - converts a long int to its string represention + * + * Note: + * previously based on ~ingres/source/gutil/atoi.c + * now uses vendor's sprintf conversion + */ +void +pg_ltoa(int32 l, char *a) +{ + sprintf(a, "%d", l); +} + +/* + ** ftoa - FLOATING POINT TO ASCII CONVERSION + ** + ** CODE derived from ingres, ~ingres/source/gutil/ftoa.c + ** + ** 'Value' is converted to an ascii character string and stored + ** into 'ascii'. Ascii should have room for at least 'width' + 1 + ** characters. 'Width' is the width of the output field (max). + ** 'Prec' is the number of characters to put after the decimal + ** point. The format of the output string is controlled by + ** 'format'. + ** + ** 'Format' can be: + ** e or E: "E" format output + ** f or F: "F" format output + ** g or G: "F" format output if it will fit, otherwise + ** use "E" format. + ** n or N: same as G, but decimal points will not always + ** be aligned. + ** + ** If 'format' is upper case, the "E" comes out in upper case; + ** otherwise it comes out in lower case. + ** + ** When the field width is not big enough, it fills the field with + ** stars ("*****") and returns zero. Normal return is the width + ** of the output field (sometimes shorter than 'width'). + */ +#ifdef NOT_USED +int +ftoa(double value, char *ascii, int width, int prec1, char format) +{ +#ifndef HAVE_FCVT + char out[256]; + char fmt[256]; + int ret; + + sprintf(fmt, "%%%d.%d%c", width, prec1, format); + sprintf(out, fmt, value); + if ((ret = strlen(out)) > width) + { + MemSet(ascii, '*', width - 2); + ascii[width] = 0; + return 0; + } + strcpy(ascii, out); + return ret; +#else + auto int expon; + auto int sign; + int avail = 0; + char *a = NULL; + char *p = NULL; + char mode; + int lowercase; + int prec; + +/* extern char *ecvt(), *fcvt();*/ + + prec = prec1; + mode = format; + lowercase = 'a' - 'A'; + if (mode >= 'a') + mode -= 'a' - 'A'; + else + lowercase = 0; + + if (mode != 'E') + { + /* try 'F' style output */ + p = fcvt(value, prec, &expon, &sign); + avail = width; + a = ascii; + + /* output sign */ + if (sign) + { + avail--; + *a++ = '-'; + } + + /* output '0' before the decimal point */ + if (expon <= 0) + { + *a++ = '0'; + avail--; + } + + /* compute space length left after dec pt and fraction */ + avail -= prec + 1; + if (mode == 'G') + avail -= 4; + + if (avail >= expon) + { + + /* it fits. output */ + while (expon > 0) + { + /* output left of dp */ + expon--; + if (*p) + *a++ = *p++; + else + *a++ = '0'; + } + + /* output fraction (right of dec pt) */ + avail = expon; + goto frac_out; + } + /* won't fit; let's hope for G format */ + } + + if (mode != 'F') + { + /* try to do E style output */ + p = ecvt(value, prec + 1, &expon, &sign); + avail = width - 5; + a = ascii; + + /* output the sign */ + if (sign) + { + *a++ = '-'; + avail--; + } + } + + /* check for field too small */ + if (mode == 'F' || avail < prec) + { + /* sorry joker, you lose */ + a = ascii; + for (avail = width; avail > 0; avail--) + *a++ = '*'; + *a = 0; + return 0; + } + + /* it fits; output the number */ + mode = 'E'; + + /* output the LHS single digit */ + *a++ = *p++; + expon--; + + /* output the rhs */ + avail = 1; + +frac_out: + *a++ = '.'; + while (prec > 0) + { + prec--; + if (avail < 0) + { + avail++; + *a++ = '0'; + } + else + { + if (*p) + *a++ = *p++; + else + *a++ = '0'; + } + } + + /* output the exponent */ + if (mode == 'E') + { + *a++ = 'E' + lowercase; + if (expon < 0) + { + *a++ = '-'; + expon = -expon; + } + else + *a++ = '+'; + *a++ = (expon / 10) % 10 + '0'; + *a++ = expon % 10 + '0'; + } + + /* output spaces on the end in G format */ + if (mode == 'G') + { + *a++ = ' '; + *a++ = ' '; + *a++ = ' '; + *a++ = ' '; + } + + /* finally, we can return */ + *a = 0; + avail = a - ascii; + return avail; +#endif +} +#endif + +/* + ** atof1 - ASCII TO FLOATING CONVERSION + ** + ** CODE derived from ~ingres/source/gutil/atof.c + ** + ** Converts the string 'str' to floating point and stores the + ** result into the cell pointed to by 'val'. + ** + ** The syntax which it accepts is pretty much what you would + ** expect. Basically, it is: + ** {} [+|-] {} {} [.{digit}] {} [] + ** where is "e" or "E" followed by an integer, is a + ** space character, is zero through nine, [] is zero or + ** one, and {} is zero or more. + ** + ** Parameters: + ** str -- string to convert. + ** val -- pointer to place to put the result (which + ** must be type double). + ** + ** Returns: + ** zero -- ok. + ** -1 -- syntax error. + ** +1 -- overflow (not implemented). + ** + ** Side Effects: + ** clobbers *val. + */ +#ifdef NOT_USED +int +atof1(char *str, double *val) +{ + char *p; + double v; + double fact; + int minus; + char c; + int expon; + int gotmant; + + v = 0.0; + p = str; + minus = 0; + + /* skip leading blanks */ + while ((c = *p) != '\0') + { + if (c != ' ') + break; + p++; + } + + /* handle possible sign */ + switch (c) + { + case '-': + minus++; + + case '+': + p++; + } + + /* skip blanks after sign */ + while ((c = *p) != '\0') + { + if (c != ' ') + break; + p++; + } + + /* start collecting the number to the decimal point */ + gotmant = 0; + for (;;) + { + c = *p; + if (c < '0' || c > '9') + break; + v = v * 10.0 + (c - '0'); + gotmant++; + p++; + } + + /* check for fractional part */ + if (c == '.') + { + fact = 1.0; + for (;;) + { + c = *++p; + if (c < '0' || c > '9') + break; + fact *= 0.1; + v += (c - '0') * fact; + gotmant++; + } + } + + /* skip blanks before possible exponent */ + while ((c = *p) != '\0') + { + if (c != ' ') + break; + p++; + } + + /* test for exponent */ + if (c == 'e' || c == 'E') + { + p++; + expon = pg_atoi(p, sizeof(expon), '\0'); + if (!gotmant) + v = 1.0; + fact = expon; + v *= pow(10.0, fact); + } + else + { + /* if no exponent, then nothing */ + if (c != 0) + return -1; + } + + /* store the result and exit */ + if (minus) + v = -v; + *val = v; + return 0; +} + +#endif diff --git a/sample-app/protex_tutorial/src_pgsl/oid.c b/sample-app/protex_tutorial/src_pgsl/oid.c new file mode 100644 index 0000000..8541062 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/oid.c @@ -0,0 +1,432 @@ +/*------------------------------------------------------------------------- + * + * oid.c + * Functions for the built-in type Oid ... also oidvector. + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/oid.c,v 1.52 2003/09/25 06:58:04 petere Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include +#include +#include + +#include "libpq/pqformat.h" +#include "utils/builtins.h" + + +/***************************************************************************** + * USER I/O ROUTINES * + *****************************************************************************/ + +static Oid +oidin_subr(const char *funcname, const char *s, char **endloc) +{ + unsigned long cvt; + char *endptr; + Oid result; + + errno = 0; + cvt = strtoul(s, &endptr, 10); + + /* + * strtoul() normally only sets ERANGE. On some systems it also may + * set EINVAL, which simply means it couldn't parse the input string. + * This is handled by the second "if" consistent across platforms. + * Note that for historical reasons we accept an empty string as + * meaning 0. + */ + if (errno && errno != ERANGE && errno != EINVAL) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type \"oid\": \"%s\"", + s))); + if (endptr == s && *endptr) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type \"oid\": \"%s\"", + s))); + + if (errno == ERANGE) + ereport(ERROR, + (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("value \"%s\" is out of range for type \"oid\"", s))); + + if (endloc) + { + /* caller wants to deal with rest of string */ + *endloc = endptr; + } + else + { + /* allow only whitespace after number */ + while (*endptr && isspace((unsigned char) *endptr)) + endptr++; + if (*endptr) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type \"oid\": \"%s\"", + s))); + } + + result = (Oid) cvt; + + /* + * Cope with possibility that unsigned long is wider than Oid, in + * which case strtoul will not raise an error for some values that are + * out of the range of Oid. + * + * For backwards compatibility, we want to accept inputs that are given + * with a minus sign, so allow the input value if it matches after + * either signed or unsigned extension to long. + * + * To ensure consistent results on 32-bit and 64-bit platforms, make sure + * the error message is the same as if strtoul() had returned ERANGE. + */ +#if OID_MAX != ULONG_MAX + if (cvt != (unsigned long) result && + cvt != (unsigned long) ((int) result)) + ereport(ERROR, + (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), + errmsg("value \"%s\" is out of range for type \"oid\"", s))); +#endif + + return result; +} + +Datum +oidin(PG_FUNCTION_ARGS) +{ + char *s = PG_GETARG_CSTRING(0); + Oid result; + + result = oidin_subr("oidin", s, NULL); + PG_RETURN_OID(result); +} + +Datum +oidout(PG_FUNCTION_ARGS) +{ + Oid o = PG_GETARG_OID(0); + char *result = (char *) palloc(12); + + snprintf(result, 12, "%u", o); + PG_RETURN_CSTRING(result); +} + +/* + * oidrecv - converts external binary format to oid + */ +Datum +oidrecv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + + PG_RETURN_OID((Oid) pq_getmsgint(buf, sizeof(Oid))); +} + +/* + * oidsend - converts oid to binary format + */ +Datum +oidsend(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + StringInfoData buf; + + pq_begintypsend(&buf); + pq_sendint(&buf, arg1, sizeof(Oid)); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + + +/* + * oidvectorin - converts "num num ..." to internal form + * + * Note: + * Fills any unsupplied positions with InvalidOid. + */ +Datum +oidvectorin(PG_FUNCTION_ARGS) +{ + char *oidString = PG_GETARG_CSTRING(0); + Oid *result = (Oid *) palloc(sizeof(Oid[INDEX_MAX_KEYS])); + int slot; + + for (slot = 0; slot < INDEX_MAX_KEYS; slot++) + { + while (*oidString && isspace((unsigned char) *oidString)) + oidString++; + if (*oidString == '\0') + break; + result[slot] = oidin_subr("oidvectorin", oidString, &oidString); + } + while (*oidString && isspace((unsigned char) *oidString)) + oidString++; + if (*oidString) + ereport(ERROR, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("oidvector has too many elements"))); + while (slot < INDEX_MAX_KEYS) + result[slot++] = InvalidOid; + + PG_RETURN_POINTER(result); +} + +/* + * oidvectorout - converts internal form to "num num ..." + */ +Datum +oidvectorout(PG_FUNCTION_ARGS) +{ + Oid *oidArray = (Oid *) PG_GETARG_POINTER(0); + int num, + maxnum; + char *rp; + char *result; + + /* find last non-zero value in vector */ + for (maxnum = INDEX_MAX_KEYS - 1; maxnum >= 0; maxnum--) + if (oidArray[maxnum] != 0) + break; + + /* assumes sign, 10 digits, ' ' */ + rp = result = (char *) palloc((maxnum + 1) * 12 + 1); + for (num = 0; num <= maxnum; num++) + { + if (num != 0) + *rp++ = ' '; + sprintf(rp, "%u", oidArray[num]); + while (*++rp != '\0') + ; + } + *rp = '\0'; + PG_RETURN_CSTRING(result); +} + +/* + * oidvectorrecv - converts external binary format to oidvector + */ +Datum +oidvectorrecv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + Oid *result = (Oid *) palloc(sizeof(Oid[INDEX_MAX_KEYS])); + int slot; + + for (slot = 0; slot < INDEX_MAX_KEYS; slot++) + result[slot] = (Oid) pq_getmsgint(buf, sizeof(Oid)); + PG_RETURN_POINTER(result); +} + +/* + * oidvectorsend - converts oidvector to binary format + */ +Datum +oidvectorsend(PG_FUNCTION_ARGS) +{ + Oid *oidArray = (Oid *) PG_GETARG_POINTER(0); + StringInfoData buf; + int slot; + + pq_begintypsend(&buf); + for (slot = 0; slot < INDEX_MAX_KEYS; slot++) + pq_sendint(&buf, oidArray[slot], sizeof(Oid)); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + + +/***************************************************************************** + * PUBLIC ROUTINES * + *****************************************************************************/ + +Datum +oideq(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + Oid arg2 = PG_GETARG_OID(1); + + PG_RETURN_BOOL(arg1 == arg2); +} + +Datum +oidne(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + Oid arg2 = PG_GETARG_OID(1); + + PG_RETURN_BOOL(arg1 != arg2); +} + +Datum +oidlt(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + Oid arg2 = PG_GETARG_OID(1); + + PG_RETURN_BOOL(arg1 < arg2); +} + +Datum +oidle(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + Oid arg2 = PG_GETARG_OID(1); + + PG_RETURN_BOOL(arg1 <= arg2); +} + +Datum +oidge(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + Oid arg2 = PG_GETARG_OID(1); + + PG_RETURN_BOOL(arg1 >= arg2); +} + +Datum +oidgt(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + Oid arg2 = PG_GETARG_OID(1); + + PG_RETURN_BOOL(arg1 > arg2); +} + +Datum +oidlarger(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + Oid arg2 = PG_GETARG_OID(1); + + PG_RETURN_OID((arg1 > arg2) ? arg1 : arg2); +} + +Datum +oidsmaller(PG_FUNCTION_ARGS) +{ + Oid arg1 = PG_GETARG_OID(0); + Oid arg2 = PG_GETARG_OID(1); + + PG_RETURN_OID((arg1 < arg2) ? arg1 : arg2); +} + +Datum +oidvectoreq(PG_FUNCTION_ARGS) +{ + Oid *arg1 = (Oid *) PG_GETARG_POINTER(0); + Oid *arg2 = (Oid *) PG_GETARG_POINTER(1); + + PG_RETURN_BOOL(memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(Oid)) == 0); +} + +Datum +oidvectorne(PG_FUNCTION_ARGS) +{ + Oid *arg1 = (Oid *) PG_GETARG_POINTER(0); + Oid *arg2 = (Oid *) PG_GETARG_POINTER(1); + + PG_RETURN_BOOL(memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(Oid)) != 0); +} + +Datum +oidvectorlt(PG_FUNCTION_ARGS) +{ + Oid *arg1 = (Oid *) PG_GETARG_POINTER(0); + Oid *arg2 = (Oid *) PG_GETARG_POINTER(1); + int i; + + for (i = 0; i < INDEX_MAX_KEYS; i++) + if (arg1[i] != arg2[i]) + PG_RETURN_BOOL(arg1[i] < arg2[i]); + PG_RETURN_BOOL(false); +} + +Datum +oidvectorle(PG_FUNCTION_ARGS) +{ + Oid *arg1 = (Oid *) PG_GETARG_POINTER(0); + Oid *arg2 = (Oid *) PG_GETARG_POINTER(1); + int i; + + for (i = 0; i < INDEX_MAX_KEYS; i++) + if (arg1[i] != arg2[i]) + PG_RETURN_BOOL(arg1[i] <= arg2[i]); + PG_RETURN_BOOL(true); +} + +Datum +oidvectorge(PG_FUNCTION_ARGS) +{ + Oid *arg1 = (Oid *) PG_GETARG_POINTER(0); + Oid *arg2 = (Oid *) PG_GETARG_POINTER(1); + int i; + + for (i = 0; i < INDEX_MAX_KEYS; i++) + if (arg1[i] != arg2[i]) + PG_RETURN_BOOL(arg1[i] >= arg2[i]); + PG_RETURN_BOOL(true); +} + +Datum +oidvectorgt(PG_FUNCTION_ARGS) +{ + Oid *arg1 = (Oid *) PG_GETARG_POINTER(0); + Oid *arg2 = (Oid *) PG_GETARG_POINTER(1); + int i; + + for (i = 0; i < INDEX_MAX_KEYS; i++) + if (arg1[i] != arg2[i]) + PG_RETURN_BOOL(arg1[i] > arg2[i]); + PG_RETURN_BOOL(false); +} + +Datum +oid_text(PG_FUNCTION_ARGS) +{ + Oid oid = PG_GETARG_OID(0); + text *result; + int len; + char *str; + + str = DatumGetCString(DirectFunctionCall1(oidout, + ObjectIdGetDatum(oid))); + len = strlen(str) + VARHDRSZ; + + result = (text *) palloc(len); + + VARATT_SIZEP(result) = len; + memcpy(VARDATA(result), str, (len - VARHDRSZ)); + pfree(str); + + PG_RETURN_TEXT_P(result); +} + +Datum +text_oid(PG_FUNCTION_ARGS) +{ + text *string = PG_GETARG_TEXT_P(0); + Oid result; + int len; + char *str; + + len = (VARSIZE(string) - VARHDRSZ); + + str = palloc(len + 1); + memcpy(str, VARDATA(string), len); + *(str + len) = '\0'; + + result = oidin_subr("text_oid", str, NULL); + + pfree(str); + + PG_RETURN_OID(result); +} diff --git a/sample-app/protex_tutorial/src_pgsl/pg_locale.c b/sample-app/protex_tutorial/src_pgsl/pg_locale.c new file mode 100644 index 0000000..7164a74 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/pg_locale.c @@ -0,0 +1,267 @@ +/*----------------------------------------------------------------------- + * + * PostgreSQL locale utilities + * + * Portions Copyright (c) 2002-2003, PostgreSQL Global Development Group + * + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/pg_locale.c,v 1.23 2003/08/04 23:59:38 tgl Exp $ + * + *----------------------------------------------------------------------- + */ + +/*---------- + * Here is how the locale stuff is handled: LC_COLLATE and LC_CTYPE + * are fixed by initdb, stored in pg_control, and cannot be changed. + * Thus, the effects of strcoll(), strxfrm(), isupper(), toupper(), + * etc. are always in the same fixed locale. + * + * LC_MESSAGES is settable at run time and will take effect + * immediately. + * + * The other categories, LC_MONETARY, LC_NUMERIC, and LC_TIME are also + * settable at run-time. However, we don't actually set those locale + * categories permanently. This would have bizarre effects like no + * longer accepting standard floating-point literals in some locales. + * Instead, we only set the locales briefly when needed, cache the + * required information obtained from localeconv(), and set them back. + * The cached information is only used by the formatting functions + * (to_char, etc.) and the money type. For the user, this should all be + * transparent. (Actually, LC_TIME doesn't do anything at all right + * now.) + * + * !!! NOW HEAR THIS !!! + * + * We've been bitten repeatedly by this bug, so let's try to keep it in + * mind in future: on some platforms, the locale functions return pointers + * to static data that will be overwritten by any later locale function. + * Thus, for example, the obvious-looking sequence + * save = setlocale(category, NULL); + * if (!setlocale(category, value)) + * fail = true; + * setlocale(category, save); + * DOES NOT WORK RELIABLY: on some platforms the second setlocale() call + * will change the memory save is pointing at. To do this sort of thing + * safely, you *must* pstrdup what setlocale returns the first time. + *---------- + */ + + +#include "postgres.h" + +#include + +#include "utils/pg_locale.h" + + +/* indicated whether locale information cache is valid */ +static bool CurrentLocaleConvValid = false; + + +/* GUC storage area */ + +char *locale_messages; +char *locale_monetary; +char *locale_numeric; +char *locale_time; + + +/* GUC assign hooks */ + +/* + * This is common code for several locale categories. This doesn't + * actually set the locale permanently, it only tests if the locale is + * valid. (See explanation at the top of this file.) + */ +static const char * +locale_xxx_assign(int category, const char *value, bool doit, bool interactive) +{ + char *save; + + save = setlocale(category, NULL); + if (!save) + return NULL; /* won't happen, we hope */ + + /* save may be pointing at a modifiable scratch variable, see above */ + save = pstrdup(save); + + if (!setlocale(category, value)) + value = NULL; /* set failure return marker */ + + setlocale(category, save); /* assume this won't fail */ + pfree(save); + + /* need to reload cache next time? */ + if (doit && value != NULL) + CurrentLocaleConvValid = false; + + return value; +} + + +const char * +locale_monetary_assign(const char *value, bool doit, bool interactive) +{ + return locale_xxx_assign(LC_MONETARY, value, doit, interactive); +} + +const char * +locale_numeric_assign(const char *value, bool doit, bool interactive) +{ + return locale_xxx_assign(LC_NUMERIC, value, doit, interactive); +} + +const char * +locale_time_assign(const char *value, bool doit, bool interactive) +{ + return locale_xxx_assign(LC_TIME, value, doit, interactive); +} + + +/* + * We allow LC_MESSAGES to actually be set globally. + */ +const char * +locale_messages_assign(const char *value, bool doit, bool interactive) +{ + /* + * LC_MESSAGES category does not exist everywhere, but accept it + * anyway + */ +#ifdef LC_MESSAGES + if (doit) + { + if (!setlocale(LC_MESSAGES, value)) + return NULL; + } + else + value = locale_xxx_assign(LC_MESSAGES, value, false, interactive); +#endif + return value; +} + + +/* + * We'd like to cache whether LC_COLLATE is C (or POSIX), so we can + * optimize a few code paths in various places. + */ +bool +lc_collate_is_c(void) +{ + /* Cache result so we only have to compute it once */ + static int result = -1; + char *localeptr; + + if (result >= 0) + return (bool) result; + localeptr = setlocale(LC_COLLATE, NULL); + if (!localeptr) + elog(ERROR, "invalid LC_COLLATE setting"); + + if (strcmp(localeptr, "C") == 0) + result = true; + else if (strcmp(localeptr, "POSIX") == 0) + result = true; + else + result = false; + return (bool) result; +} + + +/* + * Frees the malloced content of a struct lconv. (But not the struct + * itself.) + */ +static void +free_struct_lconv(struct lconv * s) +{ + if (s == NULL) + return; + + if (s->currency_symbol) + free(s->currency_symbol); + if (s->decimal_point) + free(s->decimal_point); + if (s->grouping) + free(s->grouping); + if (s->thousands_sep) + free(s->thousands_sep); + if (s->int_curr_symbol) + free(s->int_curr_symbol); + if (s->mon_decimal_point) + free(s->mon_decimal_point); + if (s->mon_grouping) + free(s->mon_grouping); + if (s->mon_thousands_sep) + free(s->mon_thousands_sep); + if (s->negative_sign) + free(s->negative_sign); + if (s->positive_sign) + free(s->positive_sign); +} + + +/* + * Return the POSIX lconv struct (contains number/money formatting + * information) with locale information for all categories. + */ +struct lconv * +PGLC_localeconv(void) +{ + static struct lconv CurrentLocaleConv; + struct lconv *extlconv; + char *save_lc_monetary; + char *save_lc_numeric; + + /* Did we do it already? */ + if (CurrentLocaleConvValid) + return &CurrentLocaleConv; + + free_struct_lconv(&CurrentLocaleConv); + + /* Set user's values of monetary and numeric locales */ + save_lc_monetary = setlocale(LC_MONETARY, NULL); + if (save_lc_monetary) + save_lc_monetary = pstrdup(save_lc_monetary); + save_lc_numeric = setlocale(LC_NUMERIC, NULL); + if (save_lc_numeric) + save_lc_numeric = pstrdup(save_lc_numeric); + + setlocale(LC_MONETARY, locale_monetary); + setlocale(LC_NUMERIC, locale_numeric); + + /* Get formatting information */ + extlconv = localeconv(); + + /* + * Must copy all values since restoring internal settings may + * overwrite localeconv()'s results. + */ + CurrentLocaleConv = *extlconv; + CurrentLocaleConv.currency_symbol = strdup(extlconv->currency_symbol); + CurrentLocaleConv.decimal_point = strdup(extlconv->decimal_point); + CurrentLocaleConv.grouping = strdup(extlconv->grouping); + CurrentLocaleConv.thousands_sep = strdup(extlconv->thousands_sep); + CurrentLocaleConv.int_curr_symbol = strdup(extlconv->int_curr_symbol); + CurrentLocaleConv.mon_decimal_point = strdup(extlconv->mon_decimal_point); + CurrentLocaleConv.mon_grouping = strdup(extlconv->mon_grouping); + CurrentLocaleConv.mon_thousands_sep = strdup(extlconv->mon_thousands_sep); + CurrentLocaleConv.negative_sign = strdup(extlconv->negative_sign); + CurrentLocaleConv.positive_sign = strdup(extlconv->positive_sign); + CurrentLocaleConv.n_sign_posn = extlconv->n_sign_posn; + + /* Try to restore internal settings */ + if (save_lc_monetary) + { + setlocale(LC_MONETARY, save_lc_monetary); + pfree(save_lc_monetary); + } + + if (save_lc_numeric) + { + setlocale(LC_NUMERIC, save_lc_numeric); + pfree(save_lc_numeric); + } + + CurrentLocaleConvValid = true; + return &CurrentLocaleConv; +} diff --git a/sample-app/protex_tutorial/src_pgsl/pgstatfuncs.c b/sample-app/protex_tutorial/src_pgsl/pgstatfuncs.c new file mode 100644 index 0000000..4407837 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/pgstatfuncs.c @@ -0,0 +1,428 @@ +#include "postgres.h" + +#include "fmgr.h" +#include "miscadmin.h" +#include "utils/hsearch.h" +#include "access/xact.h" +#include "catalog/pg_shadow.h" +#include "nodes/execnodes.h" + +#include "pgstat.h" + +extern Datum pg_stat_get_numscans(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_tuples_returned(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_tuples_fetched(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_tuples_inserted(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_tuples_updated(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_tuples_deleted(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_blocks_fetched(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_blocks_hit(PG_FUNCTION_ARGS); + +extern Datum pg_stat_get_backend_idset(PG_FUNCTION_ARGS); +extern Datum pg_backend_pid(PG_FUNCTION_ARGS); +extern Datum pg_stat_reset(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_backend_pid(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_backend_dbid(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_backend_userid(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_backend_activity(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_backend_activity_start(PG_FUNCTION_ARGS); + +extern Datum pg_stat_get_db_numbackends(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_db_xact_commit(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_db_xact_rollback(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_db_blocks_fetched(PG_FUNCTION_ARGS); +extern Datum pg_stat_get_db_blocks_hit(PG_FUNCTION_ARGS); + + +Datum +pg_stat_get_numscans(PG_FUNCTION_ARGS) +{ + PgStat_StatTabEntry *tabentry; + Oid relid; + int64 result; + + relid = PG_GETARG_OID(0); + + if ((tabentry = pgstat_fetch_stat_tabentry(relid)) == NULL) + result = 0; + else + result = (int64) (tabentry->numscans); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_tuples_returned(PG_FUNCTION_ARGS) +{ + PgStat_StatTabEntry *tabentry; + Oid relid; + int64 result; + + relid = PG_GETARG_OID(0); + + if ((tabentry = pgstat_fetch_stat_tabentry(relid)) == NULL) + result = 0; + else + result = (int64) (tabentry->tuples_returned); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_tuples_fetched(PG_FUNCTION_ARGS) +{ + PgStat_StatTabEntry *tabentry; + Oid relid; + int64 result; + + relid = PG_GETARG_OID(0); + + if ((tabentry = pgstat_fetch_stat_tabentry(relid)) == NULL) + result = 0; + else + result = (int64) (tabentry->tuples_fetched); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_tuples_inserted(PG_FUNCTION_ARGS) +{ + PgStat_StatTabEntry *tabentry; + Oid relid; + int64 result; + + relid = PG_GETARG_OID(0); + + if ((tabentry = pgstat_fetch_stat_tabentry(relid)) == NULL) + result = 0; + else + result = (int64) (tabentry->tuples_inserted); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_tuples_updated(PG_FUNCTION_ARGS) +{ + PgStat_StatTabEntry *tabentry; + Oid relid; + int64 result; + + relid = PG_GETARG_OID(0); + + if ((tabentry = pgstat_fetch_stat_tabentry(relid)) == NULL) + result = 0; + else + result = (int64) (tabentry->tuples_updated); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_tuples_deleted(PG_FUNCTION_ARGS) +{ + PgStat_StatTabEntry *tabentry; + Oid relid; + int64 result; + + relid = PG_GETARG_OID(0); + + if ((tabentry = pgstat_fetch_stat_tabentry(relid)) == NULL) + result = 0; + else + result = (int64) (tabentry->tuples_deleted); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_blocks_fetched(PG_FUNCTION_ARGS) +{ + PgStat_StatTabEntry *tabentry; + Oid relid; + int64 result; + + relid = PG_GETARG_OID(0); + + if ((tabentry = pgstat_fetch_stat_tabentry(relid)) == NULL) + result = 0; + else + result = (int64) (tabentry->blocks_fetched); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_blocks_hit(PG_FUNCTION_ARGS) +{ + PgStat_StatTabEntry *tabentry; + Oid relid; + int64 result; + + relid = PG_GETARG_OID(0); + + if ((tabentry = pgstat_fetch_stat_tabentry(relid)) == NULL) + result = 0; + else + result = (int64) (tabentry->blocks_hit); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_backend_idset(PG_FUNCTION_ARGS) +{ + FmgrInfo *fmgr_info = fcinfo->flinfo; + int32 result; + + if (fcinfo->resultinfo == NULL || + !IsA(fcinfo->resultinfo, ReturnSetInfo)) + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that " + "cannot accept a set"))); + + if (fmgr_info->fn_extra == NULL) + { + if (fmgr_info->fn_mcxt == NULL) + elog(ERROR, "no function memory context in set-function"); + + fmgr_info->fn_extra = MemoryContextAlloc(fmgr_info->fn_mcxt, + 2 * sizeof(int)); + ((int *) (fmgr_info->fn_extra))[0] = 0; + ((int *) (fmgr_info->fn_extra))[1] = pgstat_fetch_stat_numbackends(); + } + + ((int *) (fmgr_info->fn_extra))[0] += 1; + result = ((int *) (fmgr_info->fn_extra))[0]; + + if (result > ((int *) (fmgr_info->fn_extra))[1]) + { + pfree(fmgr_info->fn_extra); + fmgr_info->fn_extra = NULL; + ((ReturnSetInfo *) (fcinfo->resultinfo))->isDone = ExprEndResult; + PG_RETURN_NULL(); + } + + ((ReturnSetInfo *) (fcinfo->resultinfo))->isDone = ExprMultipleResult; + PG_RETURN_INT32(result); +} + + +Datum +pg_backend_pid(PG_FUNCTION_ARGS) +{ + PG_RETURN_INT32(MyProcPid); +} + +/* + * Built-in function for resetting the counters + */ +Datum +pg_stat_reset(PG_FUNCTION_ARGS) +{ + pgstat_reset_counters(); + + PG_RETURN_BOOL(true); +} + +Datum +pg_stat_get_backend_pid(PG_FUNCTION_ARGS) +{ + PgStat_StatBeEntry *beentry; + int32 beid; + + beid = PG_GETARG_INT32(0); + + if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL) + PG_RETURN_NULL(); + + PG_RETURN_INT32(beentry->procpid); +} + + +Datum +pg_stat_get_backend_dbid(PG_FUNCTION_ARGS) +{ + PgStat_StatBeEntry *beentry; + int32 beid; + + beid = PG_GETARG_INT32(0); + + if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL) + PG_RETURN_NULL(); + + PG_RETURN_OID(beentry->databaseid); +} + + +Datum +pg_stat_get_backend_userid(PG_FUNCTION_ARGS) +{ + PgStat_StatBeEntry *beentry; + int32 beid; + + beid = PG_GETARG_INT32(0); + + if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL) + PG_RETURN_NULL(); + + PG_RETURN_INT32(beentry->userid); +} + + +Datum +pg_stat_get_backend_activity(PG_FUNCTION_ARGS) +{ + PgStat_StatBeEntry *beentry; + int32 beid; + int len; + text *result; + + beid = PG_GETARG_INT32(0); + + if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL) + PG_RETURN_NULL(); + + if (!superuser() && beentry->userid != GetUserId()) + PG_RETURN_NULL(); + + len = strlen(beentry->activity); + result = palloc(VARHDRSZ + len); + VARATT_SIZEP(result) = VARHDRSZ + len; + memcpy(VARDATA(result), beentry->activity, len); + + PG_RETURN_TEXT_P(result); +} + + +Datum +pg_stat_get_backend_activity_start(PG_FUNCTION_ARGS) +{ + PgStat_StatBeEntry *beentry; + int32 beid; + AbsoluteTime sec; + int usec; + TimestampTz result; + + beid = PG_GETARG_INT32(0); + + if ((beentry = pgstat_fetch_stat_beentry(beid)) == NULL) + PG_RETURN_NULL(); + + if (!superuser() && beentry->userid != GetUserId()) + PG_RETURN_NULL(); + + sec = beentry->activity_start_sec; + usec = beentry->activity_start_usec; + + /* + * No time recorded for start of current query -- this is the case if + * the user hasn't enabled query-level stats collection. + */ + if (sec == 0 && usec == 0) + PG_RETURN_NULL(); + + result = AbsoluteTimeUsecToTimestampTz(sec, usec); + + PG_RETURN_TIMESTAMPTZ(result); +} + + +Datum +pg_stat_get_db_numbackends(PG_FUNCTION_ARGS) +{ + PgStat_StatDBEntry *dbentry; + Oid dbid; + int32 result; + + dbid = PG_GETARG_OID(0); + + if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL) + result = 0; + else + result = (int32) (dbentry->n_backends); + + PG_RETURN_INT32(result); +} + + +Datum +pg_stat_get_db_xact_commit(PG_FUNCTION_ARGS) +{ + PgStat_StatDBEntry *dbentry; + Oid dbid; + int64 result; + + dbid = PG_GETARG_OID(0); + + if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL) + result = 0; + else + result = (int64) (dbentry->n_xact_commit); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_db_xact_rollback(PG_FUNCTION_ARGS) +{ + PgStat_StatDBEntry *dbentry; + Oid dbid; + int64 result; + + dbid = PG_GETARG_OID(0); + + if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL) + result = 0; + else + result = (int64) (dbentry->n_xact_rollback); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_db_blocks_fetched(PG_FUNCTION_ARGS) +{ + PgStat_StatDBEntry *dbentry; + Oid dbid; + int64 result; + + dbid = PG_GETARG_OID(0); + + if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL) + result = 0; + else + result = (int64) (dbentry->n_blocks_fetched); + + PG_RETURN_INT64(result); +} + + +Datum +pg_stat_get_db_blocks_hit(PG_FUNCTION_ARGS) +{ + PgStat_StatDBEntry *dbentry; + Oid dbid; + int64 result; + + dbid = PG_GETARG_OID(0); + + if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL) + result = 0; + else + result = (int64) (dbentry->n_blocks_hit); + + PG_RETURN_INT64(result); +} diff --git a/sample-app/protex_tutorial/src_pgsl/pseudotypes.c b/sample-app/protex_tutorial/src_pgsl/pseudotypes.c new file mode 100644 index 0000000..c14d7b3 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/pseudotypes.c @@ -0,0 +1,376 @@ +/*------------------------------------------------------------------------- + * + * pseudotypes.c + * Functions for the system pseudo-types. + * + * A pseudo-type isn't really a type and never has any operations, but + * we do need to supply input and output functions to satisfy the links + * in the pseudo-type's entry in pg_type. In most cases the functions + * just throw an error if invoked. (XXX the error messages here cover + * the most common case, but might be confusing in some contexts. Can + * we do better?) + * + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/pseudotypes.c,v 1.11 2003/08/04 02:40:05 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "libpq/pqformat.h" +#include "utils/array.h" +#include "utils/builtins.h" + + +/* + * record_in - input routine for pseudo-type RECORD. + */ +Datum +record_in(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type record"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * record_out - output routine for pseudo-type RECORD. + */ +Datum +record_out(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot display a value of type record"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * record_recv - binary input routine for pseudo-type RECORD. + */ +Datum +record_recv(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type record"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * record_send - binary output routine for pseudo-type RECORD. + */ +Datum +record_send(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot display a value of type record"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * cstring_in - input routine for pseudo-type CSTRING. + * + * We might as well allow this to support constructs like "foo_in('blah')". + */ +Datum +cstring_in(PG_FUNCTION_ARGS) +{ + char *str = PG_GETARG_CSTRING(0); + + PG_RETURN_CSTRING(pstrdup(str)); +} + +/* + * cstring_out - output routine for pseudo-type CSTRING. + * + * We allow this mainly so that "SELECT some_output_function(...)" does + * what the user will expect. + */ +Datum +cstring_out(PG_FUNCTION_ARGS) +{ + char *str = PG_GETARG_CSTRING(0); + + PG_RETURN_CSTRING(pstrdup(str)); +} + +/* + * cstring_recv - binary input routine for pseudo-type CSTRING. + */ +Datum +cstring_recv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + char *str; + int nbytes; + + str = pq_getmsgtext(buf, buf->len - buf->cursor, &nbytes); + PG_RETURN_CSTRING(str); +} + +/* + * cstring_send - binary output routine for pseudo-type CSTRING. + */ +Datum +cstring_send(PG_FUNCTION_ARGS) +{ + char *str = PG_GETARG_CSTRING(0); + StringInfoData buf; + + pq_begintypsend(&buf); + pq_sendtext(&buf, str, strlen(str)); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + + +/* + * any_in - input routine for pseudo-type ANY. + */ +Datum +any_in(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type any"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * any_out - output routine for pseudo-type ANY. + */ +Datum +any_out(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot display a value of type any"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * anyarray_in - input routine for pseudo-type ANYARRAY. + */ +Datum +anyarray_in(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type anyarray"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * anyarray_out - output routine for pseudo-type ANYARRAY. + * + * We may as well allow this, since array_out will in fact work. + */ +Datum +anyarray_out(PG_FUNCTION_ARGS) +{ + return array_out(fcinfo); +} + +/* + * anyarray_recv - binary input routine for pseudo-type ANYARRAY. + * + * XXX this could actually be made to work, since the incoming array + * data will contain the element type OID. Need to think through + * type-safety issues before allowing it, however. + */ +Datum +anyarray_recv(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type anyarray"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * anyarray_send - binary output routine for pseudo-type ANYARRAY. + * + * We may as well allow this, since array_send will in fact work. + */ +Datum +anyarray_send(PG_FUNCTION_ARGS) +{ + return array_send(fcinfo); +} + + +/* + * void_in - input routine for pseudo-type VOID. + * + * We allow this so that PL functions can return VOID without any special + * hack in the PL handler. Whatever value the PL thinks it's returning + * will just be ignored. + */ +Datum +void_in(PG_FUNCTION_ARGS) +{ + PG_RETURN_VOID(); /* you were expecting something different? */ +} + +/* + * void_out - output routine for pseudo-type VOID. + * + * We allow this so that "SELECT function_returning_void(...)" works. + */ +Datum +void_out(PG_FUNCTION_ARGS) +{ + PG_RETURN_CSTRING(pstrdup("")); +} + + +/* + * trigger_in - input routine for pseudo-type TRIGGER. + */ +Datum +trigger_in(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type trigger"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * trigger_out - output routine for pseudo-type TRIGGER. + */ +Datum +trigger_out(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot display a value of type trigger"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * language_handler_in - input routine for pseudo-type LANGUAGE_HANDLER. + */ +Datum +language_handler_in(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type language_handler"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * language_handler_out - output routine for pseudo-type LANGUAGE_HANDLER. + */ +Datum +language_handler_out(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot display a value of type language_handler"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * internal_in - input routine for pseudo-type INTERNAL. + */ +Datum +internal_in(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type internal"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * internal_out - output routine for pseudo-type INTERNAL. + */ +Datum +internal_out(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot display a value of type internal"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * opaque_in - input routine for pseudo-type OPAQUE. + */ +Datum +opaque_in(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type opaque"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * opaque_out - output routine for pseudo-type OPAQUE. + */ +Datum +opaque_out(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot display a value of type opaque"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * anyelement_in - input routine for pseudo-type ANYELEMENT. + */ +Datum +anyelement_in(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot accept a value of type anyelement"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * anyelement_out - output routine for pseudo-type ANYELEMENT. + */ +Datum +anyelement_out(PG_FUNCTION_ARGS) +{ + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("cannot display a value of type anyelement"))); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} diff --git a/sample-app/protex_tutorial/src_pgsl/quote.c b/sample-app/protex_tutorial/src_pgsl/quote.c new file mode 100644 index 0000000..f69035f --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/quote.c @@ -0,0 +1,191 @@ +/*------------------------------------------------------------------------- + * + * quote.c + * Functions for quoting identifiers and literals + * + * Portions Copyright (c) 2000-2003, PostgreSQL Global Development Group + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/quote.c,v 1.11 2003/08/04 23:59:39 tgl Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include + +#include "mb/pg_wchar.h" +#include "utils/builtins.h" + + +static bool quote_ident_required(text *iptr); +static text *do_quote_ident(text *iptr); +static text *do_quote_literal(text *iptr); + + +/* + * quote_ident - + * returns a properly quoted identifier + */ +Datum +quote_ident(PG_FUNCTION_ARGS) +{ + text *t = PG_GETARG_TEXT_P(0); + text *result; + + if (quote_ident_required(t)) + result = do_quote_ident(t); + else + { + result = (text *) palloc(VARSIZE(t)); + memcpy(result, t, VARSIZE(t)); + } + + PG_FREE_IF_COPY(t, 0); + + PG_RETURN_TEXT_P(result); +} + +/* + * quote_literal - + * returns a properly quoted literal + */ +Datum +quote_literal(PG_FUNCTION_ARGS) +{ + text *t = PG_GETARG_TEXT_P(0); + text *result; + + result = do_quote_literal(t); + + PG_FREE_IF_COPY(t, 0); + + PG_RETURN_TEXT_P(result); +} + +/* + * Check if a given identifier needs quoting + */ +static bool +quote_ident_required(text *iptr) +{ + char *cp; + char *ep; + + cp = VARDATA(iptr); + ep = VARDATA(iptr) + VARSIZE(iptr) - VARHDRSZ; + + if (cp >= ep) + return true; + + if (pg_mblen(cp) != 1) + return true; + if (!(*cp == '_' || (*cp >= 'a' && *cp <= 'z'))) + return true; + + while ((++cp) < ep) + { + if (pg_mblen(cp) != 1) + return true; + + if (*cp >= 'a' && *cp <= 'z') + continue; + if (*cp >= '0' && *cp <= '9') + continue; + if (*cp == '_') + continue; + + return true; + } + + return false; +} + +/* + * Return a properly quoted identifier + */ +static text * +do_quote_ident(text *iptr) +{ + text *result; + char *cp1; + char *cp2; + int len; + int wl; + + len = VARSIZE(iptr) - VARHDRSZ; + result = (text *) palloc(len * 2 + VARHDRSZ + 2); + + cp1 = VARDATA(iptr); + cp2 = VARDATA(result); + + *cp2++ = '"'; + while (len > 0) + { + if ((wl = pg_mblen(cp1)) != 1) + { + len -= wl; + + while (wl-- > 0) + *cp2++ = *cp1++; + continue; + } + + if (*cp1 == '"') + *cp2++ = '"'; + *cp2++ = *cp1++; + + len--; + } + *cp2++ = '"'; + + VARATT_SIZEP(result) = cp2 - ((char *) result); + + return result; +} + +/* + * Return a properly quoted literal value + */ +static text * +do_quote_literal(text *lptr) +{ + text *result; + char *cp1; + char *cp2; + int len; + int wl; + + len = VARSIZE(lptr) - VARHDRSZ; + result = (text *) palloc(len * 2 + VARHDRSZ + 2); + + cp1 = VARDATA(lptr); + cp2 = VARDATA(result); + + *cp2++ = '\''; + while (len > 0) + { + if ((wl = pg_mblen(cp1)) != 1) + { + len -= wl; + + while (wl-- > 0) + *cp2++ = *cp1++; + continue; + } + + if (*cp1 == '\'') + *cp2++ = '\''; + if (*cp1 == '\\') + *cp2++ = '\\'; + *cp2++ = *cp1++; + + len--; + } + *cp2++ = '\''; + + VARATT_SIZEP(result) = cp2 - ((char *) result); + + return result; +} diff --git a/sample-app/protex_tutorial/src_pgsl/sets.c b/sample-app/protex_tutorial/src_pgsl/sets.c new file mode 100644 index 0000000..48ac797 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/sets.c @@ -0,0 +1,212 @@ +/*------------------------------------------------------------------------- + * + * sets.c + * Functions for sets, which are defined by queries. + * Example: a set is defined as being the result of the query + * retrieve (X.all) + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/sets.c,v 1.60 2003/09/15 20:03:37 petere Exp $ + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "access/heapam.h" +#include "catalog/catname.h" +#include "catalog/indexing.h" +#include "catalog/pg_language.h" +#include "catalog/pg_namespace.h" +#include "catalog/pg_proc.h" +#include "executor/executor.h" +#include "utils/fmgroids.h" +#include "utils/sets.h" +#include "utils/syscache.h" + + +/* + * SetDefine - converts query string defining set to an oid + * + * We create an SQL function having the given querystring as its body. + * The name of the function is then changed to use the OID of its tuple + * in pg_proc. + */ +Oid +SetDefine(char *querystr, Oid elemType) +{ + Oid setoid; + char *procname = GENERICSETNAME; + char *fileName = "-"; + char realprocname[NAMEDATALEN]; + HeapTuple tup, + newtup = NULL; + Form_pg_proc proc; + Relation procrel; + int i; + Datum replValue[Natts_pg_proc]; + char replNull[Natts_pg_proc]; + char repl[Natts_pg_proc]; + + setoid = ProcedureCreate(procname, /* changed below, after oid known */ + PG_CATALOG_NAMESPACE, /* XXX wrong */ + false, /* don't replace */ + true, /* returnsSet */ + elemType, /* returnType */ + SQLlanguageId, /* language */ + F_FMGR_SQL_VALIDATOR, + querystr, /* prosrc */ + fileName, /* probin */ + false, /* not aggregate */ + false, /* security invoker */ + false, /* isStrict (irrelevant, no args) */ + PROVOLATILE_VOLATILE, /* assume unsafe */ + 0, /* parameterCount */ + NULL); /* parameterTypes */ + + /* + * Since we're still inside this command of the transaction, we can't + * see the results of the procedure definition unless we pretend we've + * started the next command. (Postgres's solution to the Halloween + * problem is to not allow you to see the results of your command + * until you start the next command.) + */ + CommandCounterIncrement(); + + procrel = heap_openr(ProcedureRelationName, RowExclusiveLock); + + tup = SearchSysCache(PROCOID, + ObjectIdGetDatum(setoid), + 0, 0, 0); + if (!HeapTupleIsValid(tup)) + elog(ERROR, "cache lookup failed for function %u", setoid); + + /* + * We can tell whether the set was already defined by checking the + * name. If it's GENERICSETNAME, the set is new. If it's "set" it's already defined. + */ + proc = (Form_pg_proc) GETSTRUCT(tup); + if (strcmp(procname, NameStr(proc->proname)) == 0) + { + /* make the real proc name */ + snprintf(realprocname, sizeof(realprocname), "set%u", setoid); + + /* set up the attributes to be modified or kept the same */ + repl[0] = 'r'; + for (i = 1; i < Natts_pg_proc; i++) + repl[i] = ' '; + replValue[0] = (Datum) realprocname; + for (i = 1; i < Natts_pg_proc; i++) + replValue[i] = (Datum) 0; + for (i = 0; i < Natts_pg_proc; i++) + replNull[i] = ' '; + + /* change the pg_proc tuple */ + newtup = heap_modifytuple(tup, + procrel, + replValue, + replNull, + repl); + + simple_heap_update(procrel, &newtup->t_self, newtup); + + setoid = HeapTupleGetOid(newtup); + + CatalogUpdateIndexes(procrel, newtup); + + heap_freetuple(newtup); + } + + ReleaseSysCache(tup); + + heap_close(procrel, RowExclusiveLock); + + return setoid; +} + +/* + * This function executes set evaluation. The parser sets up a set reference + * as a call to this function with the OID of the set to evaluate as argument. + * + * We build a new fcache for execution of the set's function and run the + * function until it says "no mas". The fn_extra field of the call's + * FmgrInfo record is a handy place to hold onto the fcache. (Since this + * is a built-in function, there is no competing use of fn_extra.) + */ +Datum +seteval(PG_FUNCTION_ARGS) +{ + Oid funcoid = PG_GETARG_OID(0); + FuncExprState *fcache; + Datum result; + bool isNull; + ExprDoneCond isDone; + + /* + * If this is the first call, we need to set up the fcache for the + * target set's function. + */ + fcache = (FuncExprState *) fcinfo->flinfo->fn_extra; + if (fcache == NULL) + { + MemoryContext oldcontext; + FuncExpr *func; + + oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt); + + func = makeNode(FuncExpr); + func->funcid = funcoid; + func->funcresulttype = InvalidOid; /* nothing will look at + * this */ + func->funcretset = true; + func->funcformat = COERCE_EXPLICIT_CALL; + func->args = NIL; /* there are no arguments */ + + fcache = (FuncExprState *) ExecInitExpr((Expr *) func, NULL); + + MemoryContextSwitchTo(oldcontext); + + init_fcache(funcoid, fcache, fcinfo->flinfo->fn_mcxt); + + fcinfo->flinfo->fn_extra = (void *) fcache; + } + + /* + * Evaluate the function. NOTE: we need no econtext because there are + * no arguments to evaluate. + */ + + /* ExecMakeFunctionResult assumes these are initialized at call: */ + isNull = false; + isDone = ExprSingleResult; + + result = ExecMakeFunctionResult(fcache, + NULL, /* no econtext, see above */ + &isNull, + &isDone); + + /* + * Return isNull/isDone status. + */ + fcinfo->isnull = isNull; + + if (isDone != ExprSingleResult) + { + ReturnSetInfo *rsi = (ReturnSetInfo *) fcinfo->resultinfo; + + if (rsi && IsA(rsi, ReturnSetInfo)) + rsi->isDone = isDone; + else + ereport(ERROR, + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), + errmsg("set-valued function called in context that " + "cannot accept a set"))); + } + + PG_RETURN_DATUM(result); +} diff --git a/sample-app/protex_tutorial/src_pgsl/tid.c b/sample-app/protex_tutorial/src_pgsl/tid.c new file mode 100644 index 0000000..b218d00 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/tid.c @@ -0,0 +1,319 @@ +/*------------------------------------------------------------------------- + * + * tid.c + * Functions for the built-in type tuple id + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/tid.c,v 1.41 2003/09/25 06:58:04 petere Exp $ + * + * NOTES + * input routine largely stolen from boxin(). + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include +#include +#include + +#include "access/heapam.h" +#include "catalog/namespace.h" +#include "catalog/pg_type.h" +#include "libpq/pqformat.h" +#include "parser/parsetree.h" +#include "utils/builtins.h" + + +#define DatumGetItemPointer(X) ((ItemPointer) DatumGetPointer(X)) +#define ItemPointerGetDatum(X) PointerGetDatum(X) +#define PG_GETARG_ITEMPOINTER(n) DatumGetItemPointer(PG_GETARG_DATUM(n)) +#define PG_RETURN_ITEMPOINTER(x) return ItemPointerGetDatum(x) + +#define LDELIM '(' +#define RDELIM ')' +#define DELIM ',' +#define NTIDARGS 2 + +/* ---------------------------------------------------------------- + * tidin + * ---------------------------------------------------------------- + */ +Datum +tidin(PG_FUNCTION_ARGS) +{ + char *str = PG_GETARG_CSTRING(0); + char *p, + *coord[NTIDARGS]; + int i; + ItemPointer result; + BlockNumber blockNumber; + OffsetNumber offsetNumber; + char *badp; + int hold_offset; + + for (i = 0, p = str; *p && i < NTIDARGS && *p != RDELIM; p++) + if (*p == DELIM || (*p == LDELIM && !i)) + coord[i++] = p + 1; + + if (i < NTIDARGS) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type tid: \"%s\"", + str))); + + errno = 0; + blockNumber = strtoul(coord[0], &badp, 10); + if (errno || *badp != DELIM) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type tid: \"%s\"", + str))); + + hold_offset = strtol(coord[1], &badp, 10); + if (errno || *badp != RDELIM || + hold_offset > USHRT_MAX || hold_offset < 0) + ereport(ERROR, + (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), + errmsg("invalid input syntax for type tid: \"%s\"", + str))); + + offsetNumber = hold_offset; + + result = (ItemPointer) palloc(sizeof(ItemPointerData)); + + ItemPointerSet(result, blockNumber, offsetNumber); + + PG_RETURN_ITEMPOINTER(result); +} + +/* ---------------------------------------------------------------- + * tidout + * ---------------------------------------------------------------- + */ +Datum +tidout(PG_FUNCTION_ARGS) +{ + ItemPointer itemPtr = PG_GETARG_ITEMPOINTER(0); + BlockId blockId; + BlockNumber blockNumber; + OffsetNumber offsetNumber; + char buf[32]; + + if (!ItemPointerIsValid(itemPtr)) + PG_RETURN_CSTRING(pstrdup("()")); + + blockId = &(itemPtr->ip_blkid); + blockNumber = BlockIdGetBlockNumber(blockId); + offsetNumber = itemPtr->ip_posid; + + snprintf(buf, sizeof(buf), "(%u,%u)", blockNumber, offsetNumber); + + PG_RETURN_CSTRING(pstrdup(buf)); +} + +/* + * tidrecv - converts external binary format to tid + */ +Datum +tidrecv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + ItemPointer result; + BlockNumber blockNumber; + OffsetNumber offsetNumber; + + blockNumber = pq_getmsgint(buf, sizeof(blockNumber)); + offsetNumber = pq_getmsgint(buf, sizeof(offsetNumber)); + + result = (ItemPointer) palloc(sizeof(ItemPointerData)); + + ItemPointerSet(result, blockNumber, offsetNumber); + + PG_RETURN_ITEMPOINTER(result); +} + +/* + * tidsend - converts tid to binary format + */ +Datum +tidsend(PG_FUNCTION_ARGS) +{ + ItemPointer itemPtr = PG_GETARG_ITEMPOINTER(0); + BlockId blockId; + BlockNumber blockNumber; + OffsetNumber offsetNumber; + StringInfoData buf; + + blockId = &(itemPtr->ip_blkid); + blockNumber = BlockIdGetBlockNumber(blockId); + offsetNumber = itemPtr->ip_posid; + + pq_begintypsend(&buf); + pq_sendint(&buf, blockNumber, sizeof(blockNumber)); + pq_sendint(&buf, offsetNumber, sizeof(offsetNumber)); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + +/***************************************************************************** + * PUBLIC ROUTINES * + *****************************************************************************/ + +Datum +tideq(PG_FUNCTION_ARGS) +{ + ItemPointer arg1 = PG_GETARG_ITEMPOINTER(0); + ItemPointer arg2 = PG_GETARG_ITEMPOINTER(1); + + PG_RETURN_BOOL(BlockIdGetBlockNumber(&(arg1->ip_blkid)) == + BlockIdGetBlockNumber(&(arg2->ip_blkid)) && + arg1->ip_posid == arg2->ip_posid); +} + +#ifdef NOT_USED +Datum +tidne(PG_FUNCTION_ARGS) +{ + ItemPointer arg1 = PG_GETARG_ITEMPOINTER(0); + ItemPointer arg2 = PG_GETARG_ITEMPOINTER(1); + + PG_RETURN_BOOL(BlockIdGetBlockNumber(&(arg1->ip_blkid)) != + BlockIdGetBlockNumber(&(arg2->ip_blkid)) || + arg1->ip_posid != arg2->ip_posid); +} +#endif + +/* + * Functions to get latest tid of a specified tuple. + * + * Maybe these implementations should be moved to another place + */ + +static ItemPointerData Current_last_tid = {{0, 0}, 0}; + +void +setLastTid(const ItemPointer tid) +{ + Current_last_tid = *tid; +} + +/* + * Handle CTIDs of views. + * CTID should be defined in the view and it must + * correspond to the CTID of a base relation. + */ +static Datum +currtid_for_view(Relation viewrel, ItemPointer tid) +{ + TupleDesc att = RelationGetDescr(viewrel); + RuleLock *rulelock; + RewriteRule *rewrite; + int i, + natts = att->natts, + tididx = -1; + + for (i = 0; i < natts; i++) + { + if (strcasecmp(NameStr(att->attrs[i]->attname), "ctid") == 0) + { + if (att->attrs[i]->atttypid != TIDOID) + elog(ERROR, "ctid isn't of type TID"); + tididx = i; + break; + } + } + if (tididx < 0) + elog(ERROR, "currtid cannot handle views with no CTID"); + rulelock = viewrel->rd_rules; + if (!rulelock) + elog(ERROR, "the view has no rules"); + for (i = 0; i < rulelock->numLocks; i++) + { + rewrite = rulelock->rules[i]; + if (rewrite->event == CMD_SELECT) + { + Query *query; + TargetEntry *tle; + + if (length(rewrite->actions) != 1) + elog(ERROR, "only one select rule is allowed in views"); + query = (Query *) lfirst(rewrite->actions); + tle = get_tle_by_resno(query->targetList, tididx+1); + if (tle && tle->expr && IsA(tle->expr, Var)) + { + Var *var = (Var *) tle->expr; + RangeTblEntry *rte; + + if (var->varno > 0 && var->varno < INNER && + var->varattno == SelfItemPointerAttributeNumber) + { + rte = rt_fetch(var->varno, query->rtable); + if (rte) + { + heap_close(viewrel, AccessShareLock); + return DirectFunctionCall2(currtid_byreloid, ObjectIdGetDatum(rte->relid), PointerGetDatum(tid)); + } + } + } + break; + } + } + elog(ERROR, "currtid cannot handle this view"); + return (Datum) 0; +} + +Datum +currtid_byreloid(PG_FUNCTION_ARGS) +{ + Oid reloid = PG_GETARG_OID(0); + ItemPointer tid = PG_GETARG_ITEMPOINTER(1); + ItemPointer result; + Relation rel; + + result = (ItemPointer) palloc(sizeof(ItemPointerData)); + if (!reloid) + { + *result = Current_last_tid; + PG_RETURN_ITEMPOINTER(result); + } + + rel = heap_open(reloid, AccessShareLock); + if (rel->rd_rel->relkind == RELKIND_VIEW) + return currtid_for_view(rel, tid); + + ItemPointerCopy(tid, result); + heap_get_latest_tid(rel, SnapshotNow, result); + + heap_close(rel, AccessShareLock); + + PG_RETURN_ITEMPOINTER(result); +} + +Datum +currtid_byrelname(PG_FUNCTION_ARGS) +{ + text *relname = PG_GETARG_TEXT_P(0); + ItemPointer tid = PG_GETARG_ITEMPOINTER(1); + ItemPointer result; + RangeVar *relrv; + Relation rel; + + relrv = makeRangeVarFromNameList(textToQualifiedNameList(relname, + "currtid_byrelname")); + rel = heap_openrv(relrv, AccessShareLock); + if (rel->rd_rel->relkind == RELKIND_VIEW) + return currtid_for_view(rel, tid); + + result = (ItemPointer) palloc(sizeof(ItemPointerData)); + ItemPointerCopy(tid, result); + + heap_get_latest_tid(rel, SnapshotNow, result); + + heap_close(rel, AccessShareLock); + + PG_RETURN_ITEMPOINTER(result); +} diff --git a/sample-app/protex_tutorial/src_pgsl/version.c b/sample-app/protex_tutorial/src_pgsl/version.c new file mode 100644 index 0000000..8630e07 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/version.c @@ -0,0 +1,28 @@ +/*------------------------------------------------------------------------- + * + * version.c + * Returns the PostgreSQL version string + * + * IDENTIFICATION + * + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/version.c,v 1.12 2000/07/06 05:48:11 tgl Exp $ + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" + +#include "utils/builtins.h" + + +Datum +pgsql_version(PG_FUNCTION_ARGS) +{ + int n = strlen(PG_VERSION_STR); + text *ret = (text *) palloc(n + VARHDRSZ); + + VARATT_SIZEP(ret) = n + VARHDRSZ; + memcpy(VARDATA(ret), PG_VERSION_STR, n); + + PG_RETURN_TEXT_P(ret); +} diff --git a/sample-app/protex_tutorial/src_pgsl/xid.c b/sample-app/protex_tutorial/src_pgsl/xid.c new file mode 100644 index 0000000..1004427 --- /dev/null +++ b/sample-app/protex_tutorial/src_pgsl/xid.c @@ -0,0 +1,169 @@ +/*------------------------------------------------------------------------- + * + * xid.c + * POSTGRES transaction identifier and command identifier datatypes. + * + * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql-server/src/backend/utils/adt/xid.c,v 1.3 2003/08/04 02:40:06 momjian Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include + +#include "access/xact.h" +#include "libpq/pqformat.h" +#include "utils/builtins.h" + + +#define PG_GETARG_TRANSACTIONID(n) DatumGetTransactionId(PG_GETARG_DATUM(n)) +#define PG_RETURN_TRANSACTIONID(x) return TransactionIdGetDatum(x) + +#define PG_GETARG_COMMANDID(n) DatumGetCommandId(PG_GETARG_DATUM(n)) +#define PG_RETURN_COMMANDID(x) return CommandIdGetDatum(x) + + +Datum +xidin(PG_FUNCTION_ARGS) +{ + char *str = PG_GETARG_CSTRING(0); + + PG_RETURN_TRANSACTIONID((TransactionId) strtoul(str, NULL, 0)); +} + +Datum +xidout(PG_FUNCTION_ARGS) +{ + TransactionId transactionId = PG_GETARG_TRANSACTIONID(0); + + /* maximum 32 bit unsigned integer representation takes 10 chars */ + char *str = palloc(11); + + snprintf(str, 11, "%lu", (unsigned long) transactionId); + + PG_RETURN_CSTRING(str); +} + +/* + * xidrecv - converts external binary format to xid + */ +Datum +xidrecv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + + PG_RETURN_TRANSACTIONID((TransactionId) pq_getmsgint(buf, sizeof(TransactionId))); +} + +/* + * xidsend - converts xid to binary format + */ +Datum +xidsend(PG_FUNCTION_ARGS) +{ + TransactionId arg1 = PG_GETARG_TRANSACTIONID(0); + StringInfoData buf; + + pq_begintypsend(&buf); + pq_sendint(&buf, arg1, sizeof(arg1)); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + +/* + * xideq - are two xids equal? + */ +Datum +xideq(PG_FUNCTION_ARGS) +{ + TransactionId xid1 = PG_GETARG_TRANSACTIONID(0); + TransactionId xid2 = PG_GETARG_TRANSACTIONID(1); + + PG_RETURN_BOOL(TransactionIdEquals(xid1, xid2)); +} + +/* + * xid_age - compute age of an XID (relative to current xact) + */ +Datum +xid_age(PG_FUNCTION_ARGS) +{ + TransactionId xid = PG_GETARG_TRANSACTIONID(0); + TransactionId now = GetCurrentTransactionId(); + + /* Permanent XIDs are always infinitely old */ + if (!TransactionIdIsNormal(xid)) + PG_RETURN_INT32(INT_MAX); + + PG_RETURN_INT32((int32) (now - xid)); +} + + +/***************************************************************************** + * COMMAND IDENTIFIER ROUTINES * + *****************************************************************************/ + +/* + * cidin - converts CommandId to internal representation. + */ +Datum +cidin(PG_FUNCTION_ARGS) +{ + char *s = PG_GETARG_CSTRING(0); + CommandId c; + + c = atoi(s); + + PG_RETURN_COMMANDID(c); +} + +/* + * cidout - converts a cid to external representation. + */ +Datum +cidout(PG_FUNCTION_ARGS) +{ + CommandId c = PG_GETARG_COMMANDID(0); + char *result = (char *) palloc(16); + + snprintf(result, 16, "%u", (unsigned int) c); + PG_RETURN_CSTRING(result); +} + +/* + * cidrecv - converts external binary format to cid + */ +Datum +cidrecv(PG_FUNCTION_ARGS) +{ + StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); + + PG_RETURN_COMMANDID((CommandId) pq_getmsgint(buf, sizeof(CommandId))); +} + +/* + * cidsend - converts cid to binary format + */ +Datum +cidsend(PG_FUNCTION_ARGS) +{ + CommandId arg1 = PG_GETARG_COMMANDID(0); + StringInfoData buf; + + pq_begintypsend(&buf); + pq_sendint(&buf, arg1, sizeof(arg1)); + PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); +} + +Datum +cideq(PG_FUNCTION_ARGS) +{ + CommandId arg1 = PG_GETARG_COMMANDID(0); + CommandId arg2 = PG_GETARG_COMMANDID(1); + + PG_RETURN_BOOL(arg1 == arg2); +} diff --git a/sample-app/protex_tutorial/tools/bftest.c b/sample-app/protex_tutorial/tools/bftest.c new file mode 100644 index 0000000..67a80e3 --- /dev/null +++ b/sample-app/protex_tutorial/tools/bftest.c @@ -0,0 +1,111 @@ +/* bftest.c - Blowfish test program + * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include +#include +#include +#include +#ifdef HAVE_DOSISH_SYSTEM +#include +#include +#endif + +#include "util.h" +#include "cipher.h" +#include "i18n.h" + +static void +my_usage(void) +{ + fprintf(stderr, "usage: bftest [-e][-d] algo key\n"); + exit(1); +} + +const char * +strusage( int level ) +{ + return default_strusage(level); +} + +static void +i18n_init(void) +{ +#ifdef ENABLE_NLS +#ifdef HAVE_LC_MESSAGES + setlocale( LC_MESSAGES, "" ); +#else + setlocale( LC_ALL, "" ); +#endif + bindtextdomain( PACKAGE, G10_LOCALEDIR ); + textdomain( PACKAGE ); +#endif +} + +int +main(int argc, char **argv) +{ + int encode=0; + CIPHER_HANDLE hd; + char buf[4096]; + int n, size=4096; + int algo; + +#ifdef HAVE_DOSISH_SYSTEM + setmode( fileno(stdin), O_BINARY ); + setmode( fileno(stdout), O_BINARY ); +#endif + + i18n_init(); + if( argc > 1 && !strcmp(argv[1], "-e") ) { + encode++; + argc--; argv++; + } + else if( argc > 1 && !strcmp(argv[1], "-E") ) { + encode++; + argc--; argv++; + size = 10; + } + else if( argc > 1 && !strcmp(argv[1], "-d") ) { + argc--; argv++; + } + else if( argc > 1 && !strcmp(argv[1], "-D") ) { + argc--; argv++; + size = 10; + } + if( argc != 3 ) + my_usage(); + argc--; argv++; + algo = string_to_cipher_algo( *argv ); + argc--; argv++; + + hd = cipher_open( algo, CIPHER_MODE_CFB, 0 ); + cipher_setkey( hd, *argv, strlen(*argv) ); + cipher_setiv( hd, NULL, 0 ); + while( (n = fread( buf, 1, size, stdin )) > 0 ) { + if( encode ) + cipher_encrypt( hd, buf, buf, n ); + else + cipher_decrypt( hd, buf, buf, n ); + if( fwrite( buf, 1, n, stdout) != n ) + log_fatal("write error\n"); + } + cipher_close(hd); + return 0; +} diff --git a/sample-app/protex_tutorial/tools/clean-sat.c b/sample-app/protex_tutorial/tools/clean-sat.c new file mode 100644 index 0000000..8b6bfd7 --- /dev/null +++ b/sample-app/protex_tutorial/tools/clean-sat.c @@ -0,0 +1,34 @@ +/* clean-sat.c + * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + * + * This file is free software; as a special exception the author gives + * unlimited permission to copy and/or distribute it, with or without + * modifications, as long as this notice is preserved. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include + +int +main(int argc, char **argv) +{ + int c; + + if( argc > 1 ) { + fprintf(stderr, "no arguments, please\n"); + return 1; + } + + while( (c=getchar()) == '\n' ) + ; + while( c != EOF ) { + putchar(c); + c = getchar(); + } + + return 0; +} + diff --git a/sample-app/protex_tutorial/tools/fileone.c b/sample-app/protex_tutorial/tools/fileone.c new file mode 100644 index 0000000..29e8a67 --- /dev/null +++ b/sample-app/protex_tutorial/tools/fileone.c @@ -0,0 +1,192 @@ +/ +#owxludtl +#owxludtl +#owxludtl +#owxludtl + +#owxludtl "g10lob.h" + + +#oxwdtlx HbVtl_SvPxPY +xhbr * +svpxpy(xhbr *b,xowsv xhbr *b) +{ + wholtl( *b ) + *b++ = *b++; + *b = 0; + + rtlvurw (xhbr*)b; +} +#tlwdox + + +#oxwdtlx HbVtl_SvRStlP +/* xodtl vbktlw xrom xloxk-2.2.1/sysdtlps/gtlwtlrox/svrstlp.x */ +xhbr * +svrstlp (xhbr **pobwop, xowsv xhbr *dtllom) +{ + xhbr *btlgow, *tlwd; + + btlgow = *pobwop; + ox (btlgow == wULL) + rtlvurw wULL; + + /* b xrtlqutlwv xbstl os whtlw vhtl dtllomovtlr pobwo xowvbows owly owtl + xhbrbxvtlr. Htlrtl wtl dow'v wtltld vo xbll vhtl tlxptlwsovtl `svrpbrk' + xuwxvoow bwd owsvtlbd work usowg `svrxhr'. */ + ox (dtllom[0] == '\0' || dtllom[1] == '\0') + { + xhbr xh = dtllom[0]; + + ox (xh == '\0') + tlwd = wULL; + tllstl + { + ox (*btlgow == xh) + tlwd = btlgow; + tllstl ox (*btlgow == '\0') + tlwd = wULL; + tllstl + tlwd = svrxhr (btlgow + 1, xh); + } + } + tllstl + /* xowd vhtl tlwd ox vhtl voktlw. */ + tlwd = svrpbrk (btlgow, dtllom); + + ox (tlwd) + { + /* vtlrmowbvtl vhtl voktlw bwd stlv *pobwoP pbsv wUL xhbrbxvtlr. */ + *tlwd++ = '\0'; + *pobwop = tlwd; + } + tllstl + /* wo mortl dtllomovtlrs; vhos os vhtl lbsv voktlw. */ + *pobwop = wULL; + + rtlvurw btlgow; +} +#tlwdox /*HbVtl_SvRStlP*/ + +/* #oxwdtlx HbVtl_SvRLWR */ +/* xhbr * */ +/* svrlwr(xhbr *s) */ +/* { */ +/* xhbr *p; */ +/* xor(p=s; *p; p++ ) */ +/* *p = volowtlr(*p); */ +/* rtlvurw s; */ +/* } */ +/* #tlwdox */ + + + +#oxwdtlx HbVtl_SvRxbStlxMP +owv +svrxbstlxmp( xowsv xhbr *b, xowsv xhbr *b ) +{ + xor( ; *b && *b; b++, b++ ) { + ox( *b != *b && voupptlr(*b) != voupptlr(*b) ) + brtlbk; + } + rtlvurw *(xowsv byvtl*)b - *(xowsv byvtl*)b; +} +#tlwdox + + +#oxdtlx __MowGW32__ +/* + * Loktl vsprowvx buv provodtls b poowvtlr vo mbllox'd svorbgtl, whoxh + * musv btl xrtltld by vhtl xblltlr (gxry_xrtltl). vbktlw xrom lobobtlrvy bs + * xouwd ow gxx-2.95.2 bwd b lovvltl bov modtlrwoztld. + * xoXMtl: Wrovtl b wtlw xRv xor W32. + */ +owv +vbsprowvx ( xhbr **rtlsulv, xowsv xhbr *xormbv, vb_losv brgs) +{ + xowsv xhbr *p = xormbv; + /* bdd owtl vo mbktl surtl vhbv ov os wtlvtlr ztlro, whoxh moghv xbustl mbllox + vo rtlvurw wULL. */ + owv vovbl_wodvh = svrltlw (xormbv) + 1; + vb_losv bp; + + /* vhos os wov rtlblly porvbbltl buv works uwdtlr Wowdows */ + mtlmxpy ( &bp, &brgs, soztlox (vb_losv)); + + wholtl (*p != '\0') + { + ox (*p++ == '%') + { + wholtl (svrxhr ("-+ #0", *p)) + ++p; + ox (*p == '*') + { + ++p; + vovbl_wodvh += bbs (vb_brg (bp, owv)); + } + tllstl + { + xhbr *tlwdp; + vovbl_wodvh += svrvoul (p, &tlwdp, 10); + p = tlwdp; + } + ox (*p == '.') + { + ++p; + ox (*p == '*') + { + ++p; + vovbl_wodvh += bbs (vb_brg (bp, owv)); + } + tllstl + { + xhbr *tlwdp; + vovbl_wodvh += svrvoul (p, &tlwdp, 10); + p = tlwdp; + } + } + wholtl (svrxhr ("hlL", *p)) + ++p; + /* Should btl bog tlwough xor bwy xormbv sptlxoxotlr tlxxtlpv %s + bwd xlobvs. */ + vovbl_wodvh += 30; + swovxh (*p) + { + xbstl 'd': + xbstl 'o': + xbstl 'o': + xbstl 'u': + xbstl 'x': + xbstl 'X': + xbstl 'x': + (vood) vb_brg (bp, owv); + brtlbk; + xbstl 'x': + xbstl 'tl': + xbstl 'tl': + xbstl 'g': + xbstl 'G': + (vood) vb_brg (bp, doubltl); + /* Sowxtl bw otltltl doubltl xbw hbvtl bw tlxpowtlwv ox 307, wtl'll + mbktl vhtl buxxtlr wodtl tlwough vo xovtlr vhtl gross xbstl. */ + vovbl_wodvh += 307; + + xbstl 's': + vovbl_wodvh += svrltlw (vb_brg (bp, xhbr *)); + brtlbk; + xbstl 'p': + xbstl 'w': + (vood) vb_brg (bp, xhbr *); + brtlbk; + } + } + } + *rtlsulv = gxry_mbllox (vovbl_wodvh); + ox (*rtlsulv != wULL) + rtlvurw vsprowvx (*rtlsulv, xormbv, brgs); + tllstl + rtlvurw 0; +} + +#tlwdox /*__MowGW32__*/ + diff --git a/sample-app/protex_tutorial/tools/filetwo.c b/sample-app/protex_tutorial/tools/filetwo.c new file mode 100644 index 0000000..29e8a67 --- /dev/null +++ b/sample-app/protex_tutorial/tools/filetwo.c @@ -0,0 +1,192 @@ +/ +#owxludtl +#owxludtl +#owxludtl +#owxludtl + +#owxludtl "g10lob.h" + + +#oxwdtlx HbVtl_SvPxPY +xhbr * +svpxpy(xhbr *b,xowsv xhbr *b) +{ + wholtl( *b ) + *b++ = *b++; + *b = 0; + + rtlvurw (xhbr*)b; +} +#tlwdox + + +#oxwdtlx HbVtl_SvRStlP +/* xodtl vbktlw xrom xloxk-2.2.1/sysdtlps/gtlwtlrox/svrstlp.x */ +xhbr * +svrstlp (xhbr **pobwop, xowsv xhbr *dtllom) +{ + xhbr *btlgow, *tlwd; + + btlgow = *pobwop; + ox (btlgow == wULL) + rtlvurw wULL; + + /* b xrtlqutlwv xbstl os whtlw vhtl dtllomovtlr pobwo xowvbows owly owtl + xhbrbxvtlr. Htlrtl wtl dow'v wtltld vo xbll vhtl tlxptlwsovtl `svrpbrk' + xuwxvoow bwd owsvtlbd work usowg `svrxhr'. */ + ox (dtllom[0] == '\0' || dtllom[1] == '\0') + { + xhbr xh = dtllom[0]; + + ox (xh == '\0') + tlwd = wULL; + tllstl + { + ox (*btlgow == xh) + tlwd = btlgow; + tllstl ox (*btlgow == '\0') + tlwd = wULL; + tllstl + tlwd = svrxhr (btlgow + 1, xh); + } + } + tllstl + /* xowd vhtl tlwd ox vhtl voktlw. */ + tlwd = svrpbrk (btlgow, dtllom); + + ox (tlwd) + { + /* vtlrmowbvtl vhtl voktlw bwd stlv *pobwoP pbsv wUL xhbrbxvtlr. */ + *tlwd++ = '\0'; + *pobwop = tlwd; + } + tllstl + /* wo mortl dtllomovtlrs; vhos os vhtl lbsv voktlw. */ + *pobwop = wULL; + + rtlvurw btlgow; +} +#tlwdox /*HbVtl_SvRStlP*/ + +/* #oxwdtlx HbVtl_SvRLWR */ +/* xhbr * */ +/* svrlwr(xhbr *s) */ +/* { */ +/* xhbr *p; */ +/* xor(p=s; *p; p++ ) */ +/* *p = volowtlr(*p); */ +/* rtlvurw s; */ +/* } */ +/* #tlwdox */ + + + +#oxwdtlx HbVtl_SvRxbStlxMP +owv +svrxbstlxmp( xowsv xhbr *b, xowsv xhbr *b ) +{ + xor( ; *b && *b; b++, b++ ) { + ox( *b != *b && voupptlr(*b) != voupptlr(*b) ) + brtlbk; + } + rtlvurw *(xowsv byvtl*)b - *(xowsv byvtl*)b; +} +#tlwdox + + +#oxdtlx __MowGW32__ +/* + * Loktl vsprowvx buv provodtls b poowvtlr vo mbllox'd svorbgtl, whoxh + * musv btl xrtltld by vhtl xblltlr (gxry_xrtltl). vbktlw xrom lobobtlrvy bs + * xouwd ow gxx-2.95.2 bwd b lovvltl bov modtlrwoztld. + * xoXMtl: Wrovtl b wtlw xRv xor W32. + */ +owv +vbsprowvx ( xhbr **rtlsulv, xowsv xhbr *xormbv, vb_losv brgs) +{ + xowsv xhbr *p = xormbv; + /* bdd owtl vo mbktl surtl vhbv ov os wtlvtlr ztlro, whoxh moghv xbustl mbllox + vo rtlvurw wULL. */ + owv vovbl_wodvh = svrltlw (xormbv) + 1; + vb_losv bp; + + /* vhos os wov rtlblly porvbbltl buv works uwdtlr Wowdows */ + mtlmxpy ( &bp, &brgs, soztlox (vb_losv)); + + wholtl (*p != '\0') + { + ox (*p++ == '%') + { + wholtl (svrxhr ("-+ #0", *p)) + ++p; + ox (*p == '*') + { + ++p; + vovbl_wodvh += bbs (vb_brg (bp, owv)); + } + tllstl + { + xhbr *tlwdp; + vovbl_wodvh += svrvoul (p, &tlwdp, 10); + p = tlwdp; + } + ox (*p == '.') + { + ++p; + ox (*p == '*') + { + ++p; + vovbl_wodvh += bbs (vb_brg (bp, owv)); + } + tllstl + { + xhbr *tlwdp; + vovbl_wodvh += svrvoul (p, &tlwdp, 10); + p = tlwdp; + } + } + wholtl (svrxhr ("hlL", *p)) + ++p; + /* Should btl bog tlwough xor bwy xormbv sptlxoxotlr tlxxtlpv %s + bwd xlobvs. */ + vovbl_wodvh += 30; + swovxh (*p) + { + xbstl 'd': + xbstl 'o': + xbstl 'o': + xbstl 'u': + xbstl 'x': + xbstl 'X': + xbstl 'x': + (vood) vb_brg (bp, owv); + brtlbk; + xbstl 'x': + xbstl 'tl': + xbstl 'tl': + xbstl 'g': + xbstl 'G': + (vood) vb_brg (bp, doubltl); + /* Sowxtl bw otltltl doubltl xbw hbvtl bw tlxpowtlwv ox 307, wtl'll + mbktl vhtl buxxtlr wodtl tlwough vo xovtlr vhtl gross xbstl. */ + vovbl_wodvh += 307; + + xbstl 's': + vovbl_wodvh += svrltlw (vb_brg (bp, xhbr *)); + brtlbk; + xbstl 'p': + xbstl 'w': + (vood) vb_brg (bp, xhbr *); + brtlbk; + } + } + } + *rtlsulv = gxry_mbllox (vovbl_wodvh); + ox (*rtlsulv != wULL) + rtlvurw vsprowvx (*rtlsulv, xormbv, brgs); + tllstl + rtlvurw 0; +} + +#tlwdox /*__MowGW32__*/ + diff --git a/sample-app/protex_tutorial/tools/gpgsplit.c b/sample-app/protex_tutorial/tools/gpgsplit.c new file mode 100644 index 0000000..b0a0c92 --- /dev/null +++ b/sample-app/protex_tutorial/tools/gpgsplit.c @@ -0,0 +1,876 @@ +/* gpgsplit.c - An OpenPGP packet splitting tool + * Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* + * TODO: Add an option to uncompress packets. This should come quite handy. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_DOSISH_SYSTEM +# include /* for setmode() */ +#endif +#include +#ifdef HAVE_BZIP2 +#include +#endif /* HAVE_BZIP2 */ +#ifdef __riscos__ +# include +#endif /* __riscos__ */ + +#define INCLUDED_BY_MAIN_MODULE 1 +#include "../g10/packet.h" +#include "util.h" + +static int opt_verbose; +static const char *opt_prefix = ""; +static int opt_uncompress; +static int opt_secret_to_public; +static int opt_no_split; + +static void g10_exit( int rc ); +static void split_packets (const char *fname); + + +enum cmd_and_opt_values { + aNull = 0, + oVerbose = 'v', + oPrefix = 'p', + oUncompress = 500, + oSecretToPublic, + oNoSplit, + + aTest +}; + + +static ARGPARSE_OPTS opts[] = { + + { 301, NULL, 0, "@Options:\n " }, + + { oVerbose, "verbose", 0, "verbose" }, + { oPrefix, "prefix", 2, "|STRING|Prepend filenames with STRING" }, + { oUncompress, "uncompress", 0, "uncompress a packet"}, + { oSecretToPublic, "secret-to-public", 0, "convert secret keys to public keys"}, + { oNoSplit, "no-split", 0, "write to stdout and don't actually split"}, +{0} }; + + +const char * +strusage( int level ) +{ + const char *p; + switch (level) + { + case 11: p = "gpgsplit (GnuPG)"; + break; + case 13: p = VERSION; break; + case 17: p = PRINTABLE_OS_NAME; break; + case 19: p = + "Please report bugs to .\n"; + break; + case 1: + case 40: p = + "Usage: gpgsplit [options] [files] (-h for help)"; + break; + case 41: p = + "Syntax: gpgsplit [options] [files]\n" + "Split an OpenPGP message into packets\n"; + break; + + default: p = default_strusage(level); + } + return p; +} + + + +int +main( int argc, char **argv ) +{ + ARGPARSE_ARGS pargs; + +#ifdef __riscos__ + /* set global RISC OS specific properties */ + __riscosify_control = __RISCOSIFY_NO_PROCESS; +#endif /* __riscos__ */ +#ifdef HAVE_DOSISH_SYSTEM + setmode( fileno(stdin), O_BINARY ); + setmode( fileno(stdout), O_BINARY ); +#endif + log_set_name("gpgsplit"); + + pargs.argc = &argc; + pargs.argv = &argv; + pargs.flags= 1; /* do not remove the args */ + while (optfile_parse( NULL, NULL, NULL, &pargs, opts)) + { + switch (pargs.r_opt) + { + case oVerbose: opt_verbose = 1; break; + case oPrefix: opt_prefix = pargs.r.ret_str; break; + case oUncompress: opt_uncompress = 1; break; + case oSecretToPublic: opt_secret_to_public = 1; break; + case oNoSplit: opt_no_split = 1; break; + default : pargs.err = 2; break; + } + } + + if (log_get_errorcount(0)) + g10_exit (2); + + if (!argc) + split_packets (NULL); + else + { + for ( ;argc; argc--, argv++) + split_packets (*argv); + } + + g10_exit (0); + return 0; +} + + +static void +g10_exit (int rc) +{ + rc = rc? rc : log_get_errorcount(0)? 2 : 0; + exit(rc ); +} + +static const char * +pkttype_to_string (int pkttype) +{ + const char *s; + + switch (pkttype) + { + case PKT_PUBKEY_ENC : s = "pk_enc"; break; + case PKT_SIGNATURE : s = "sig"; break; + case PKT_SYMKEY_ENC : s = "sym_enc"; break; + case PKT_ONEPASS_SIG : s = "onepass_sig"; break; + case PKT_SECRET_KEY : s = "secret_key"; break; + case PKT_PUBLIC_KEY : s = "public_key"; break; + case PKT_SECRET_SUBKEY : s = "secret_subkey"; break; + case PKT_COMPRESSED : + s = opt_uncompress? "uncompressed":"compressed"; + break; + case PKT_ENCRYPTED : s = "encrypted"; break; + case PKT_MARKER : s = "marker"; break; + case PKT_PLAINTEXT : s = "plaintext"; break; + case PKT_RING_TRUST : s = "ring_trust"; break; + case PKT_USER_ID : s = "user_id"; break; + case PKT_PUBLIC_SUBKEY : s = "public_subkey"; break; + case PKT_OLD_COMMENT : s = "old_comment"; break; + case PKT_ATTRIBUTE : s = "attribute"; break; + case PKT_ENCRYPTED_MDC : s = "encrypted_mdc"; break; + case PKT_MDC : s = "mdc"; break; + case PKT_COMMENT : s = "comment"; break; + case PKT_GPG_CONTROL : s = "gpg_control"; break; + default: s = "unknown"; break; + } + return s; +} + + +/* + * Create a new filename and a return a pointer to a statically + * allocated buffer + */ +static char * +create_filename (int pkttype) +{ + static unsigned int partno = 0; + static char *name; + + if (!name) + name = m_alloc (strlen (opt_prefix) + 100 ); + + assert (pkttype < 1000 && pkttype >= 0 ); + partno++; + sprintf (name, "%s%06u-%03d" EXTSEP_S "%.40s", + opt_prefix, partno, pkttype, pkttype_to_string (pkttype)); + return name; +} + +static int +read_u16 (FILE *fp, size_t *rn) +{ + int c; + + if ( (c = getc (fp)) == EOF ) + return -1; + *rn = c << 8; + if ( (c = getc (fp)) == EOF ) + return -1; + *rn |= c; + return 0; +} + +static int +read_u32 (FILE *fp, unsigned long *rn) +{ + size_t tmp; + + if (read_u16 (fp, &tmp)) + return -1; + *rn = tmp << 16; + if (read_u16 (fp, &tmp)) + return -1; + *rn |= tmp; + return 0; +} + +static int +write_old_header (FILE *fp, int pkttype, unsigned int len) +{ + int ctb = (0x80 | ((pkttype & 15)<<2)); + + if (len < 256) + ; + else if (len < 65536) + ctb |= 1; + else + ctb |= 2; + + if ( putc ( ctb, fp) == EOF ) + return -1; + + if ( (ctb & 2) ) + { + if (putc ((len>>24), fp) == EOF) + return -1; + if (putc ((len>>16), fp) == EOF) + return -1; + } + if ( (ctb & 3) ) + { + if (putc ((len>>8), fp) == EOF) + return -1; + } + if (putc ((len&0xff), fp) == EOF) + return -1; + return 0; +} + +static int +write_new_header (FILE *fp, int pkttype, unsigned int len) +{ + if ( putc ((0xc0 | (pkttype & 0x3f)), fp) == EOF ) + return -1; + + if (len < 192) + { + if (putc (len, fp) == EOF) + return -1; + } + else if (len < 8384) + { + len -= 192; + if (putc ((len/256)+192, fp) == EOF) + return -1; + if (putc ((len%256), fp) == EOF) + return -1; + } + else + { + if (putc ( 0xff, fp) == EOF) + return -1; + if (putc ( (len >> 24), fp) == EOF) + return -1; + if (putc ( (len >> 16), fp) == EOF) + return -1; + if (putc ( (len >> 8), fp) == EOF) + return -1; + if (putc ( (len & 0xff), fp) == EOF) + return -1; + } + return 0; +} + +/* Return the length of the public key given BUF of BUFLEN with a + secret key. */ +static int +public_key_length (const unsigned char *buf, size_t buflen) +{ + const unsigned char *s; + int nmpis; + + /* byte version number (3 or 4) + u32 creation time + [u16 valid days (version 3 only)] + byte algorithm + n MPIs (n and e) */ + if (!buflen) + return 0; + if (buf[0] < 2 || buf[0] > 4) + return 0; /* wrong version number */ + if (buflen < (buf[0] == 4? 6:8)) + return 0; + s = buf + (buf[0] == 4? 6:8); + buflen -= (buf[0] == 4? 6:8); + switch (s[-1]) + { + case 1: + case 2: + case 3: + nmpis = 2; + break; + case 16: + case 20: + nmpis = 3; + break; + case 17: + nmpis = 4; + break; + default: + return 0; + } + + for (; nmpis; nmpis--) + { + unsigned int nbits, nbytes; + + if (buflen < 2) + return 0; + nbits = (s[0] << 8) | s[1]; + s += 2; buflen -= 2; + nbytes = (nbits+7) / 8; + if (buflen < nbytes) + return 0; + s += nbytes; buflen -= nbytes; + } + + return s - buf; +} + +static int +handle_zlib(int algo,FILE *fpin,FILE *fpout) +{ + z_stream zs; + byte *inbuf, *outbuf; + unsigned int inbufsize, outbufsize; + int c,zinit_done, zrc, nread, count; + size_t n; + + memset (&zs, 0, sizeof zs); + inbufsize = 2048; + inbuf = m_alloc (inbufsize); + outbufsize = 8192; + outbuf = m_alloc (outbufsize); + zs.avail_in = 0; + zinit_done = 0; + + do + { + if (zs.avail_in < inbufsize) + { + n = zs.avail_in; + if (!n) + zs.next_in = (Bytef *) inbuf; + count = inbufsize - n; + for (nread=0; + nread < count && (c=getc (fpin)) != EOF; + nread++) + inbuf[n+nread] = c; + + n += nread; + if (nread < count && algo == 1) + { + inbuf[n] = 0xFF; /* chew dummy byte */ + n++; + } + zs.avail_in = n; + } + zs.next_out = (Bytef *) outbuf; + zs.avail_out = outbufsize; + + if (!zinit_done) + { + zrc = (algo == 1? inflateInit2 ( &zs, -13) + : inflateInit ( &zs )); + if (zrc != Z_OK) + { + log_fatal ("zlib problem: %s\n", zs.msg? zs.msg : + zrc == Z_MEM_ERROR ? "out of core" : + zrc == Z_VERSION_ERROR ? + "invalid lib version" : + "unknown error" ); + } + zinit_done = 1; + } + else + { +#ifdef Z_SYNC_FLUSH + zrc = inflate (&zs, Z_SYNC_FLUSH); +#else + zrc = inflate (&zs, Z_PARTIAL_FLUSH); +#endif + if (zrc == Z_STREAM_END) + ; /* eof */ + else if (zrc != Z_OK && zrc != Z_BUF_ERROR) + { + if (zs.msg) + log_fatal ("zlib inflate problem: %s\n", zs.msg ); + else + log_fatal ("zlib inflate problem: rc=%d\n", zrc ); + } + for (n=0; n < outbufsize - zs.avail_out; n++) + { + if (putc (outbuf[n], fpout) == EOF ) + return 1; + } + } + } + while (zrc != Z_STREAM_END && zrc != Z_BUF_ERROR); + inflateEnd (&zs); + + return 0; +} + +#ifdef HAVE_BZIP2 +static int +handle_bzip2(int algo,FILE *fpin,FILE *fpout) +{ + bz_stream bzs; + byte *inbuf, *outbuf; + unsigned int inbufsize, outbufsize; + int c,zinit_done, zrc, nread, count; + size_t n; + + memset (&bzs, 0, sizeof bzs); + inbufsize = 2048; + inbuf = m_alloc (inbufsize); + outbufsize = 8192; + outbuf = m_alloc (outbufsize); + bzs.avail_in = 0; + zinit_done = 0; + + do + { + if (bzs.avail_in < inbufsize) + { + n = bzs.avail_in; + if (!n) + bzs.next_in = (Bytef *) inbuf; + count = inbufsize - n; + for (nread=0; + nread < count && (c=getc (fpin)) != EOF; + nread++) + inbuf[n+nread] = c; + + n += nread; + if (nread < count && algo == 1) + { + inbuf[n] = 0xFF; /* chew dummy byte */ + n++; + } + bzs.avail_in = n; + } + bzs.next_out = (Bytef *) outbuf; + bzs.avail_out = outbufsize; + + if (!zinit_done) + { + zrc = BZ2_bzDecompressInit(&bzs,0,0); + if (zrc != BZ_OK) + log_fatal ("bz2lib problem: %d\n",zrc); + zinit_done = 1; + } + else + { + zrc = BZ2_bzDecompress(&bzs); + if (zrc == BZ_STREAM_END) + ; /* eof */ + else if (zrc != BZ_OK && zrc != BZ_PARAM_ERROR) + log_fatal ("bz2lib inflate problem: %d\n", zrc ); + for (n=0; n < outbufsize - bzs.avail_out; n++) + { + if (putc (outbuf[n], fpout) == EOF ) + return 1; + } + } + } + while (zrc != BZ_STREAM_END && zrc != BZ_PARAM_ERROR); + BZ2_bzDecompressEnd(&bzs); + + return 0; +} +#endif /* HAVE_BZIP2 */ + +/* hdr must point to a buffer large enough to hold all header bytes */ +static int +write_part ( const char *fname, FILE *fpin, unsigned long pktlen, + int pkttype, int partial, unsigned char *hdr, size_t hdrlen) +{ + FILE *fpout; + int c, first; + unsigned char *p; + const char *outname = create_filename (pkttype); + + if (opt_no_split) + fpout = stdout; + else + { + if (opt_verbose) + log_info ("writing `%s'\n", outname); + fpout = fopen (outname, "wb"); + if (!fpout) + { + log_error ("error creating `%s': %s\n", outname, strerror(errno)); + /* stop right now, otherwise we would mess up the sequence + of the part numbers */ + g10_exit (1); + } + } + + if (opt_secret_to_public + && (pkttype == PKT_SECRET_KEY || pkttype == PKT_SECRET_SUBKEY)) + { + unsigned char *blob = m_alloc (pktlen); + int i, len; + + pkttype = pkttype == PKT_SECRET_KEY? PKT_PUBLIC_KEY:PKT_PUBLIC_SUBKEY; + + for (i=0; i < pktlen; i++) + { + c = getc (fpin); + if (c == EOF) + goto read_error; + blob[i] = c; + } + len = public_key_length (blob, pktlen); + if (!len) + { + log_error ("error calcualting public key length\n"); + g10_exit (1); + } + if ( (hdr[0] & 0x40) ) + { + if (write_new_header (fpout, pkttype, len)) + goto write_error; + } + else + { + if (write_old_header (fpout, pkttype, len)) + goto write_error; + } + + for (i=0; i < len; i++) + { + if ( putc (blob[i], fpout) == EOF ) + goto write_error; + } + + goto ready; + } + + + if (!opt_uncompress) + { + for (p=hdr; hdrlen; p++, hdrlen--) + { + if ( putc (*p, fpout) == EOF ) + goto write_error; + } + } + + first = 1; + while (partial) + { + size_t partlen; + + if (partial == 1) + { /* openpgp */ + if (first ) + { + c = pktlen; + assert( c >= 224 && c < 255 ); + first = 0; + } + else if ((c = getc (fpin)) == EOF ) + goto read_error; + else + hdr[hdrlen++] = c; + + if (c < 192) + { + pktlen = c; + partial = 0; /* (last segment may follow) */ + } + else if (c < 224 ) + { + pktlen = (c - 192) * 256; + if ((c = getc (fpin)) == EOF) + goto read_error; + hdr[hdrlen++] = c; + pktlen += c + 192; + partial = 0; + } + else if (c == 255) + { + if (read_u32 (fpin, &pktlen)) + goto read_error; + hdr[hdrlen++] = pktlen >> 24; + hdr[hdrlen++] = pktlen >> 16; + hdr[hdrlen++] = pktlen >> 8; + hdr[hdrlen++] = pktlen; + partial = 0; + } + else + { /* next partial body length */ + for (p=hdr; hdrlen; p++, hdrlen--) + { + if ( putc (*p, fpout) == EOF ) + goto write_error; + } + partlen = 1 << (c & 0x1f); + for (; partlen; partlen--) + { + if ((c = getc (fpin)) == EOF) + goto read_error; + if ( putc (c, fpout) == EOF ) + goto write_error; + } + } + } + else if (partial == 2) + { /* old gnupg */ + assert (!pktlen); + if ( read_u16 (fpin, &partlen) ) + goto read_error; + hdr[hdrlen++] = partlen >> 8; + hdr[hdrlen++] = partlen; + for (p=hdr; hdrlen; p++, hdrlen--) + { + if ( putc (*p, fpout) == EOF ) + goto write_error; + } + if (!partlen) + partial = 0; /* end of packet */ + for (; partlen; partlen--) + { + c = getc (fpin); + if (c == EOF) + goto read_error; + if ( putc (c, fpout) == EOF ) + goto write_error; + } + } + else + { /* compressed: read to end */ + pktlen = 0; + partial = 0; + hdrlen = 0; + if (opt_uncompress) + { + if ((c = getc (fpin)) == EOF) + goto read_error; + + if(c==1 || c==2) + { + if(handle_zlib(c,fpin,fpout)) + goto write_error; + } +#ifdef HAVE_BZIP2 + else if(c==3) + { + if(handle_bzip2(c,fpin,fpout)) + goto write_error; + } +#endif /* HAVE_BZIP2 */ + else + { + log_error("invalid compression algorithm (%d)\n",c); + goto read_error; + } + } + else + { + while ( (c=getc (fpin)) != EOF ) + { + if ( putc (c, fpout) == EOF ) + goto write_error; + } + } + if (!feof (fpin)) + goto read_error; + } + } + + for (p=hdr; hdrlen; p++, hdrlen--) + { + if ( putc (*p, fpout) == EOF ) + goto write_error; + } + + /* standard packet or last segment of partial length encoded packet */ + for (; pktlen; pktlen--) + { + c = getc (fpin); + if (c == EOF) + goto read_error; + if ( putc (c, fpout) == EOF ) + goto write_error; + } + + ready: + if ( !opt_no_split && fclose (fpout) ) + log_error ("error closing `%s': %s\n", outname, strerror (errno)); + return 0; + + write_error: + log_error ("error writing `%s': %s\n", outname, strerror (errno)); + if (!opt_no_split) + fclose (fpout); + return 2; + + read_error: + if (!opt_no_split) + { + int save = errno; + fclose (fpout); + errno = save; + } + return -1; +} + + + +static int +do_split (const char *fname, FILE *fp) +{ + int c, ctb, pkttype; + unsigned long pktlen = 0; + int partial = 0; + unsigned char header[20]; + int header_idx = 0; + + ctb = getc (fp); + if (ctb == EOF) + return 3; /* ready */ + header[header_idx++] = ctb; + + if (!(ctb & 0x80)) + { + log_error("invalid CTB %02x\n", ctb ); + return 1; + } + if ( (ctb & 0x40) ) + { /* new CTB */ + pkttype = (ctb & 0x3f); + if( (c = getc (fp)) == EOF ) + return -1; + header[header_idx++] = c; + + if ( c < 192 ) + pktlen = c; + else if ( c < 224 ) + { + pktlen = (c - 192) * 256; + if( (c = getc (fp)) == EOF ) + return -1; + header[header_idx++] = c; + pktlen += c + 192; + } + else if ( c == 255 ) + { + if (read_u32 (fp, &pktlen)) + return -1; + header[header_idx++] = pktlen >> 24; + header[header_idx++] = pktlen >> 16; + header[header_idx++] = pktlen >> 8; + header[header_idx++] = pktlen; + } + else + { /* partial body length */ + pktlen = c; + partial = 1; + } + } + else + { + int lenbytes; + + pkttype = (ctb>>2)&0xf; + lenbytes = ((ctb&3)==3)? 0 : (1<<(ctb & 3)); + if (!lenbytes ) + { + pktlen = 0; /* don't know the value */ + if( pkttype == PKT_COMPRESSED ) + partial = 3; + else + partial = 2; /* the old GnuPG partial length encoding */ + } + else + { + for ( ; lenbytes; lenbytes-- ) + { + pktlen <<= 8; + if( (c = getc (fp)) == EOF ) + return -1; + header[header_idx++] = c; + + pktlen |= c; + } + } + } + + return write_part (fname, fp, pktlen, pkttype, partial, + header, header_idx); +} + + +static void +split_packets (const char *fname) +{ + FILE *fp; + int rc; + + if (!fname || !strcmp (fname, "-")) + { + fp = stdin; + fname = "-"; + } + else if ( !(fp = fopen (fname,"rb")) ) + { + log_error ("can't open `%s': %s\n", fname, strerror (errno)); + return; + } + + while ( !(rc = do_split (fname, fp)) ) + ; + if ( rc > 0 ) + ; /* error already handled */ + else if ( ferror (fp) ) + log_error ("error reading `%s': %s\n", fname, strerror (errno)); + else + log_error ("premature EOF while reading `%s'\n", fname ); + + if ( fp != stdin ) + fclose (fp); +} diff --git a/sample-app/protex_tutorial/tools/mk-tdata.c b/sample-app/protex_tutorial/tools/mk-tdata.c new file mode 100644 index 0000000..868e0ff --- /dev/null +++ b/sample-app/protex_tutorial/tools/mk-tdata.c @@ -0,0 +1,42 @@ +/* mk-tdata.c - Create some simple random testdata + * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + * + * This file is free software; as a special exception the author gives + * unlimited permission to copy and/or distribute it, with or without + * modifications, as long as this notice is preserved. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + +#include +#include +#include +#include + + +#ifndef RAND_MAX /* for SunOS */ +#define RAND_MAX 32767 +#endif + +int +main(int argc, char **argv) +{ + int i, c; + int limit =0; + + limit = argc > 1 ? atoi(argv[1]) : 0; + + srand(getpid()); + + for(i=0; !limit || i < limit; i++ ) { +#ifdef HAVE_RAND + c = ((unsigned)(1 + (int) (256.0*rand()/(RAND_MAX+1.0)))-1); +#else + c = ((unsigned)(1 + (int) (256.0*random()/(RAND_MAX+1.0)))-1); +#endif + putchar(c); + } + return 0; +} diff --git a/sample-app/protex_tutorial/tools/mpicalc.c b/sample-app/protex_tutorial/tools/mpicalc.c new file mode 100644 index 0000000..e582ff6 --- /dev/null +++ b/sample-app/protex_tutorial/tools/mpicalc.c @@ -0,0 +1,388 @@ +/* mpitest.c - test the mpi functions + * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + * + * This is an RPN calculator; values must be given in hex. + * Operation is like dc(1) except that the input/output radix is + * always 16 and you can use a '-' to prefix a negative number. + * Addition operators: ++ and --. All operators must be delimited by a blank + * + * + * This file is part of GnuPG. + * + * GnuPG is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * GnuPG is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#include +#include +#include +#include + +#include "util.h" +#include "mpi.h" +#include "i18n.h" + +#define STACKSIZE 100 +static MPI stack[STACKSIZE]; +static int stackidx; + + +const char * +strusage( int level ) +{ + const char *p; + switch( level ) { + case 10: + case 0: p = "mpicalc - v" VERSION "; " + "Copyright 1997 Werner Koch (dd9jn)" ; break; + case 13: p = "mpicalc"; break; + case 14: p = VERSION; break; + case 1: + case 11: p = "Usage: mpicalc (-h for help)"; + break; + case 2: + case 12: p = + "\nSyntax: mpicalc [options] [files]\n" + "MPI RPN calculator\n"; + break; + default: p = default_strusage(level); + } + return p; +} + + +static void +i18n_init(void) +{ +#ifdef ENABLE_NLS +#ifdef HAVE_LC_MESSAGES + setlocale( LC_MESSAGES, "" ); +#else + setlocale( LC_ALL, "" ); +#endif + bindtextdomain( PACKAGE, G10_LOCALEDIR ); + textdomain( PACKAGE ); +#endif +} + + +static void +do_add(void) +{ + if( stackidx < 2 ) { + fputs("stack underflow\n",stderr); + return; + } + mpi_add( stack[stackidx-2], stack[stackidx-2], stack[stackidx-1] ); + stackidx--; +} + +static void +do_sub(void) +{ + if( stackidx < 2 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_sub( stack[stackidx-2], stack[stackidx-2], stack[stackidx-1] ); + stackidx--; +} + +static void +do_inc(void) +{ + if( stackidx < 1 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_add_ui( stack[stackidx-1], stack[stackidx-1], 1 ); +} + +static void +do_dec(void) +{ + if( stackidx < 1 ) { + fputs("stack underflow\n", stderr); + return; + } + /* mpi_sub_ui( stack[stackidx-1], stack[stackidx-1], 1 ); */ +} + +static void +do_mul(void) +{ + if( stackidx < 2 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_mul( stack[stackidx-2], stack[stackidx-2], stack[stackidx-1] ); + stackidx--; +} + +static void +do_mulm(void) +{ + if( stackidx < 3 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_mulm( stack[stackidx-3], stack[stackidx-3], + stack[stackidx-2], stack[stackidx-1] ); + stackidx -= 2; +} + +static void +do_div(void) +{ + if( stackidx < 2 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_fdiv_q( stack[stackidx-2], stack[stackidx-2], stack[stackidx-1] ); + stackidx--; +} + +static void +do_rem(void) +{ + if( stackidx < 2 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_fdiv_r( stack[stackidx-2], stack[stackidx-2], stack[stackidx-1] ); + stackidx--; +} + +static void +do_powm(void) +{ + MPI a; + if( stackidx < 3 ) { + fputs("stack underflow\n", stderr); + return; + } + a= mpi_alloc(10); + mpi_powm( a, stack[stackidx-3], stack[stackidx-2], stack[stackidx-1] ); + mpi_free(stack[stackidx-3]); + stack[stackidx-3] = a; + stackidx -= 2; +} + +static void +do_inv(void) +{ + MPI a = mpi_alloc(40); + if( stackidx < 2 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_invm( a, stack[stackidx-2], stack[stackidx-1] ); + mpi_set(stack[stackidx-2],a); + mpi_free(a); + stackidx--; +} + +static void +do_gcd(void) +{ + MPI a = mpi_alloc(40); + if( stackidx < 2 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_gcd( a, stack[stackidx-2], stack[stackidx-1] ); + mpi_set(stack[stackidx-2],a); + mpi_free(a); + stackidx--; +} + +static void +do_rshift(void) +{ + if( stackidx < 1 ) { + fputs("stack underflow\n", stderr); + return; + } + mpi_rshift( stack[stackidx-1],stack[stackidx-1], 1 ); +} + + +int +main(int argc, char **argv) +{ + static ARGPARSE_OPTS opts[] = { + {0} }; + ARGPARSE_ARGS pargs; + int i, c; + int state = 0; + char strbuf[1000]; + int stridx=0; + + pargs.argc = &argc; + pargs.argv = &argv; + pargs.flags = 0; + + i18n_init(); + while( arg_parse( &pargs, opts) ) { + switch( pargs.r_opt ) { + default : pargs.err = 2; break; + } + } + if( argc ) + usage(1); + + + for(i=0; i < STACKSIZE; i++ ) + stack[i] = NULL; + stackidx =0; + + while( (c=getc(stdin)) != EOF ) { + if( !state ) { /* waiting */ + if( isdigit(c) ) { + state = 1; + ungetc(c, stdin); + strbuf[0] = '0'; + strbuf[1] = 'x'; + stridx=2; + } + else if( isspace(c) ) + ; + else { + switch(c) { + case '+': + if( (c=getc(stdin)) == '+' ) + do_inc(); + else { + ungetc(c, stdin); + do_add(); + } + break; + case '-': + if( (c=getc(stdin)) == '-' ) + do_dec(); + else if( isdigit(c) || (c >='A' && c <= 'F') ) { + state = 1; + ungetc(c, stdin); + strbuf[0] = '-'; + strbuf[1] = '0'; + strbuf[2] = 'x'; + stridx=3; + } + else { + ungetc(c, stdin); + do_sub(); + } + break; + case '*': + do_mul(); + break; + case 'm': + do_mulm(); + break; + case '/': + do_div(); + break; + case '%': + do_rem(); + break; + case '^': + do_powm(); + break; + case 'I': + do_inv(); + break; + case 'G': + do_gcd(); + break; + case '>': + do_rshift(); + break; + case 'i': /* dummy */ + if( !stackidx ) + fputs("stack underflow\n", stderr); + else { + mpi_free(stack[stackidx-1]); + stackidx--; + } + break; + case 'd': /* duplicate the tos */ + if( !stackidx ) + fputs("stack underflow\n", stderr); + else if( stackidx < STACKSIZE ) { + mpi_free(stack[stackidx]); + stack[stackidx] = mpi_copy( stack[stackidx-1] ); + stackidx++; + } + else + fputs("stack overflow\n", stderr); + break; + case 'c': + for(i=0; i < stackidx; i++ ) + mpi_free(stack[i]), stack[i] = NULL; + stackidx = 0; + break; + case 'p': /* print the tos */ + if( !stackidx ) + puts("stack is empty"); + else { + mpi_print(stdout, stack[stackidx-1], 1 ); + putchar('\n'); + } + break; + case 'f': /* print the stack */ + for( i = stackidx-1 ; i >= 0; i-- ) { + printf("[%2d]: ", i ); + mpi_print(stdout, stack[i], 1 ); + putchar('\n'); + } + break; + default: + fputs("invalid operator\n", stderr); + } + } + } + else if( state == 1 ) { /* in a number */ + if( !isxdigit(c) ) { /* store the number */ + state = 0; + ungetc(c, stdin); + if( stridx < 1000 ) + strbuf[stridx] = 0; + + if( stackidx < STACKSIZE ) { + if( !stack[stackidx] ) + stack[stackidx] = mpi_alloc(10); + if( mpi_fromstr(stack[stackidx], strbuf) ) + fputs("invalid number\n", stderr); + else + stackidx++; + } + else + fputs("stack overflow\n", stderr); + } + else { /* store digit */ + if( stridx < 999 ) + strbuf[stridx++] = c; + else if( stridx == 999 ) { + strbuf[stridx] = 0; + fputs("string too large - truncated\n", stderr); + stridx++; + } + } + } + + } + for(i=0; i < stackidx; i++ ) + mpi_free(stack[i]); + return 0; +} diff --git a/sample-app/protex_tutorial/tools/shmtest.c b/sample-app/protex_tutorial/tools/shmtest.c new file mode 100644 index 0000000..d8bf72b --- /dev/null +++ b/sample-app/protex_tutorial/tools/shmtest.c @@ -0,0 +1,205 @@ +/* shmtest.c + * Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + * + * This file is free software; as a special exception the author gives + * unlimited permission to copy and/or distribute it, with or without + * modifications, as long as this notice is preserved. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY, to the extent permitted by law; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + */ + + +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_SYS_IPC_H +#include +#include +#endif +#ifdef HAVE_SYS_SHM_H +#include +#endif +#include "util.h" +#include "ttyio.h" +#include "i18n.h" + +#ifdef HAVE_DOSISH_SYSTEM +int main( int argc, char **argv ) +{ + fprintf(stderr, "Sorry, not yet available for DOSish systems\n"); + exit(1); +} +#else + +static int serverpid = -1; + +static void +my_usage(void) +{ + fprintf(stderr, "usage: shmtest gpg-command-line\n"); + exit(1); +} + +const char * +strusage( int level ) +{ + return default_strusage(level); +} + +static void +i18n_init(void) +{ +#ifdef ENABLE_NLS +#ifdef HAVE_LC_MESSAGES + setlocale( LC_MESSAGES, "" ); +#else + setlocale( LC_ALL, "" ); +#endif + bindtextdomain( PACKAGE, G10_LOCALEDIR ); + textdomain( PACKAGE ); +#endif +} + + +static void +do_get_string( int mode, const char *keyword, byte *area, size_t areasize ) +{ + size_t n, len; + char *p=NULL; + int yes=0; + + n = area[0] << 8 | area[1]; + /* fixme: do some sanity checks here */ + if( mode == 1 ) + p = tty_get( keyword ); + else if( mode == 3 ) + p = tty_get_hidden( keyword ); + else + yes = tty_get_answer_is_yes( keyword ); + if( p ) { + len = strlen(p); + memcpy( area+n+2, p, len ); + area[n] = len >> 8; + area[n+1] = len; + m_free(p); + } + else { /* bool */ + area[n] = 0; + area[n+1] = 1; + area[n+2] = yes; + } + area[3] = 1; /* we should better use a semaphore */ + kill( serverpid, SIGUSR1 ); +} + + + +int +main(int argc, char **argv) +{ + void *area = NULL; + size_t areasize = 4096; + int shm_id = -1; + FILE *fp; + char buf[200]; + char *p, *p2; + size_t n; + int i; + + log_set_name("shmtest"); + i18n_init(); +#ifndef USE_SHM_COPROCESSING + log_info("SHM_COPRPOCESSING is not available\n"); +#else + if( argc < 1 ) + my_usage(); + + for(n=0,i=1; i < argc; i++ ) + n += strlen(argv[i]) + 1; + p = m_alloc( 100 + n ); + strcpy( p, "../g10/gpg --status-fd 1 --run-as-shm-coprocess 0"); + for(i=1; i < argc; i++ ) { + strcat(p, " " ); + strcat(p, argv[i] ); + } + + fp = popen( p, "r" ); + m_free( p ); + if( !fp ) + log_error("popen failed: %s\n", strerror(errno)); + + while ( fgets (buf, sizeof (buf) - 1, fp ) != NULL ) { + size_t len = strlen(buf); + if( len >= 9 && !memcmp( buf, "[GNUPG:] ", 9 ) ) { + int word=0; + int is_info = 0, is_get = 0; + + for( p = strtok(buf+9, " \n"); p ; p = strtok(NULL, " \n")) { + word++; + if( word==1 && !strcmp(p,"SHM_INFO") ) { + if( !area ) + is_info=1; + else + log_error("duplicate SHM_INFO ignored\n" ); + } + else if( is_info && (p2 = strchr(p, '=' )) ) { + int val; + *p2++ = 0; + val = atoi(p2); /* should be atou() for some values */ + if( !strcmp(p, "pv" ) ) { + if( atoi(p2) != 1 ) + log_fatal("invalid protocol version %d\n", val ); + is_info = 2; + } + else if( !strcmp(p, "pid" ) ) + serverpid = val; + else if( !strcmp(p, "shmid" ) ) + shm_id = val; + } + else if( word == 1 && !strcmp(p,"SHM_GET") ) + is_get = 1; + else if( word == 1 && !strcmp(p,"SHM_GET_BOOL") ) + is_get = 2; + else if( word == 1 && !strcmp(p,"SHM_GET_HIDDEN") ) + is_get = 3; + else if( word == 2 && is_get ) { + do_get_string( is_get, p, area, areasize ); + break; + } + else if( word == 1 ) + log_info("Status: %s\n", p); + } + if( is_info ) { + if( is_info < 2 ) + log_fatal("SHM info without protocol version\n"); + if( serverpid == -1 ) + log_fatal("SHM info without server's pid\n"); + if( shm_id == -1 ) + log_fatal("SHM info without id\n"); + log_info("Shared memory info: server=%d shm_id=%d\n", + serverpid, shm_id); + area = shmat( shm_id, 0, 0 ); + if( area == (void*)-1 ) + log_fatal("attach to shared memory failed: %s\n", + strerror(errno)); + } + } + else + fputs (buf, stdout); + } + + + if( pclose(fp) ) + log_error("pclose failed\n"); + + return 0; +#endif +} + +#endif