]> git.saurik.com Git - apple/security.git/blobdiff - libsecurity_smime/lib/cmslocal.h
Security-58286.1.32.tar.gz
[apple/security.git] / libsecurity_smime / lib / cmslocal.h
index abda2456047272a8b9262ff5fd8fa8a687d8dc24..7be1a4972c4a4ee0d5e801a2c8e8f79bbaf1ab76 100644 (file)
 #include <Security/secasn1t.h>
 
 extern const SecAsn1Template SecCmsIssuerAndSNTemplate[];
+#if 0
 extern const SecAsn1Template SecCmsContentInfoTemplate[];
+#endif
+extern const SecAsn1Template *nss_cms_get_kea_template(SecCmsKEATemplateSelector whichTemplate);
 
 /************************************************************************/
 SEC_BEGIN_PROTOS
@@ -88,8 +91,8 @@ SecCmsCipherContextDestroy(SecCmsCipherContextRef cc);
  * we see the data we do not know how many padding bytes there are
  * (always between 1 and bsize).
  */
-extern size_t
-SecCmsCipherContextDecryptLength(SecCmsCipherContextRef cc, size_t input_len, Boolean final);
+extern unsigned int
+SecCmsCipherContextDecryptLength(SecCmsCipherContextRef cc, unsigned int input_len, Boolean final);
 
 /*
  * SecCmsCipherContextEncryptLength - find the output length of the next call to encrypt.
@@ -100,8 +103,8 @@ SecCmsCipherContextDecryptLength(SecCmsCipherContextRef cc, size_t input_len, Bo
  *
  * Result can be used to perform memory allocations.
  */
-extern size_t
-SecCmsCipherContextEncryptLength(SecCmsCipherContextRef cc, size_t input_len, Boolean final);
+extern unsigned int
+SecCmsCipherContextEncryptLength(SecCmsCipherContextRef cc, unsigned int input_len, Boolean final);
 
 /*
  * SecCmsCipherContextDecrypt - do the decryption
@@ -122,8 +125,8 @@ SecCmsCipherContextEncryptLength(SecCmsCipherContextRef cc, size_t input_len, Bo
  */ 
 extern OSStatus
 SecCmsCipherContextDecrypt(SecCmsCipherContextRef cc, unsigned char *output,
-                 size_t *output_len_p, size_t max_output_len,
-                 const unsigned char *input, size_t input_len,
+                 unsigned int *output_len_p, unsigned int max_output_len,
+                 const unsigned char *input, unsigned int input_len,
                  Boolean final);
 
 /*
@@ -145,8 +148,8 @@ SecCmsCipherContextDecrypt(SecCmsCipherContextRef cc, unsigned char *output,
  */ 
 extern OSStatus
 SecCmsCipherContextEncrypt(SecCmsCipherContextRef cc, unsigned char *output,
-                 size_t *output_len_p, size_t max_output_len,
-                 const unsigned char *input, size_t input_len,
+                 unsigned int *output_len_p, unsigned int max_output_len,
+                 const unsigned char *input, unsigned int input_len,
                  Boolean final);
 
 /************************************************************************
@@ -162,12 +165,12 @@ SecCmsCipherContextEncrypt(SecCmsCipherContextRef cc, unsigned char *output,
 extern OSStatus
 SecCmsUtilEncryptSymKeyRSA(PLArenaPool *poolp, SecCertificateRef cert,
                               SecSymmetricKeyRef key,
-                              CSSM_DATA_PTR encKey);
+                              SecAsn1Item * encKey);
 
 extern OSStatus
 SecCmsUtilEncryptSymKeyRSAPubKey(PLArenaPool *poolp,
                                     SecPublicKeyRef publickey,
-                                    SecSymmetricKeyRef bulkkey, CSSM_DATA_PTR encKey);
+                                    SecSymmetricKeyRef bulkkey, SecAsn1Item * encKey);
 
 /*
  * SecCmsUtilDecryptSymKeyRSA - unwrap a RSA-wrapped symmetric key
@@ -177,33 +180,33 @@ SecCmsUtilEncryptSymKeyRSAPubKey(PLArenaPool *poolp,
  * a hardware token...
  */
 extern SecSymmetricKeyRef
-SecCmsUtilDecryptSymKeyRSA(SecPrivateKeyRef privkey, CSSM_DATA_PTR encKey, SECOidTag bulkalgtag);
+SecCmsUtilDecryptSymKeyRSA(SecPrivateKeyRef privkey, SecAsn1Item * encKey, SECOidTag bulkalgtag);
 
 extern OSStatus
 SecCmsUtilEncryptSymKeyECDH(PLArenaPool *poolp, SecCertificateRef cert, SecSymmetricKeyRef key,
-                       CSSM_DATA_PTR encKey, CSSM_DATA_PTR ukm, SECAlgorithmID *keyEncAlg,
-                       CSSM_DATA_PTR originatorPubKey);
+                            SecAsn1Item * encKey, SecAsn1Item * ukm, SECAlgorithmID *keyEncAlg,
+                            SecAsn1Item * originatorPubKey);
 
 extern SecSymmetricKeyRef
