~ubuntu-branches/ubuntu/maverick/openssl/maverick

« back to all changes in this revision

Viewing changes to apps/openssl.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Martin
  • Date: 2004-12-16 18:41:29 UTC
  • mto: (11.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20041216184129-z7xjkul57mh1jiha
Tags: upstream-0.9.7e
ImportĀ upstreamĀ versionĀ 0.9.7e

Show diffs side-by-side

added added

removed removed

Lines of Context:
129
129
#include "progs.h"
130
130
#include "s_apps.h"
131
131
#include <openssl/err.h>
 
132
#include <openssl/fips.h>
132
133
 
133
134
/* The LHASH callbacks ("hash" & "cmp") have been replaced by functions with the
134
135
 * base prototypes (we cast each variable inside the function to the required
147
148
#ifdef MONOLITH
148
149
CONF *config=NULL;
149
150
BIO *bio_err=NULL;
 
151
int in_FIPS_mode=0;
150
152
#endif
151
153
 
152
154
 
227
229
        char **argv,*p;
228
230
        LHASH *prog=NULL;
229
231
        long errline;
230
 
 
 
232
 
231
233
        arg.data=NULL;
232
234
        arg.count=0;
233
235
 
 
236
        in_FIPS_mode = 0;
 
237
 
 
238
#ifdef OPENSSL_FIPS
 
239
        if(getenv("OPENSSL_FIPS")) {
 
240
#if defined(_WIN32)
 
241
                char filename[MAX_PATH] = "";
 
242
                GetModuleFileName( NULL, filename, MAX_PATH) ;
 
243
                p = filename;
 
244
#else
 
245
                p = Argv[0];
 
246
#endif
 
247
                if (!FIPS_mode_set(1,p)) {
 
248
                        ERR_load_crypto_strings();
 
249
                        ERR_print_errors(BIO_new_fp(stderr,BIO_NOCLOSE));
 
250
                        exit(1);
 
251
                }
 
252
                in_FIPS_mode = 1;
 
253
                if (getenv("OPENSSL_FIPS_MD5"))
 
254
                        FIPS_allow_md5(1);
 
255
                }
 
256
#endif
234
257
        if (bio_err == NULL)
235
258
                if ((bio_err=BIO_new(BIO_s_file())) != NULL)
236
259
                        BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);