diff options
Diffstat (limited to 'src/lib/libcrypto/cms/cms_att.c')
-rw-r--r-- | src/lib/libcrypto/cms/cms_att.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/lib/libcrypto/cms/cms_att.c b/src/lib/libcrypto/cms/cms_att.c index db896b10c3..b288262b81 100644 --- a/src/lib/libcrypto/cms/cms_att.c +++ b/src/lib/libcrypto/cms/cms_att.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_att.c,v 1.7 2019/08/10 16:03:53 jsing Exp $ */ | 1 | /* $OpenBSD: cms_att.c,v 1.8 2019/08/10 16:42:20 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
4 | * project. | 4 | * project. |
@@ -63,135 +63,135 @@ | |||
63 | 63 | ||
64 | int CMS_signed_get_attr_count(const CMS_SignerInfo *si) | 64 | int CMS_signed_get_attr_count(const CMS_SignerInfo *si) |
65 | { | 65 | { |
66 | return X509at_get_attr_count(si->signedAttrs); | 66 | return X509at_get_attr_count(si->signedAttrs); |
67 | } | 67 | } |
68 | 68 | ||
69 | int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, int lastpos) | 69 | int CMS_signed_get_attr_by_NID(const CMS_SignerInfo *si, int nid, int lastpos) |
70 | { | 70 | { |
71 | return X509at_get_attr_by_NID(si->signedAttrs, nid, lastpos); | 71 | return X509at_get_attr_by_NID(si->signedAttrs, nid, lastpos); |
72 | } | 72 | } |
73 | 73 | ||
74 | int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj, | 74 | int CMS_signed_get_attr_by_OBJ(const CMS_SignerInfo *si, const ASN1_OBJECT *obj, |
75 | int lastpos) | 75 | int lastpos) |
76 | { | 76 | { |
77 | return X509at_get_attr_by_OBJ(si->signedAttrs, obj, lastpos); | 77 | return X509at_get_attr_by_OBJ(si->signedAttrs, obj, lastpos); |
78 | } | 78 | } |
79 | 79 | ||
80 | X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc) | 80 | X509_ATTRIBUTE *CMS_signed_get_attr(const CMS_SignerInfo *si, int loc) |
81 | { | 81 | { |
82 | return X509at_get_attr(si->signedAttrs, loc); | 82 | return X509at_get_attr(si->signedAttrs, loc); |
83 | } | 83 | } |
84 | 84 | ||
85 | X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc) | 85 | X509_ATTRIBUTE *CMS_signed_delete_attr(CMS_SignerInfo *si, int loc) |
86 | { | 86 | { |
87 | return X509at_delete_attr(si->signedAttrs, loc); | 87 | return X509at_delete_attr(si->signedAttrs, loc); |
88 | } | 88 | } |
89 | 89 | ||
90 | int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr) | 90 | int CMS_signed_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr) |
91 | { | 91 | { |
92 | if (X509at_add1_attr(&si->signedAttrs, attr)) | 92 | if (X509at_add1_attr(&si->signedAttrs, attr)) |
93 | return 1; | 93 | return 1; |
94 | return 0; | 94 | return 0; |
95 | } | 95 | } |
96 | 96 | ||
97 | int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, | 97 | int CMS_signed_add1_attr_by_OBJ(CMS_SignerInfo *si, |
98 | const ASN1_OBJECT *obj, int type, | 98 | const ASN1_OBJECT *obj, int type, |
99 | const void *bytes, int len) | 99 | const void *bytes, int len) |
100 | { | 100 | { |
101 | if (X509at_add1_attr_by_OBJ(&si->signedAttrs, obj, type, bytes, len)) | 101 | if (X509at_add1_attr_by_OBJ(&si->signedAttrs, obj, type, bytes, len)) |
102 | return 1; | 102 | return 1; |
103 | return 0; | 103 | return 0; |
104 | } | 104 | } |
105 | 105 | ||
106 | int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, | 106 | int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si, |
107 | int nid, int type, const void *bytes, int len) | 107 | int nid, int type, const void *bytes, int len) |
108 | { | 108 | { |
109 | if (X509at_add1_attr_by_NID(&si->signedAttrs, nid, type, bytes, len)) | 109 | if (X509at_add1_attr_by_NID(&si->signedAttrs, nid, type, bytes, len)) |
110 | return 1; | 110 | return 1; |
111 | return 0; | 111 | return 0; |
112 | } | 112 | } |
113 | 113 | ||
114 | int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si, | 114 | int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si, |
115 | const char *attrname, int type, | 115 | const char *attrname, int type, |
116 | const void *bytes, int len) | 116 | const void *bytes, int len) |
117 | { | 117 | { |
118 | if (X509at_add1_attr_by_txt(&si->signedAttrs, attrname, type, bytes, len)) | 118 | if (X509at_add1_attr_by_txt(&si->signedAttrs, attrname, type, bytes, len)) |
119 | return 1; | 119 | return 1; |
120 | return 0; | 120 | return 0; |
121 | } | 121 | } |
122 | 122 | ||
123 | void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *oid, | 123 | void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *oid, |
124 | int lastpos, int type) | 124 | int lastpos, int type) |
125 | { | 125 | { |
126 | return X509at_get0_data_by_OBJ(si->signedAttrs, oid, lastpos, type); | 126 | return X509at_get0_data_by_OBJ(si->signedAttrs, oid, lastpos, type); |
127 | } | 127 | } |
128 | 128 | ||
129 | int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si) | 129 | int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si) |
130 | { | 130 | { |
131 | return X509at_get_attr_count(si->unsignedAttrs); | 131 | return X509at_get_attr_count(si->unsignedAttrs); |
132 | } | 132 | } |
133 | 133 | ||
134 | int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid, | 134 | int CMS_unsigned_get_attr_by_NID(const CMS_SignerInfo *si, int nid, |
135 | int lastpos) | 135 | int lastpos) |
136 | { | 136 | { |
137 | return X509at_get_attr_by_NID(si->unsignedAttrs, nid, lastpos); | 137 | return X509at_get_attr_by_NID(si->unsignedAttrs, nid, lastpos); |
138 | } | 138 | } |
139 | 139 | ||
140 | int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, | 140 | int CMS_unsigned_get_attr_by_OBJ(const CMS_SignerInfo *si, |
141 | const ASN1_OBJECT *obj, int lastpos) | 141 | const ASN1_OBJECT *obj, int lastpos) |
142 | { | 142 | { |
143 | return X509at_get_attr_by_OBJ(si->unsignedAttrs, obj, lastpos); | 143 | return X509at_get_attr_by_OBJ(si->unsignedAttrs, obj, lastpos); |
144 | } | 144 | } |
145 | 145 | ||
146 | X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc) | 146 | X509_ATTRIBUTE *CMS_unsigned_get_attr(const CMS_SignerInfo *si, int loc) |
147 | { | 147 | { |
148 | return X509at_get_attr(si->unsignedAttrs, loc); | 148 | return X509at_get_attr(si->unsignedAttrs, loc); |
149 | } | 149 | } |
150 | 150 | ||
151 | X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc) | 151 | X509_ATTRIBUTE *CMS_unsigned_delete_attr(CMS_SignerInfo *si, int loc) |
152 | { | 152 | { |
153 | return X509at_delete_attr(si->unsignedAttrs, loc); | 153 | return X509at_delete_attr(si->unsignedAttrs, loc); |
154 | } | 154 | } |
155 | 155 | ||
156 | int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr) | 156 | int CMS_unsigned_add1_attr(CMS_SignerInfo *si, X509_ATTRIBUTE *attr) |
157 | { | 157 | { |
158 | if (X509at_add1_attr(&si->unsignedAttrs, attr)) | 158 | if (X509at_add1_attr(&si->unsignedAttrs, attr)) |
159 | return 1; | 159 | return 1; |
160 | return 0; | 160 | return 0; |
161 | } | 161 | } |
162 | 162 | ||
163 | int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, | 163 | int CMS_unsigned_add1_attr_by_OBJ(CMS_SignerInfo *si, |
164 | const ASN1_OBJECT *obj, int type, | 164 | const ASN1_OBJECT *obj, int type, |
165 | const void *bytes, int len) | 165 | const void *bytes, int len) |
166 | { | 166 | { |
167 | if (X509at_add1_attr_by_OBJ(&si->unsignedAttrs, obj, type, bytes, len)) | 167 | if (X509at_add1_attr_by_OBJ(&si->unsignedAttrs, obj, type, bytes, len)) |
168 | return 1; | 168 | return 1; |
169 | return 0; | 169 | return 0; |
170 | } | 170 | } |
171 | 171 | ||
172 | int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, | 172 | int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si, |
173 | int nid, int type, | 173 | int nid, int type, |
174 | const void *bytes, int len) | 174 | const void *bytes, int len) |
175 | { | 175 | { |
176 | if (X509at_add1_attr_by_NID(&si->unsignedAttrs, nid, type, bytes, len)) | 176 | if (X509at_add1_attr_by_NID(&si->unsignedAttrs, nid, type, bytes, len)) |
177 | return 1; | 177 | return 1; |
178 | return 0; | 178 | return 0; |
179 | } | 179 | } |
180 | 180 | ||
181 | int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, | 181 | int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si, |
182 | const char *attrname, int type, | 182 | const char *attrname, int type, |
183 | const void *bytes, int len) | 183 | const void *bytes, int len) |
184 | { | 184 | { |
185 | if (X509at_add1_attr_by_txt(&si->unsignedAttrs, attrname, | 185 | if (X509at_add1_attr_by_txt(&si->unsignedAttrs, attrname, |
186 | type, bytes, len)) | 186 | type, bytes, len)) |
187 | return 1; | 187 | return 1; |
188 | return 0; | 188 | return 0; |
189 | } | 189 | } |
190 | 190 | ||
191 | void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, | 191 | void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid, |
192 | int lastpos, int type) | 192 | int lastpos, int type) |
193 | { | 193 | { |
194 | return X509at_get0_data_by_OBJ(si->unsignedAttrs, oid, lastpos, type); | 194 | return X509at_get0_data_by_OBJ(si->unsignedAttrs, oid, lastpos, type); |
195 | } | 195 | } |
196 | 196 | ||
197 | /* Specific attribute cases */ | 197 | /* Specific attribute cases */ |