Typo.
[openssl.git] / apps / ocsp.c
index 49a156a1cfdc773994dde772a66f95530b9332d8..92922bc8ad6f0568bac17dd4eb969cef316407b7 100644 (file)
@@ -613,11 +613,11 @@ int MAIN(int argc, char **argv)
                        NULL, e, "CA certificate");
                if (rcertfile)
                        {
-                       rother = load_certs(bio_err, sign_certfile, FORMAT_PEM,
+                       rother = load_certs(bio_err, rcertfile, FORMAT_PEM,
                                NULL, e, "responder other certificates");
-                       if (!sign_other) goto end;
+                       if (!rother) goto end;
                        }
-               rkey = load_key(bio_err, rkeyfile, FORMAT_PEM, NULL, NULL,
+               rkey = load_key(bio_err, rkeyfile, FORMAT_PEM, 0, NULL, NULL,
                        "responder private key");
                if (!rkey)
                        goto end;
@@ -663,7 +663,7 @@ int MAIN(int argc, char **argv)
                                NULL, e, "signer certificates");
                        if (!sign_other) goto end;
                        }
-               key = load_key(bio_err, keyfile, FORMAT_PEM, NULL, NULL,
+               key = load_key(bio_err, keyfile, FORMAT_PEM, 0, NULL, NULL,
                        "signer private key");
                if (!key)
                        goto end;
@@ -899,7 +899,7 @@ end:
                SSL_CTX_free(ctx);
                }
 
-       EXIT(ret);
+       OPENSSL_EXIT(ret);
 }
 
 static int add_ocsp_cert(OCSP_REQUEST **req, X509 *cert, X509 *issuer,
@@ -1120,7 +1120,10 @@ static char **lookup_serial(TXT_DB *db, ASN1_INTEGER *ser)
        char *itmp, *row[DB_NUMBER],**rrow;
        for (i = 0; i < DB_NUMBER; i++) row[i] = NULL;
        bn = ASN1_INTEGER_to_BN(ser,NULL);
-       itmp = BN_bn2hex(bn);
+       if (BN_is_zero(bn))
+               itmp = BUF_strdup("00");
+       else
+               itmp = BN_bn2hex(bn);
        row[DB_serial] = itmp;
        BN_free(bn);
        rrow=TXT_DB_get_by_index(db,DB_serial,row);
@@ -1176,7 +1179,7 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcbio, BIO *acbio, char *port
 
        for(;;)
                {
-               len = BIO_gets(cbio, inbuf, 1024);
+               len = BIO_gets(cbio, inbuf, sizeof inbuf);
                if (len <= 0)
                        return 1;
                /* Look for "POST" signalling start of query */