Remove #ifdef's for IRIX_CC_BUG
[openssl.git] / crypto / bn / bn_ctx.c
index 7010193033f9e8a139b55fede7210efcbbcbc817..5288a20be91b8ebd7d2eb9fa8d51264d5bb09a95 100644 (file)
@@ -60,7 +60,8 @@
 #endif
 #endif
 
-#include <stdio.h>
+#define OPENSSL_FIPSAPI
+
 #include <assert.h>
 
 #include "cryptlib.h"
@@ -161,7 +162,7 @@ static void ctxdbg(BN_CTX *ctx)
        fprintf(stderr,"(%08x): ", (unsigned int)ctx);
        while(bnidx < ctx->used)
                {
-               fprintf(stderr,"%02x ", item->vals[bnidx++ % BN_CTX_POOL_SIZE].dmax);
+               fprintf(stderr,"%03x ", item->vals[bnidx++ % BN_CTX_POOL_SIZE].dmax);
                if(!(bnidx % BN_CTX_POOL_SIZE))
                        item = item->next;
                }
@@ -171,8 +172,8 @@ static void ctxdbg(BN_CTX *ctx)
        while(fpidx < stack->depth)
                {
                while(bnidx++ < stack->indexes[fpidx])
-                       fprintf(stderr,"   ");
-               fprintf(stderr,"^^ ");
+                       fprintf(stderr,"    ");
+               fprintf(stderr,"^^^ ");
                bnidx++;
                fpidx++;
                }
@@ -230,7 +231,10 @@ BN_CTX *BN_CTX_new(void)
 
 void BN_CTX_free(BN_CTX *ctx)
        {
+       if (ctx == NULL)
+               return;
 #ifdef BN_CTX_DEBUG
+       {
        BN_POOL_ITEM *pool = ctx->pool.head;
        fprintf(stderr,"BN_CTX_free, stack-size=%d, pool-bignums=%d\n",
                ctx->stack.size, ctx->pool.size);
@@ -242,6 +246,7 @@ void BN_CTX_free(BN_CTX *ctx)
                pool = pool->next;
        }
        fprintf(stderr,"\n");
+       }
 #endif
        BN_STACK_finish(&ctx->stack);
        BN_POOL_finish(&ctx->pool);