home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / security / freenav / secstubn.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.6 KB  |  207 lines

  1. /*
  2.  * The contents of this file are subject to the Netscape Public License
  3.  * Version 1.0 (the "NPL"); you may not use this file except in
  4.  * compliance with the NPL.  You may obtain a copy of the NPL at
  5.  * http://www.mozilla.org/NPL/
  6.  *
  7.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  8.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  9.  * for the specific language governing rights and limitations under the
  10.  * NPL.
  11.  *
  12.  * The Initial Developer of this code under the NPL is Netscape
  13.  * Communications Corporation.  Portions created by Netscape are
  14.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  15.  * Reserved.
  16.  */
  17. #ifndef _SECSTUBN_H_
  18. #define _SECSTUBN_H_
  19.  
  20. #include "xp.h"
  21. #include "ntypes.h"
  22. #include "net.h"
  23.  
  24. typedef struct _digests DIGESTS;
  25. typedef struct _zig ZIG;
  26. typedef struct _zigcontext ZIG_Context;
  27. typedef struct _peheader PEHeader;
  28.  
  29. typedef struct SOBITEM_ {
  30.     char *pathname;
  31.     int type;
  32.     size_t size;
  33.     void *data;
  34. } SOBITEM;
  35.  
  36. typedef struct FINGERZIG_ {
  37.     size_t length;
  38.     void *key;
  39.     CERTCertificate *cert;
  40. } FINGERZIG;
  41.  
  42. #define ZIG_CB_SIGNAL 1
  43. #define ZIG_SIGN 10
  44. #define ZIG_F_GUESS 0
  45. #define ZIG_MF 2
  46. #define ZIG_ERR_PNF 12
  47.  
  48. SEC_BEGIN_PROTOS
  49.  
  50. void
  51. SECNAV_Posting(PRFileDesc *fd);
  52.  
  53. void
  54. SECNAV_HTTPHead(PRFileDesc *fd);
  55.  
  56. void
  57. SECNAV_RegisterNetlibMimeConverters();
  58.  
  59. char *
  60. SECNAV_MungeString(const char *unmunged_string);
  61.  
  62. char *
  63. SECNAV_UnMungeString(const char *munged_string);
  64.  
  65. PRBool
  66. SECNAV_GenKeyFromChoice(void *proto_win, LO_Element *form,
  67.             char *choiceString, char *challenge,
  68.             char *typeString, char *pqgString,
  69.             char **pValue, PRBool *pDone);
  70.  
  71. char **
  72. SECNAV_GetKeyChoiceList(char *type, char *pqgString);
  73.  
  74. PRBool
  75. SECNAV_SecurityDialog(MWContext *context, int state);
  76.  
  77. void
  78. NET_InitCertLdapProtocol(void);
  79. const char *
  80.  
  81. SECNAV_GetPolicyNameString(void);
  82.  
  83. int
  84. SECNAV_InitConfigObject(void);
  85.  
  86. int
  87. SECNAV_RunInitialSecConfig(void);
  88.  
  89. void
  90. SECNAV_EarlyInit(void);
  91.  
  92. void
  93. SECNAV_Init(void);
  94.  
  95. void
  96. SECNAV_Shutdown(void);
  97.  
  98. void
  99. SECNAV_SecurityAdvisor(void *proto_win, URL_Struct *url);
  100.  
  101. char *
  102. SECNAV_MakeCertButtonString(CERTCertificate *cert);
  103.  
  104. int
  105. SECNAV_SecURLData(char *which, NET_StreamClass *stream, MWContext *cx);
  106.  
  107. char *
  108. SECNAV_SecURLContentType(char *which);
  109.  
  110. int
  111. SECNAV_SecHandleSecurityAdvisorURL(MWContext *cx, const char *which);
  112.  
  113. void
  114. SECNAV_HandleInternalSecURL(URL_Struct *url, MWContext *cx);
  115.  
  116. SECStatus
  117. SECNAV_ComputeFortezzaProxyChallengeResponse(MWContext *context,
  118.                          char *asciiChallenge,
  119.                          char **signature_out,
  120.                          char **clientRan_out,
  121.                          char **certChain_out);
  122. DIGESTS *PR_CALLBACK
  123. SOB_calculate_digest(void XP_HUGE *data, long length);
  124.  
  125. int PR_CALLBACK
  126. SOB_verify_digest(ZIG *siglist, const char *name, DIGESTS *dig);
  127.  
  128. void PR_CALLBACK
  129. SOB_destroy (ZIG *zig);
  130.  
  131. char *
  132. SOB_get_error (int status);
  133.  
  134. ZIG_Context *
  135. SOB_find(ZIG *zig, char *pattern, int type);
  136.  
  137. int
  138. SOB_find_next(ZIG_Context *ctx, SOBITEM **it);
  139.  
  140. void
  141. SOB_find_end(ZIG_Context *ctx);
  142.  
  143. char *
  144. SOB_get_url (ZIG *zig);
  145.  
  146. ZIG *
  147. SOB_new (void);
  148.  
  149. int
  150. SOB_set_callback (int type, ZIG *zig,
  151.           int (*fn) (int status, ZIG *zig, 
  152.                  const char *metafile,
  153.                  char *pathname, char *errortext));
  154.  
  155. int PR_CALLBACK
  156. SOB_cert_attribute(int attrib, ZIG *zig, long keylen, void *key, 
  157.            void **result, unsigned long *length);
  158.  
  159. int PR_CALLBACK
  160. SOB_stash_cert(ZIG *zig, long keylen, void *key);
  161.  
  162. int SOB_parse_manifest(char XP_HUGE *raw_manifest, long length, 
  163.                const char *path, const char *url, ZIG *zig);
  164.  
  165. void
  166. SECNAV_signedAppletPrivileges(void *proto_win, char *javaPrin, 
  167.                   char *javaTarget, char *risk, int isCert);
  168.  
  169. char *
  170. SOB_JAR_list_certs (void);
  171.  
  172. int
  173. SOB_JAR_validate_archive (char *filename);
  174.  
  175. void *
  176. SOB_JAR_new_hash (int alg);
  177.  
  178. void *
  179. SOB_JAR_hash (int alg, void *cookie, int length, void *data);
  180.  
  181. void *
  182. SOB_JAR_end_hash (int alg, void *cookie);
  183.  
  184. int
  185. SOB_JAR_sign_archive (char *nickname, char *password, char *sf, char *outsig);
  186.  
  187. int
  188. SOB_set_context (ZIG *zig, MWContext *mw);
  189.  
  190. int
  191. SOB_pass_archive(int format, char *filename, const char *url, ZIG *zig);
  192.  
  193. int
  194. SOB_get_metainfo(ZIG *zig, char *name, char *header, void **info,
  195.          unsigned long *length);
  196.  
  197. int
  198. SOB_verified_extract(ZIG *zig, char *path, char *outpath);
  199.  
  200. NET_StreamClass *
  201. SECNAV_MakePreencryptedWriteStream(FO_Present_Types format_out, void *data,
  202.                    URL_Struct *url, MWContext *window_id);
  203.  
  204. SEC_END_PROTOS
  205.  
  206. #endif /* _SECSTUBN_H_ */
  207.