1e1051a39Sopenharmony_ci/* 2e1051a39Sopenharmony_ci * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved. 3e1051a39Sopenharmony_ci * 4e1051a39Sopenharmony_ci * Licensed under the Apache License 2.0 (the "License"). You may not use 5e1051a39Sopenharmony_ci * this file except in compliance with the License. You can obtain a copy 6e1051a39Sopenharmony_ci * in the file LICENSE in the source distribution or at 7e1051a39Sopenharmony_ci * https://www.openssl.org/source/license.html 8e1051a39Sopenharmony_ci */ 9e1051a39Sopenharmony_ci 10e1051a39Sopenharmony_ci#include <stdio.h> 11e1051a39Sopenharmony_ci#include "internal/cryptlib.h" 12e1051a39Sopenharmony_ci#include <openssl/objects.h> 13e1051a39Sopenharmony_ci#include <openssl/bn.h> 14e1051a39Sopenharmony_ci#include <openssl/x509v3.h> 15e1051a39Sopenharmony_ci#include <openssl/ts.h> 16e1051a39Sopenharmony_ci#include "ts_local.h" 17e1051a39Sopenharmony_ci 18e1051a39Sopenharmony_ciint TS_REQ_print_bio(BIO *bio, TS_REQ *a) 19e1051a39Sopenharmony_ci{ 20e1051a39Sopenharmony_ci int v; 21e1051a39Sopenharmony_ci ASN1_OBJECT *policy_id; 22e1051a39Sopenharmony_ci 23e1051a39Sopenharmony_ci if (a == NULL) 24e1051a39Sopenharmony_ci return 0; 25e1051a39Sopenharmony_ci 26e1051a39Sopenharmony_ci v = TS_REQ_get_version(a); 27e1051a39Sopenharmony_ci BIO_printf(bio, "Version: %d\n", v); 28e1051a39Sopenharmony_ci 29e1051a39Sopenharmony_ci TS_MSG_IMPRINT_print_bio(bio, a->msg_imprint); 30e1051a39Sopenharmony_ci 31e1051a39Sopenharmony_ci BIO_printf(bio, "Policy OID: "); 32e1051a39Sopenharmony_ci policy_id = TS_REQ_get_policy_id(a); 33e1051a39Sopenharmony_ci if (policy_id == NULL) 34e1051a39Sopenharmony_ci BIO_printf(bio, "unspecified\n"); 35e1051a39Sopenharmony_ci else 36e1051a39Sopenharmony_ci TS_OBJ_print_bio(bio, policy_id); 37e1051a39Sopenharmony_ci 38e1051a39Sopenharmony_ci BIO_printf(bio, "Nonce: "); 39e1051a39Sopenharmony_ci if (a->nonce == NULL) 40e1051a39Sopenharmony_ci BIO_printf(bio, "unspecified"); 41e1051a39Sopenharmony_ci else 42e1051a39Sopenharmony_ci TS_ASN1_INTEGER_print_bio(bio, a->nonce); 43e1051a39Sopenharmony_ci BIO_write(bio, "\n", 1); 44e1051a39Sopenharmony_ci 45e1051a39Sopenharmony_ci BIO_printf(bio, "Certificate required: %s\n", 46e1051a39Sopenharmony_ci a->cert_req ? "yes" : "no"); 47e1051a39Sopenharmony_ci 48e1051a39Sopenharmony_ci TS_ext_print_bio(bio, a->extensions); 49e1051a39Sopenharmony_ci 50e1051a39Sopenharmony_ci return 1; 51e1051a39Sopenharmony_ci} 52