diff options
| author | jsing <> | 2014-05-24 15:55:21 +0000 |
|---|---|---|
| committer | jsing <> | 2014-05-24 15:55:21 +0000 |
| commit | bc464fa25d879635ea0e36c398bb3a8881cf54e1 (patch) | |
| tree | 9e85cd03c39514d9c5edce1ab5a94a548e899f4b /src/lib/libcrypto/cms/cms_lcl.h | |
| parent | 1a70ddfa708874e092ea288b1cac7107cf6756cc (diff) | |
| download | openbsd-bc464fa25d879635ea0e36c398bb3a8881cf54e1.tar.gz openbsd-bc464fa25d879635ea0e36c398bb3a8881cf54e1.tar.bz2 openbsd-bc464fa25d879635ea0e36c398bb3a8881cf54e1.zip | |
KNF.
Diffstat (limited to 'src/lib/libcrypto/cms/cms_lcl.h')
| -rw-r--r-- | src/lib/libcrypto/cms/cms_lcl.h | 267 |
1 files changed, 116 insertions, 151 deletions
diff --git a/src/lib/libcrypto/cms/cms_lcl.h b/src/lib/libcrypto/cms/cms_lcl.h index a9f9730157..3c905342f4 100644 --- a/src/lib/libcrypto/cms/cms_lcl.h +++ b/src/lib/libcrypto/cms/cms_lcl.h | |||
| @@ -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 |
| @@ -93,10 +93,9 @@ typedef struct CMS_PasswordRecipientInfo_st CMS_PasswordRecipientInfo; | |||
| 93 | typedef struct CMS_OtherRecipientInfo_st CMS_OtherRecipientInfo; | 93 | typedef struct CMS_OtherRecipientInfo_st CMS_OtherRecipientInfo; |
| 94 | typedef struct CMS_ReceiptsFrom_st CMS_ReceiptsFrom; | 94 | typedef struct CMS_ReceiptsFrom_st CMS_ReceiptsFrom; |
| 95 | 95 | ||
| 96 | struct CMS_ContentInfo_st | 96 | struct CMS_ContentInfo_st { |
| 97 | { | ||
| 98 | ASN1_OBJECT *contentType; | 97 | ASN1_OBJECT *contentType; |
| 99 | union { | 98 | union { |
| 100 | ASN1_OCTET_STRING *data; | 99 | ASN1_OCTET_STRING *data; |
| 101 | CMS_SignedData *signedData; | 100 | CMS_SignedData *signedData; |
| 102 | CMS_EnvelopedData *envelopedData; | 101 | CMS_EnvelopedData *envelopedData; |
| @@ -107,29 +106,26 @@ struct CMS_ContentInfo_st | |||
| 107 | ASN1_TYPE *other; | 106 | ASN1_TYPE *other; |
| 108 | /* Other types ... */ | 107 | /* Other types ... */ |
| 109 | void *otherData; | 108 | void *otherData; |
| 110 | } d; | 109 | } d; |
| 111 | }; | 110 | }; |
| 112 | 111 | ||
| 113 | struct CMS_SignedData_st | 112 | struct CMS_SignedData_st { |
| 114 | { | ||
| 115 | long version; | 113 | long version; |
| 116 | STACK_OF(X509_ALGOR) *digestAlgorithms; | 114 | STACK_OF(X509_ALGOR) *digestAlgorithms; |
| 117 | CMS_EncapsulatedContentInfo *encapContentInfo; | 115 | CMS_EncapsulatedContentInfo *encapContentInfo; |
| 118 | STACK_OF(CMS_CertificateChoices) *certificates; | 116 | STACK_OF(CMS_CertificateChoices) *certificates; |
| 119 | STACK_OF(CMS_RevocationInfoChoice) *crls; | 117 | STACK_OF(CMS_RevocationInfoChoice) *crls; |
| 120 | STACK_OF(CMS_SignerInfo) *signerInfos; | 118 | STACK_OF(CMS_SignerInfo) *signerInfos; |
| 121 | }; | 119 | }; |
| 122 | 120 | ||
| 123 | struct CMS_EncapsulatedContentInfo_st | 121 | struct CMS_EncapsulatedContentInfo_st { |
| 124 | { | ||
| 125 | ASN1_OBJECT *eContentType; | 122 | ASN1_OBJECT *eContentType; |
| 126 | ASN1_OCTET_STRING *eContent; | 123 | ASN1_OCTET_STRING *eContent; |
| 127 | /* Set to 1 if incomplete structure only part set up */ | 124 | /* Set to 1 if incomplete structure only part set up */ |
| 128 | int partial; | 125 | int partial; |
| 129 | }; | 126 | }; |
| 130 | 127 | ||
| 131 | struct CMS_SignerInfo_st | 128 | struct CMS_SignerInfo_st { |
| 132 | { | ||
| 133 | long version; | 129 | long version; |
| 134 | CMS_SignerIdentifier *sid; | 130 | CMS_SignerIdentifier *sid; |
| 135 | X509_ALGOR *digestAlgorithm; | 131 | X509_ALGOR *digestAlgorithm; |
| @@ -140,34 +136,30 @@ struct CMS_SignerInfo_st | |||
| 140 | /* Signing certificate and key */ | 136 | /* Signing certificate and key */ |
| 141 | X509 *signer; | 137 | X509 *signer; |
| 142 | EVP_PKEY *pkey; | 138 | EVP_PKEY *pkey; |
| 143 | }; | 139 | }; |
| 144 | 140 | ||
| 145 | struct CMS_SignerIdentifier_st | 141 | struct CMS_SignerIdentifier_st { |
| 146 | { | ||
| 147 | int type; | 142 | int type; |
| 148 | union { | 143 | union { |
| 149 | CMS_IssuerAndSerialNumber *issuerAndSerialNumber; | 144 | CMS_IssuerAndSerialNumber *issuerAndSerialNumber; |
| 150 | ASN1_OCTET_STRING *subjectKeyIdentifier; | 145 | ASN1_OCTET_STRING *subjectKeyIdentifier; |
| 151 | } d; | 146 | } d; |
| 152 | }; | 147 | }; |
| 153 | 148 | ||
| 154 | struct CMS_EnvelopedData_st | 149 | struct CMS_EnvelopedData_st { |
| 155 | { | ||
| 156 | long version; | 150 | long version; |
| 157 | CMS_OriginatorInfo *originatorInfo; | 151 | CMS_OriginatorInfo *originatorInfo; |
| 158 | STACK_OF(CMS_RecipientInfo) *recipientInfos; | 152 | STACK_OF(CMS_RecipientInfo) *recipientInfos; |
| 159 | CMS_EncryptedContentInfo *encryptedContentInfo; | 153 | CMS_EncryptedContentInfo *encryptedContentInfo; |
| 160 | STACK_OF(X509_ATTRIBUTE) *unprotectedAttrs; | 154 | STACK_OF(X509_ATTRIBUTE) *unprotectedAttrs; |
| 161 | }; | 155 | }; |
| 162 | 156 | ||
| 163 | struct CMS_OriginatorInfo_st | 157 | struct CMS_OriginatorInfo_st { |
| 164 | { | ||
| 165 | STACK_OF(CMS_CertificateChoices) *certificates; | 158 | STACK_OF(CMS_CertificateChoices) *certificates; |
| 166 | STACK_OF(CMS_RevocationInfoChoice) *crls; | 159 | STACK_OF(CMS_RevocationInfoChoice) *crls; |
| 167 | }; | 160 | }; |
| 168 | 161 | ||
| 169 | struct CMS_EncryptedContentInfo_st | 162 | struct CMS_EncryptedContentInfo_st { |
| 170 | { | ||
| 171 | ASN1_OBJECT *contentType; | 163 | ASN1_OBJECT *contentType; |
| 172 | X509_ALGOR *contentEncryptionAlgorithm; | 164 | X509_ALGOR *contentEncryptionAlgorithm; |
| 173 | ASN1_OCTET_STRING *encryptedContent; | 165 | ASN1_OCTET_STRING *encryptedContent; |
| @@ -177,24 +169,22 @@ struct CMS_EncryptedContentInfo_st | |||
| 177 | size_t keylen; | 169 | size_t keylen; |
| 178 | /* Set to 1 if we are debugging decrypt and don't fake keys for MMA */ | 170 | /* Set to 1 if we are debugging decrypt and don't fake keys for MMA */ |
| 179 | int debug; | 171 | int debug; |
| 180 | }; | 172 | }; |
| 181 | 173 | ||
| 182 | struct CMS_RecipientInfo_st | 174 | struct CMS_RecipientInfo_st { |
| 183 | { | 175 | int type; |
| 184 | int type; | 176 | union { |
| 185 | union { | 177 | CMS_KeyTransRecipientInfo *ktri; |
| 186 | CMS_KeyTransRecipientInfo *ktri; | 178 | CMS_KeyAgreeRecipientInfo *kari; |
| 187 | CMS_KeyAgreeRecipientInfo *kari; | 179 | CMS_KEKRecipientInfo *kekri; |
| 188 | CMS_KEKRecipientInfo *kekri; | ||
| 189 | CMS_PasswordRecipientInfo *pwri; | 180 | CMS_PasswordRecipientInfo *pwri; |
| 190 | CMS_OtherRecipientInfo *ori; | 181 | CMS_OtherRecipientInfo *ori; |
| 191 | } d; | 182 | } d; |
| 192 | }; | 183 | }; |
| 193 | 184 | ||
| 194 | typedef CMS_SignerIdentifier CMS_RecipientIdentifier; | 185 | typedef CMS_SignerIdentifier CMS_RecipientIdentifier; |
| 195 | 186 | ||
| 196 | struct CMS_KeyTransRecipientInfo_st | 187 | struct CMS_KeyTransRecipientInfo_st { |
| 197 | { | ||
| 198 | long version; | 188 | long version; |
| 199 | CMS_RecipientIdentifier *rid; | 189 | CMS_RecipientIdentifier *rid; |
| 200 | X509_ALGOR *keyEncryptionAlgorithm; | 190 | X509_ALGOR *keyEncryptionAlgorithm; |
| @@ -202,107 +192,94 @@ struct CMS_KeyTransRecipientInfo_st | |||
| 202 | /* Recipient Key and cert */ | 192 | /* Recipient Key and cert */ |
| 203 | X509 *recip; | 193 | X509 *recip; |
| 204 | EVP_PKEY *pkey; | 194 | EVP_PKEY *pkey; |
| 205 | }; | 195 | }; |
| 206 | 196 | ||
| 207 | struct CMS_KeyAgreeRecipientInfo_st | 197 | struct CMS_KeyAgreeRecipientInfo_st { |
| 208 | { | ||
| 209 | long version; | 198 | long version; |
| 210 | CMS_OriginatorIdentifierOrKey *originator; | 199 | CMS_OriginatorIdentifierOrKey *originator; |
| 211 | ASN1_OCTET_STRING *ukm; | 200 | ASN1_OCTET_STRING *ukm; |
| 212 | X509_ALGOR *keyEncryptionAlgorithm; | 201 | X509_ALGOR *keyEncryptionAlgorithm; |
| 213 | STACK_OF(CMS_RecipientEncryptedKey) *recipientEncryptedKeys; | 202 | STACK_OF(CMS_RecipientEncryptedKey) *recipientEncryptedKeys; |
| 214 | }; | 203 | }; |
| 215 | 204 | ||
| 216 | struct CMS_OriginatorIdentifierOrKey_st | 205 | struct CMS_OriginatorIdentifierOrKey_st { |
| 217 | { | ||
| 218 | int type; | 206 | int type; |
| 219 | union { | 207 | union { |
| 220 | CMS_IssuerAndSerialNumber *issuerAndSerialNumber; | 208 | CMS_IssuerAndSerialNumber *issuerAndSerialNumber; |
| 221 | ASN1_OCTET_STRING *subjectKeyIdentifier; | 209 | ASN1_OCTET_STRING *subjectKeyIdentifier; |
| 222 | CMS_OriginatorPublicKey *originatorKey; | 210 | CMS_OriginatorPublicKey *originatorKey; |
| 223 | } d; | 211 | } d; |
| 224 | }; | 212 | }; |
| 225 | 213 | ||
| 226 | struct CMS_OriginatorPublicKey_st | 214 | struct CMS_OriginatorPublicKey_st { |
| 227 | { | ||
| 228 | X509_ALGOR *algorithm; | 215 | X509_ALGOR *algorithm; |
| 229 | ASN1_BIT_STRING *publicKey; | 216 | ASN1_BIT_STRING *publicKey; |
| 230 | }; | 217 | }; |
| 231 | 218 | ||
| 232 | struct CMS_RecipientEncryptedKey_st | 219 | struct CMS_RecipientEncryptedKey_st { |
| 233 | { | 220 | CMS_KeyAgreeRecipientIdentifier *rid; |
| 234 | CMS_KeyAgreeRecipientIdentifier *rid; | 221 | ASN1_OCTET_STRING *encryptedKey; |
| 235 | ASN1_OCTET_STRING *encryptedKey; | 222 | }; |
| 236 | }; | ||
| 237 | 223 | ||
| 238 | struct CMS_KeyAgreeRecipientIdentifier_st | 224 | struct CMS_KeyAgreeRecipientIdentifier_st { |
| 239 | { | ||
| 240 | int type; | 225 | int type; |
| 241 | union { | 226 | union { |
| 242 | CMS_IssuerAndSerialNumber *issuerAndSerialNumber; | 227 | CMS_IssuerAndSerialNumber *issuerAndSerialNumber; |
| 243 | CMS_RecipientKeyIdentifier *rKeyId; | 228 | CMS_RecipientKeyIdentifier *rKeyId; |
| 244 | } d; | 229 | } d; |
| 245 | }; | 230 | }; |
| 246 | 231 | ||
| 247 | struct CMS_RecipientKeyIdentifier_st | 232 | struct CMS_RecipientKeyIdentifier_st { |
| 248 | { | 233 | ASN1_OCTET_STRING *subjectKeyIdentifier; |
| 249 | ASN1_OCTET_STRING *subjectKeyIdentifier; | 234 | ASN1_GENERALIZEDTIME *date; |
| 250 | ASN1_GENERALIZEDTIME *date; | 235 | CMS_OtherKeyAttribute *other; |
| 251 | CMS_OtherKeyAttribute *other; | 236 | }; |
| 252 | }; | ||
| 253 | 237 | ||
| 254 | struct CMS_KEKRecipientInfo_st | 238 | struct CMS_KEKRecipientInfo_st { |
| 255 | { | 239 | long version; |
| 256 | long version; | 240 | CMS_KEKIdentifier *kekid; |
| 257 | CMS_KEKIdentifier *kekid; | 241 | X509_ALGOR *keyEncryptionAlgorithm; |
| 258 | X509_ALGOR *keyEncryptionAlgorithm; | 242 | ASN1_OCTET_STRING *encryptedKey; |
| 259 | ASN1_OCTET_STRING *encryptedKey; | ||
| 260 | /* Extra info: symmetric key to use */ | 243 | /* Extra info: symmetric key to use */ |
| 261 | unsigned char *key; | 244 | unsigned char *key; |
| 262 | size_t keylen; | 245 | size_t keylen; |
| 263 | }; | 246 | }; |
| 264 | 247 | ||
| 265 | struct CMS_KEKIdentifier_st | 248 | struct CMS_KEKIdentifier_st { |
| 266 | { | 249 | ASN1_OCTET_STRING *keyIdentifier; |
| 267 | ASN1_OCTET_STRING *keyIdentifier; | 250 | ASN1_GENERALIZEDTIME *date; |
| 268 | ASN1_GENERALIZEDTIME *date; | 251 | CMS_OtherKeyAttribute *other; |
| 269 | CMS_OtherKeyAttribute *other; | 252 | }; |
| 270 | }; | ||
| 271 | 253 | ||
| 272 | struct CMS_PasswordRecipientInfo_st | 254 | struct CMS_PasswordRecipientInfo_st { |
| 273 | { | 255 | long version; |
| 274 | long version; | 256 | X509_ALGOR *keyDerivationAlgorithm; |
| 275 | X509_ALGOR *keyDerivationAlgorithm; | 257 | X509_ALGOR *keyEncryptionAlgorithm; |
| 276 | X509_ALGOR *keyEncryptionAlgorithm; | 258 | ASN1_OCTET_STRING *encryptedKey; |
| 277 | ASN1_OCTET_STRING *encryptedKey; | ||
| 278 | /* Extra info: password to use */ | 259 | /* Extra info: password to use */ |
| 279 | unsigned char *pass; | 260 | unsigned char *pass; |
| 280 | size_t passlen; | 261 | size_t passlen; |
| 281 | }; | 262 | }; |
| 282 | 263 | ||
| 283 | struct CMS_OtherRecipientInfo_st | 264 | struct CMS_OtherRecipientInfo_st { |
| 284 | { | 265 | ASN1_OBJECT *oriType; |
| 285 | ASN1_OBJECT *oriType; | 266 | ASN1_TYPE *oriValue; |
| 286 | ASN1_TYPE *oriValue; | 267 | }; |
| 287 | }; | ||
| 288 | 268 | ||
| 289 | struct CMS_DigestedData_st | 269 | struct CMS_DigestedData_st { |
| 290 | { | ||
| 291 | long version; | 270 | long version; |
| 292 | X509_ALGOR *digestAlgorithm; | 271 | X509_ALGOR *digestAlgorithm; |
| 293 | CMS_EncapsulatedContentInfo *encapContentInfo; | 272 | CMS_EncapsulatedContentInfo *encapContentInfo; |
| 294 | ASN1_OCTET_STRING *digest; | 273 | ASN1_OCTET_STRING *digest; |
| 295 | }; | 274 | }; |
| 296 | 275 | ||
| 297 | struct CMS_EncryptedData_st | 276 | struct CMS_EncryptedData_st { |
| 298 | { | ||
| 299 | long version; | 277 | long version; |
| 300 | CMS_EncryptedContentInfo *encryptedContentInfo; | 278 | CMS_EncryptedContentInfo *encryptedContentInfo; |
| 301 | STACK_OF(X509_ATTRIBUTE) *unprotectedAttrs; | 279 | STACK_OF(X509_ATTRIBUTE) *unprotectedAttrs; |
| 302 | }; | 280 | }; |
| 303 | 281 | ||
| 304 | struct CMS_AuthenticatedData_st | 282 | struct CMS_AuthenticatedData_st { |
| 305 | { | ||
| 306 | long version; | 283 | long version; |
| 307 | CMS_OriginatorInfo *originatorInfo; | 284 | CMS_OriginatorInfo *originatorInfo; |
| 308 | STACK_OF(CMS_RecipientInfo) *recipientInfos; | 285 | STACK_OF(CMS_RecipientInfo) *recipientInfos; |
| @@ -312,45 +289,41 @@ struct CMS_AuthenticatedData_st | |||
| 312 | STACK_OF(X509_ATTRIBUTE) *authAttrs; | 289 | STACK_OF(X509_ATTRIBUTE) *authAttrs; |
| 313 | ASN1_OCTET_STRING *mac; | 290 | ASN1_OCTET_STRING *mac; |
| 314 | STACK_OF(X509_ATTRIBUTE) *unauthAttrs; | 291 | STACK_OF(X509_ATTRIBUTE) *unauthAttrs; |
| 315 | }; | 292 | }; |
| 316 | 293 | ||
| 317 | struct CMS_CompressedData_st | 294 | struct CMS_CompressedData_st { |
| 318 | { | ||
| 319 | long version; | 295 | long version; |
| 320 | X509_ALGOR *compressionAlgorithm; | 296 | X509_ALGOR *compressionAlgorithm; |
| 321 | STACK_OF(CMS_RecipientInfo) *recipientInfos; | 297 | STACK_OF(CMS_RecipientInfo) *recipientInfos; |
| 322 | CMS_EncapsulatedContentInfo *encapContentInfo; | 298 | CMS_EncapsulatedContentInfo *encapContentInfo; |
| 323 | }; | 299 | }; |
| 324 | 300 | ||
| 325 | struct CMS_RevocationInfoChoice_st | 301 | struct CMS_RevocationInfoChoice_st { |
| 326 | { | ||
| 327 | int type; | 302 | int type; |
| 328 | union { | 303 | union { |
| 329 | X509_CRL *crl; | 304 | X509_CRL *crl; |
| 330 | CMS_OtherRevocationInfoFormat *other; | 305 | CMS_OtherRevocationInfoFormat *other; |
| 331 | } d; | 306 | } d; |
| 332 | }; | 307 | }; |
| 333 | 308 | ||
| 334 | #define CMS_REVCHOICE_CRL 0 | 309 | #define CMS_REVCHOICE_CRL 0 |
| 335 | #define CMS_REVCHOICE_OTHER 1 | 310 | #define CMS_REVCHOICE_OTHER 1 |
| 336 | 311 | ||
| 337 | struct CMS_OtherRevocationInfoFormat_st | 312 | struct CMS_OtherRevocationInfoFormat_st { |
| 338 | { | ||
| 339 | ASN1_OBJECT *otherRevInfoFormat; | 313 | ASN1_OBJECT *otherRevInfoFormat; |
| 340 | ASN1_TYPE *otherRevInfo; | 314 | ASN1_TYPE *otherRevInfo; |
| 341 | }; | 315 | }; |
| 342 | 316 | ||
| 343 | struct CMS_CertificateChoices | 317 | struct CMS_CertificateChoices { |
| 344 | { | ||
| 345 | int type; | 318 | int type; |
| 346 | union { | 319 | union { |
| 347 | X509 *certificate; | 320 | X509 *certificate; |
| 348 | ASN1_STRING *extendedCertificate; /* Obsolete */ | 321 | ASN1_STRING *extendedCertificate; /* Obsolete */ |
| 349 | ASN1_STRING *v1AttrCert; /* Left encoded for now */ | 322 | ASN1_STRING *v1AttrCert; /* Left encoded for now */ |
| 350 | ASN1_STRING *v2AttrCert; /* Left encoded for now */ | 323 | ASN1_STRING *v2AttrCert; /* Left encoded for now */ |
| 351 | CMS_OtherCertificateFormat *other; | 324 | CMS_OtherCertificateFormat *other; |
| 352 | } d; | 325 | } d; |
| 353 | }; | 326 | }; |
| 354 | 327 | ||
| 355 | #define CMS_CERTCHOICE_CERT 0 | 328 | #define CMS_CERTCHOICE_CERT 0 |
| 356 | #define CMS_CERTCHOICE_EXCERT 1 | 329 | #define CMS_CERTCHOICE_EXCERT 1 |
| @@ -358,58 +331,52 @@ struct CMS_CertificateChoices | |||
| 358 | #define CMS_CERTCHOICE_V2ACERT 3 | 331 | #define CMS_CERTCHOICE_V2ACERT 3 |
| 359 | #define CMS_CERTCHOICE_OTHER 4 | 332 | #define CMS_CERTCHOICE_OTHER 4 |
| 360 | 333 | ||
| 361 | struct CMS_OtherCertificateFormat_st | 334 | struct CMS_OtherCertificateFormat_st { |
| 362 | { | ||
| 363 | ASN1_OBJECT *otherCertFormat; | 335 | ASN1_OBJECT *otherCertFormat; |
| 364 | ASN1_TYPE *otherCert; | 336 | ASN1_TYPE *otherCert; |
| 365 | }; | 337 | }; |
| 366 | 338 | ||
| 367 | /* This is also defined in pkcs7.h but we duplicate it | 339 | /* This is also defined in pkcs7.h but we duplicate it |
| 368 | * to allow the CMS code to be independent of PKCS#7 | 340 | * to allow the CMS code to be independent of PKCS#7 |
| 369 | */ | 341 | */ |
| 370 | 342 | ||
| 371 | struct CMS_IssuerAndSerialNumber_st | 343 | struct CMS_IssuerAndSerialNumber_st { |
| 372 | { | ||
| 373 | X509_NAME *issuer; | 344 | X509_NAME *issuer; |
| 374 | ASN1_INTEGER *serialNumber; | 345 | ASN1_INTEGER *serialNumber; |
| 375 | }; | 346 | }; |
| 376 | 347 | ||
| 377 | struct CMS_OtherKeyAttribute_st | 348 | struct CMS_OtherKeyAttribute_st { |
| 378 | { | ||
| 379 | ASN1_OBJECT *keyAttrId; | 349 | ASN1_OBJECT *keyAttrId; |
| 380 | ASN1_TYPE *keyAttr; | 350 | ASN1_TYPE *keyAttr; |
| 381 | }; | 351 | }; |
| 382 | 352 | ||
| 383 | /* ESS structures */ | 353 | /* ESS structures */ |
| 384 | 354 | ||
| 385 | #ifdef HEADER_X509V3_H | 355 | #ifdef HEADER_X509V3_H |
| 386 | 356 | ||
| 387 | struct CMS_ReceiptRequest_st | 357 | struct CMS_ReceiptRequest_st { |
| 388 | { | ||
| 389 | ASN1_OCTET_STRING *signedContentIdentifier; | 358 | ASN1_OCTET_STRING *signedContentIdentifier; |
| 390 | CMS_ReceiptsFrom *receiptsFrom; | 359 | CMS_ReceiptsFrom *receiptsFrom; |
| 391 | STACK_OF(GENERAL_NAMES) *receiptsTo; | 360 | STACK_OF(GENERAL_NAMES) *receiptsTo; |
| 392 | }; | 361 | }; |
| 393 | 362 | ||
| 394 | 363 | ||
| 395 | struct CMS_ReceiptsFrom_st | 364 | struct CMS_ReceiptsFrom_st { |
| 396 | { | ||
| 397 | int type; | 365 | int type; |
| 398 | union | 366 | union |
| 399 | { | 367 | { |
| 400 | long allOrFirstTier; | 368 | long allOrFirstTier; |
| 401 | STACK_OF(GENERAL_NAMES) *receiptList; | 369 | STACK_OF(GENERAL_NAMES) *receiptList; |
| 402 | } d; | 370 | } d; |
| 403 | }; | 371 | }; |
| 404 | #endif | 372 | #endif |
| 405 | 373 | ||
| 406 | struct CMS_Receipt_st | 374 | struct CMS_Receipt_st { |
| 407 | { | ||
| 408 | long version; | 375 | long version; |
| 409 | ASN1_OBJECT *contentType; | 376 | ASN1_OBJECT *contentType; |
| 410 | ASN1_OCTET_STRING *signedContentIdentifier; | 377 | ASN1_OCTET_STRING *signedContentIdentifier; |
| 411 | ASN1_OCTET_STRING *originatorSignatureValue; | 378 | ASN1_OCTET_STRING *originatorSignatureValue; |
| 412 | }; | 379 | }; |
| 413 | 380 | ||
| 414 | DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo) | 381 | DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo) |
| 415 | DECLARE_ASN1_ITEM(CMS_SignerInfo) | 382 | DECLARE_ASN1_ITEM(CMS_SignerInfo) |
| @@ -438,8 +405,7 @@ BIO *cms_SignedData_init_bio(CMS_ContentInfo *cms); | |||
| 438 | int cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain); | 405 | int cms_SignedData_final(CMS_ContentInfo *cms, BIO *chain); |
| 439 | int cms_set1_SignerIdentifier(CMS_SignerIdentifier *sid, X509 *cert, int type); | 406 | int cms_set1_SignerIdentifier(CMS_SignerIdentifier *sid, X509 *cert, int type); |
| 440 | int cms_SignerIdentifier_get0_signer_id(CMS_SignerIdentifier *sid, | 407 | int cms_SignerIdentifier_get0_signer_id(CMS_SignerIdentifier *sid, |
| 441 | ASN1_OCTET_STRING **keyid, | 408 | ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno); |
| 442 | X509_NAME **issuer, ASN1_INTEGER **sno); | ||
| 443 | int cms_SignerIdentifier_cert_cmp(CMS_SignerIdentifier *sid, X509 *cert); | 409 | int cms_SignerIdentifier_cert_cmp(CMS_SignerIdentifier *sid, X509 *cert); |
| 444 | 410 | ||
| 445 | CMS_ContentInfo *cms_CompressedData_create(int comp_nid); | 411 | CMS_ContentInfo *cms_CompressedData_create(int comp_nid); |
| @@ -448,13 +414,12 @@ BIO *cms_CompressedData_init_bio(CMS_ContentInfo *cms); | |||
| 448 | void cms_DigestAlgorithm_set(X509_ALGOR *alg, const EVP_MD *md); | 414 | void cms_DigestAlgorithm_set(X509_ALGOR *alg, const EVP_MD *md); |
| 449 | BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm); | 415 | BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm); |
| 450 | int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain, | 416 | int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain, |
| 451 | X509_ALGOR *mdalg); | 417 | X509_ALGOR *mdalg); |
| 452 | 418 | ||
| 453 | BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec); | 419 | BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec); |
| 454 | BIO *cms_EncryptedData_init_bio(CMS_ContentInfo *cms); | 420 | BIO *cms_EncryptedData_init_bio(CMS_ContentInfo *cms); |
| 455 | int cms_EncryptedContent_init(CMS_EncryptedContentInfo *ec, | 421 | int cms_EncryptedContent_init(CMS_EncryptedContentInfo *ec, |
| 456 | const EVP_CIPHER *cipher, | 422 | const EVP_CIPHER *cipher, const unsigned char *key, size_t keylen); |
| 457 | const unsigned char *key, size_t keylen); | ||
| 458 | 423 | ||
| 459 | int cms_Receipt_verify(CMS_ContentInfo *cms, CMS_ContentInfo *req_cms); | 424 | int cms_Receipt_verify(CMS_ContentInfo *cms, CMS_ContentInfo *req_cms); |
| 460 | int cms_msgSigDigest_add1(CMS_SignerInfo *dest, CMS_SignerInfo *src); | 425 | int cms_msgSigDigest_add1(CMS_SignerInfo *dest, CMS_SignerInfo *src); |
| @@ -465,8 +430,8 @@ CMS_EnvelopedData *cms_get0_enveloped(CMS_ContentInfo *cms); | |||
| 465 | 430 | ||
| 466 | /* PWRI routines */ | 431 | /* PWRI routines */ |
| 467 | int cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, | 432 | int cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, |
| 468 | int en_de); | 433 | int en_de); |
| 469 | 434 | ||
| 470 | #ifdef __cplusplus | 435 | #ifdef __cplusplus |
| 471 | } | 436 | } |
| 472 | #endif | 437 | #endif |
