/* Copyright 2001-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include #include #include #include #include #include "ap_release.h" /* Fake a few Apache and NSPR data types and definitions */ typedef char server_rec; typedef int PRBool; typedef int PRInt32; #define PR_FALSE 0 #define PR_TRUE 1 #include extern cipher_properties ciphers_def[]; extern ciphernum; /* An Apache-like error logger */ #if AP_SERVER_MINORVERSION_NUMBER <= 2 int ap_log_error(const char *fn, int line, #else int ap_log_error_(const char *fn, int line, int module_index, #endif int level, int status, const server_rec *s, char *fmt, ...) { char out[1024]; va_list args; va_start(args, fmt); vsprintf(out, fmt, args); fprintf(stderr,"%s:%d, %s\n", fn, line, out); va_end(args); return 0; } #if AP_SERVER_MINORVERSION_NUMBER > 2 #define ap_log_error_ ap_log_error #endif int main(int argc, char ** argv) { int rv=0; int i; char *ciphers; PRBool openssl_output = PR_FALSE; PRBool ciphers_list[ciphernum]; if (argc != 2 && argc != 3) { fprintf(stderr, "Usage: test_cipher [--count] [--o] \n"); exit(1); } if (!strcmp(argv[1], "--count")) { fprintf(stdout, "%d\n", ciphernum); exit(0); } for (i=0; i