-SecCmsUtilDecryptSymKeyECDH(SecPrivateKeyRef privkey, CSSM_DATA_PTR encKey, CSSM_DATA_PTR ukm,
-    SECAlgorithmID *keyEncAlg, SECOidTag bulkalgtag, CSSM_DATA_PTR pubKey);
+SecCmsUtilDecryptSymKeyECDH(SecPrivateKeyRef privkey, SecAsn1Item * encKey, SecAsn1Item * ukm,
+                            SECAlgorithmID *keyEncAlg, SECOidTag bulkalgtag, SecAsn1Item * pubKey);
 
 #if 0
 extern OSStatus
 SecCmsUtilEncryptSymKeyMISSI(PLArenaPool *poolp, SecCertificateRef cert, SecSymmetricKeyRef key,
-                       SECOidTag symalgtag, CSSM_DATA_PTR encKey, CSSM_DATA_PTR *pparams, void *pwfn_arg);
+                       SECOidTag symalgtag, SecAsn1Item * encKey, SecAsn1Item * *pparams, void *pwfn_arg);
 
 extern SecSymmetricKeyRef
-SecCmsUtilDecryptSymKeyMISSI(SecPrivateKeyRef privkey, CSSM_DATA_PTR encKey,
+SecCmsUtilDecryptSymKeyMISSI(SecPrivateKeyRef privkey, SecAsn1Item * encKey,
                        SECAlgorithmID *keyEncAlg, SECOidTag bulkalgtag, void *pwfn_arg);
 
 extern OSStatus
 SecCmsUtilEncryptSymKeyESDH(PLArenaPool *poolp, SecCertificateRef cert, SecSymmetricKeyRef key,
-                       CSSM_DATA_PTR encKey, CSSM_DATA_PTR ukm, SECAlgorithmID *keyEncAlg,
-                       CSSM_DATA_PTR originatorPubKey);
+                       SecAsn1Item * encKey, SecAsn1Item * *ukm, SECAlgorithmID *keyEncAlg,
+                       SecAsn1Item * originatorPubKey);
 
 extern SecSymmetricKeyRef
-SecCmsUtilDecryptSymKeyESDH(SecPrivateKeyRef privkey, CSSM_DATA_PTR encKey,
+SecCmsUtilDecryptSymKeyESDH(SecPrivateKeyRef privkey, SecAsn1Item * encKey,
                        SECAlgorithmID *keyEncAlg, SECOidTag bulkalgtag, void *pwfn_arg);
 #endif
 
@@ -264,13 +267,13 @@ SecCmsArraySort(void **primary, int (*compare)(void *,void *), void **secondary,
  * with SecCmsAttributeAddValue.
  */
 extern SecCmsAttribute *
-SecCmsAttributeCreate(PRArenaPool *poolp, SECOidTag oidtag, CSSM_DATA_PTR value, Boolean encoded);
+SecCmsAttributeCreate(PRArenaPool *poolp, SECOidTag oidtag, SecAsn1Item * value, Boolean encoded);
 
 /*
  * SecCmsAttributeAddValue - add another value to an attribute
  */
 extern OSStatus
-SecCmsAttributeAddValue(PLArenaPool *poolp, SecCmsAttribute *attr, CSSM_DATA_PTR value);
+SecCmsAttributeAddValue(PLArenaPool *poolp, SecCmsAttribute *attr, SecAsn1Item * value);
 
 /*
  * SecCmsAttributeGetType - return the OID tag
@@ -285,14 +288,14 @@ SecCmsAttributeGetType(SecCmsAttribute *attr);
  * - Multiple values are *not* expected.
  * - Empty values are *not* expected.
  */
-extern CSSM_DATA_PTR
+extern SecAsn1Item *
 SecCmsAttributeGetValue(SecCmsAttribute *attr);
 
 /*
  * SecCmsAttributeCompareValue - compare the attribute's first value against data
  */
 extern Boolean
-SecCmsAttributeCompareValue(SecCmsAttribute *attr, CSSM_DATA_PTR av);
+SecCmsAttributeCompareValue(SecCmsAttribute *attr, SecAsn1Item * av);
 
 /*
  * SecCmsAttributeArrayEncode - encode an Attribute array as SET OF Attributes
@@ -303,8 +306,8 @@ SecCmsAttributeCompareValue(SecCmsAttribute *attr, CSSM_DATA_PTR av);
  * and think long and hard about the implications of making it always
  * do the reordering.)
  */
-extern CSSM_DATA_PTR
-SecCmsAttributeArrayEncode(PRArenaPool *poolp, SecCmsAttribute ***attrs, CSSM_DATA_PTR dest);
+extern SecAsn1Item *
+SecCmsAttributeArrayEncode(PRArenaPool *poolp, SecCmsAttribute ***attrs, SecAsn1Item * dest);
 
 /*
  * SecCmsAttributeArrayReorder - sort attribute array by attribute's DER encoding
@@ -338,7 +341,7 @@ SecCmsAttributeArrayAddAttr(PLArenaPool *poolp, SecCmsAttribute ***attrs, SecCms
  * SecCmsAttributeArraySetAttr - set an attribute's value in a set of attributes
  */
 extern OSStatus
-SecCmsAttributeArraySetAttr(PLArenaPool *poolp, SecCmsAttribute ***attrs, SECOidTag type, CSSM_DATA_PTR value, Boolean encoded);
+SecCmsAttributeArraySetAttr(PLArenaPool *poolp, SecCmsAttribute ***attrs, SECOidTag type, SecAsn1Item * value, Boolean encoded);
 
 /************************************************************************/
 SEC_END_PROTOS