security/nss/lib/jar/jarint.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 /* JAR internal routines */
     7 #include "nspr.h"
     8 #include "key.h"
     9 #include "base64.h"
    11 extern CERTCertDBHandle *JAR_open_database (void);
    13 extern int JAR_close_database (CERTCertDBHandle *certdb);
    15 extern int jar_close_key_database (void *keydb);
    17 extern void *jar_open_key_database (void);
    19 extern JAR_Signer *JAR_new_signer (void);
    21 extern void JAR_destroy_signer (JAR_Signer *signer);
    23 extern JAR_Signer *jar_get_signer (JAR *jar, char *basename);
    25 extern int 
    26 jar_append(ZZList *list, int type, char *pathname, void *data, size_t size);
    28 /* Translate fopen mode arg to PR_Open flags and mode */
    29 PRFileDesc*
    30 JAR_FOPEN_to_PR_Open(const char *name, const char *mode);
    32 #define ADDITEM(list,type,pathname,data,size) \
    33 { \
    34     int err = jar_append (list, type, pathname, data, size); \
    35     if (err < 0) \
    36     	return err; \
    37 }
    39 /* Here is some ugliness in the event it is necessary to link
    40    with NSPR 1.0 libraries, which do not include an FSEEK. It is
    41    difficult to fudge an FSEEK into 1.0 so we use stdio. */
    43 /* nspr 2.0 suite */
    44 #define JAR_FILE PRFileDesc *
    45 #define JAR_FOPEN(fn,mode) JAR_FOPEN_to_PR_Open(fn,mode)
    46 #define JAR_FCLOSE PR_Close
    47 #define JAR_FSEEK PR_Seek
    48 #define JAR_FREAD PR_Read
    49 #define JAR_FWRITE PR_Write
    51 int 
    52 jar_create_pk7(CERTCertDBHandle *certdb, void *keydb,
    53                CERTCertificate *cert, char *password, JAR_FILE infp,
    54                JAR_FILE outfp);

mercurial