summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/x_algor.c
diff options
context:
space:
mode:
authorjsing <>2014-04-18 11:20:32 +0000
committerjsing <>2014-04-18 11:20:32 +0000
commit6d8ab3f51c14ff4e0ce4f0aaafede903671056b3 (patch)
tree80f89d5dfdd4e6eef26aea54fe2399d237045354 /src/lib/libcrypto/asn1/x_algor.c
parent3a5e199af72e13c8924435aeb9126166854a7c00 (diff)
downloadopenbsd-6d8ab3f51c14ff4e0ce4f0aaafede903671056b3.tar.gz
openbsd-6d8ab3f51c14ff4e0ce4f0aaafede903671056b3.tar.bz2
openbsd-6d8ab3f51c14ff4e0ce4f0aaafede903671056b3.zip
More KNF.
Diffstat (limited to 'src/lib/libcrypto/asn1/x_algor.c')
-rw-r--r--src/lib/libcrypto/asn1/x_algor.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c
index 7ae473485c..65f81e8692 100644
--- a/src/lib/libcrypto/asn1/x_algor.c
+++ b/src/lib/libcrypto/asn1/x_algor.c
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -66,8 +66,8 @@ ASN1_SEQUENCE(X509_ALGOR) = {
66 ASN1_OPT(X509_ALGOR, parameter, ASN1_ANY) 66 ASN1_OPT(X509_ALGOR, parameter, ASN1_ANY)
67} ASN1_SEQUENCE_END(X509_ALGOR) 67} ASN1_SEQUENCE_END(X509_ALGOR)
68 68
69ASN1_ITEM_TEMPLATE(X509_ALGORS) = 69ASN1_ITEM_TEMPLATE(X509_ALGORS) =
70 ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, algorithms, X509_ALGOR) 70 ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, algorithms, X509_ALGOR)
71ASN1_ITEM_TEMPLATE_END(X509_ALGORS) 71ASN1_ITEM_TEMPLATE_END(X509_ALGORS)
72 72
73IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR) 73IMPLEMENT_ASN1_FUNCTIONS(X509_ALGOR)
@@ -77,7 +77,8 @@ IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR)
77IMPLEMENT_STACK_OF(X509_ALGOR) 77IMPLEMENT_STACK_OF(X509_ALGOR)
78IMPLEMENT_ASN1_SET_OF(X509_ALGOR) 78IMPLEMENT_ASN1_SET_OF(X509_ALGOR)
79 79
80int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) 80int
81X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)
81{ 82{
82 if (!alg) 83 if (!alg)
83 return 0; 84 return 0;
@@ -93,20 +94,20 @@ int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)
93 alg->algorithm = aobj; 94 alg->algorithm = aobj;
94 } 95 }
95 if (ptype == 0) 96 if (ptype == 0)
96 return 1; 97 return 1;
97 if (ptype == V_ASN1_UNDEF) { 98 if (ptype == V_ASN1_UNDEF) {
98 if (alg->parameter) { 99 if (alg->parameter) {
99 ASN1_TYPE_free(alg->parameter); 100 ASN1_TYPE_free(alg->parameter);
100 alg->parameter = NULL; 101 alg->parameter = NULL;
101 } 102 }
102 } 103 } else
103 else
104 ASN1_TYPE_set(alg->parameter, ptype, pval); 104 ASN1_TYPE_set(alg->parameter, ptype, pval);
105 return 1; 105 return 1;
106} 106}
107 107
108void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval, 108void
109 X509_ALGOR *algor) 109X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
110 X509_ALGOR *algor)
110{ 111{
111 if (paobj) 112 if (paobj)
112 *paobj = algor->algorithm; 113 *paobj = algor->algorithm;
@@ -114,8 +115,7 @@ void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
114 if (algor->parameter == NULL) { 115 if (algor->parameter == NULL) {
115 *pptype = V_ASN1_UNDEF; 116 *pptype = V_ASN1_UNDEF;
116 return; 117 return;
117 } 118 } else
118 else
119 *pptype = algor->parameter->type; 119 *pptype = algor->parameter->type;
120 if (ppval) 120 if (ppval)
121 *ppval = algor->parameter->value.ptr; 121 *ppval = algor->parameter->value.ptr;
@@ -124,7 +124,8 @@ void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
124 124
125/* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */ 125/* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */
126 126
127void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) 127void
128X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md)
128{ 129{
129 int param_type; 130 int param_type;
130 131
@@ -134,5 +135,4 @@ void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md)
134 param_type = V_ASN1_NULL; 135 param_type = V_ASN1_NULL;
135 136
136 X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); 137 X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL);
137
138} 138}