2015-01-22 11:40:55 +08:00
|
|
|
/*
|
2016-05-18 02:51:04 +08:00
|
|
|
* Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
|
2006-02-13 07:11:56 +08:00
|
|
|
*
|
2018-12-06 20:58:46 +08:00
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-18 02:51:04 +08:00
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
2006-02-13 07:11:56 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2015-05-14 22:56:48 +08:00
|
|
|
#include "internal/cryptlib.h"
|
2006-02-13 07:11:56 +08:00
|
|
|
#include <openssl/objects.h>
|
|
|
|
#include <openssl/bn.h>
|
|
|
|
#include <openssl/x509v3.h>
|
|
|
|
#include <openssl/ts.h>
|
2015-06-11 02:07:40 +08:00
|
|
|
#include "ts_lcl.h"
|
2006-02-13 07:11:56 +08:00
|
|
|
|
|
|
|
int TS_REQ_print_bio(BIO *bio, TS_REQ *a)
|
2015-01-22 11:40:55 +08:00
|
|
|
{
|
|
|
|
int v;
|
|
|
|
ASN1_OBJECT *policy_id;
|
2006-02-13 07:11:56 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
if (a == NULL)
|
|
|
|
return 0;
|
2006-02-13 07:11:56 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
v = TS_REQ_get_version(a);
|
|
|
|
BIO_printf(bio, "Version: %d\n", v);
|
2006-02-13 07:11:56 +08:00
|
|
|
|
2015-06-11 02:07:40 +08:00
|
|
|
TS_MSG_IMPRINT_print_bio(bio, a->msg_imprint);
|
2006-02-13 07:11:56 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio, "Policy OID: ");
|
|
|
|
policy_id = TS_REQ_get_policy_id(a);
|
|
|
|
if (policy_id == NULL)
|
|
|
|
BIO_printf(bio, "unspecified\n");
|
|
|
|
else
|
|
|
|
TS_OBJ_print_bio(bio, policy_id);
|
2006-02-13 07:11:56 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio, "Nonce: ");
|
2015-06-11 02:07:40 +08:00
|
|
|
if (a->nonce == NULL)
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio, "unspecified");
|
|
|
|
else
|
2015-06-11 02:07:40 +08:00
|
|
|
TS_ASN1_INTEGER_print_bio(bio, a->nonce);
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_write(bio, "\n", 1);
|
2006-02-13 07:11:56 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
BIO_printf(bio, "Certificate required: %s\n",
|
2015-06-11 02:07:40 +08:00
|
|
|
a->cert_req ? "yes" : "no");
|
2006-02-13 07:11:56 +08:00
|
|
|
|
2015-06-11 02:07:40 +08:00
|
|
|
TS_ext_print_bio(bio, a->extensions);
|
2006-02-13 07:11:56 +08:00
|
|
|
|
2015-01-22 11:40:55 +08:00
|
|
|
return 1;
|
|
|
|
}
|