home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / security / freenav / navstubs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  10.6 KB  |  627 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. #include "secnav.h"
  18. #include "libmocha.h"
  19. #include "prlink.h"
  20. #include "prinrval.h"
  21.  
  22. int
  23. SSL_SetSockPeerID(PRFileDesc *fd, char *peerID)
  24. {
  25.     return(0);
  26. }
  27.  
  28. int
  29. SSL_SecurityStatus(PRFileDesc *fd, int *on, char **cipher,
  30.            int *keySize, int *secretKeySize,
  31.            char **issuer, char **subject)
  32. {
  33.     return(0);
  34. }
  35.  
  36. CERTCertificate *
  37. SSL_PeerCertificate(PRFileDesc *fd)
  38. {
  39.     return(NULL);
  40. }
  41.  
  42. void
  43. SECNAV_Posting(PRFileDesc *fd)
  44. {
  45.     return;
  46. }
  47.  
  48. void
  49. SECNAV_HTTPHead(PRFileDesc *fd)
  50. {
  51.     return;
  52. }
  53.  
  54. void
  55. SECNAV_RegisterNetlibMimeConverters()
  56. {
  57.     return;
  58. }
  59.  
  60. char *
  61. SECNAV_MungeString(const char *unmunged_string)
  62. {
  63.     return(NULL);
  64. }
  65.  
  66. char *
  67. SECNAV_UnMungeString(const char *munged_string)
  68. {
  69.     return(NULL);
  70. }
  71.  
  72. PRBool
  73. SECNAV_GenKeyFromChoice(void *proto_win, LO_Element *form,
  74.             char *choiceString, char *challenge,
  75.             char *typeString, char *pqgString,
  76.             char **pValue, PRBool *pDone)
  77. {
  78.     return(PR_FALSE);
  79. }
  80.  
  81.  
  82. char **
  83. SECNAV_GetKeyChoiceList(char *type, char *pqgString)
  84. {
  85.     return(NULL);
  86. }
  87.  
  88. PRBool
  89. SECNAV_SecurityDialog(MWContext *context, int state)
  90. {
  91.     return (state == SD_INSECURE_POST_FROM_INSECURE_DOC);
  92. }
  93.  
  94. JSObject *
  95. lm_DefinePkcs11(MochaDecoder *decoder)
  96. {
  97.     return((JSObject *)1);
  98. }
  99.  
  100. JSObject *
  101. lm_DefineCrypto(MochaDecoder *decoder)
  102. {
  103.     return((JSObject *)1);
  104. }
  105.  
  106. void
  107. NET_InitCertLdapProtocol(void)
  108. {
  109. }
  110.  
  111.  
  112. CERTCertificate *
  113. CERT_DupCertificate(CERTCertificate *cert)
  114. {
  115.     return(NULL);
  116. }
  117.  
  118. void
  119. CERT_DestroyCertificate(CERTCertificate *cert)
  120. {
  121.     return;
  122. }
  123.  
  124. CERTCertificate *
  125. CERT_NewTempCertificate (CERTCertDBHandle *handle, SECItem *derCert,
  126.              char *nickname, PRBool isperm, PRBool copyDER)
  127. {
  128.     return(NULL);
  129. }
  130.  
  131. CERTCertDBHandle *
  132. CERT_GetDefaultCertDB(void)
  133. {
  134.     return(NULL);
  135. }
  136.  
  137. CERTCertificate *
  138. CERT_DecodeCertFromPackage(char *certbuf, int certlen)
  139. {
  140.     return(NULL);
  141. }
  142.  
  143. char *
  144. CERT_HTMLCertInfo(CERTCertificate *cert, PRBool showImages, PRBool showIssuer)
  145. {
  146.     return(NULL);
  147. }
  148.  
  149. PRBool
  150. CERT_CompareCertsForRedirection(CERTCertificate *c1, CERTCertificate *c2)
  151. {
  152.     return(PR_FALSE);
  153. }
  154.  
  155. const char *
  156. SECNAV_GetPolicyNameString(void)
  157. {
  158.     return(NULL);
  159. }
  160.  
  161. int
  162. SECNAV_InitConfigObject(void)
  163. {
  164.     return(0);
  165. }
  166.  
  167. int
  168. SECNAV_RunInitialSecConfig(void)
  169. {
  170.     return(0);
  171. }
  172.  
  173. void
  174. SECNAV_EarlyInit(void)
  175. {
  176.     return;
  177. }
  178.  
  179. void
  180. SECNAV_Init(void)
  181. {
  182.     return;
  183. }
  184.  
  185. void
  186. SECNAV_Shutdown(void)
  187. {
  188.     return;
  189. }
  190.  
  191. void
  192. SECNAV_SecurityAdvisor(void *proto_win, URL_Struct *url)
  193. {
  194.     return;
  195. }
  196.  
  197. char *
  198. SECNAV_MakeCertButtonString(CERTCertificate *cert)
  199. {
  200.     return(NULL);
  201. }
  202.  
  203. int
  204. SECNAV_SecURLData(char *which, NET_StreamClass *stream, MWContext *cx)
  205. {
  206.     return(-1);
  207. }
  208.  
  209. char *
  210. SECNAV_SecURLContentType(char *which)
  211. {
  212.     return(NULL);
  213. }
  214.  
  215. int
  216. SECNAV_SecHandleSecurityAdvisorURL(MWContext *cx, const char *which)
  217. {
  218.     return(-1);
  219. }
  220.  
  221. void
  222. SECNAV_HandleInternalSecURL(URL_Struct *url, MWContext *cx)
  223. {
  224.     return;
  225. }
  226.  
  227. unsigned long
  228. SSL_SecurityCapabilities(void)
  229. {
  230.     return(0);
  231. }
  232.  
  233. PRBool
  234. SSL_IsDomestic(void)
  235. {
  236.     return(PR_FALSE);
  237. }
  238.  
  239. SECStatus
  240. SECNAV_ComputeFortezzaProxyChallengeResponse(MWContext *context,
  241.                          char *asciiChallenge,
  242.                          char **signature_out,
  243.                          char **clientRan_out,
  244.                          char **certChain_out)
  245. {
  246.     return(SECFailure);
  247. }
  248.  
  249. SECStatus
  250. RNG_RNGInit(void)
  251. {
  252.     return(SECSuccess);
  253. }
  254.  
  255. /*
  256.  * probably need to provide something here
  257.  */
  258. SECStatus
  259. RNG_GenerateGlobalRandomBytes(void *dest, size_t len)
  260. {
  261.     /* This is a temporary implementation to avoid */
  262.     /* the cache filename horkage. This needs to have a more */
  263.     /* secure/free implementation here - Gagan */
  264.  
  265.     char* output=dest;
  266.     size_t i;
  267.     srand((unsigned int) PR_IntervalToMilliseconds(PR_IntervalNow()));
  268.     for (i=0;i<len; i++)
  269.     {
  270.         int t = rand();
  271.         *output = (char) (t % 256);
  272.         output++;
  273.     }
  274.     return(SECSuccess);
  275. }
  276.  
  277. /*
  278. ** Get the "noisiest" information available on the system.
  279. */
  280. size_t
  281. RNG_GetNoise(void *buf, size_t maxbytes)
  282. {
  283.     return(0);
  284. }
  285.  
  286. /*
  287. ** RNG_SystemInfoForRNG should be called before any use of SSL. It
  288. ** gathers up the system specific information to help seed the
  289. ** state of the global random number generator.
  290. */
  291. void
  292. RNG_SystemInfoForRNG(void)
  293. {
  294.     return;
  295. }
  296.  
  297. /* 
  298. ** Use the contents (and stat) of a file to help seed the
  299. ** global random number generator.
  300. */
  301. void RNG_FileForRNG(char *filename)
  302. {
  303.     return;
  304. }
  305.  
  306. /*
  307. ** Update the global random number generator with more seeding
  308. ** material
  309. */
  310. SECStatus
  311. RNG_RandomUpdate(void *data, size_t bytes)
  312. {
  313.     return(SECFailure);
  314. }
  315.  
  316. PRStaticLinkTable jsl_nodl_tab[1];
  317.  
  318. void
  319. _java_jsl_init(void)
  320. {
  321. }
  322.  
  323. DIGESTS *PR_CALLBACK
  324. SOB_calculate_digest(void XP_HUGE *data, long length)
  325. {
  326.     return(NULL);
  327. }
  328.  
  329.  
  330. int PR_CALLBACK
  331. SOB_verify_digest(ZIG *siglist, const char *name, DIGESTS *dig)
  332. {
  333.     return(-1);
  334. }
  335.  
  336. void PR_CALLBACK
  337. SOB_destroy (ZIG *zig)
  338. {
  339.     return;
  340. }
  341.  
  342. char *
  343. SOB_get_error (int status)
  344. {
  345.     return(NULL);
  346. }
  347.  
  348. ZIG_Context *
  349. SOB_find(ZIG *zig, char *pattern, int type)
  350. {
  351.     return(NULL);
  352. }
  353.  
  354. int
  355. SOB_find_next(ZIG_Context *ctx, SOBITEM **it)
  356. {
  357.     return(-1);
  358. }
  359.  
  360. void
  361. SOB_find_end(ZIG_Context *ctx)
  362. {
  363.     return;
  364. }
  365.  
  366. char *
  367. SOB_get_url (ZIG *zig)
  368. {
  369.     return(NULL);
  370. }
  371.  
  372. ZIG *
  373. SOB_new (void)
  374. {
  375.     return(NULL);
  376. }
  377.  
  378. int
  379. SOB_set_callback (int type, ZIG *zig,
  380.           int (*fn) (int status, ZIG *zig, 
  381.                  const char *metafile,
  382.                  char *pathname, char *errortext))
  383. {
  384.     return(-1);
  385. }
  386.  
  387. int PR_CALLBACK
  388. SOB_cert_attribute(int attrib, ZIG *zig, long keylen, void *key, 
  389.            void **result, unsigned long *length)
  390. {
  391.     return(-1);
  392. }
  393.  
  394. int PR_CALLBACK
  395. SOB_stash_cert(ZIG *zig, long keylen, void *key)
  396. {
  397.     return(-1);
  398. }
  399.  
  400. int SOB_parse_manifest(char XP_HUGE *raw_manifest, long length, 
  401.                const char *path, const char *url, ZIG *zig)
  402. {
  403.     return(-1);
  404. }
  405.  
  406. void
  407. SECNAV_signedAppletPrivileges(void *proto_win, char *javaPrin, 
  408.                   char *javaTarget, char *risk, int isCert)
  409. {
  410.     return;
  411. }
  412.  
  413. char *
  414. SOB_JAR_list_certs (void)
  415. {
  416.     return(NULL);
  417. }
  418.  
  419. int
  420. SOB_JAR_validate_archive (char *filename)
  421. {
  422.     return(-1);
  423. }
  424.  
  425. void *
  426. SOB_JAR_new_hash (int alg)
  427. {
  428.     return(NULL);
  429. }
  430.  
  431. void *
  432. SOB_JAR_hash (int alg, void *cookie, int length, void *data)
  433. {
  434.     return(NULL);
  435. }
  436.  
  437. void *
  438. SOB_JAR_end_hash (int alg, void *cookie)
  439. {
  440.     return(NULL);
  441. }
  442.  
  443. int
  444. SOB_JAR_sign_archive (char *nickname, char *password, char *sf, char *outsig)
  445. {
  446.     return(-1);
  447. }
  448.  
  449. int
  450. SOB_set_context (ZIG *zig, MWContext *mw)
  451. {
  452.     return(-1);
  453. }
  454.  
  455. int
  456. SOB_pass_archive(int format, char *filename, const char *url, ZIG *zig)
  457. {
  458.     return(-1);
  459. }
  460.  
  461. int
  462. SOB_get_metainfo(ZIG *zig, char *name, char *header, void **info,
  463.          unsigned long *length)
  464. {
  465.     return(-1);
  466. }
  467.  
  468. int
  469. SOB_verified_extract(ZIG *zig, char *path, char *outpath)
  470. {
  471.     return(-1);
  472. }
  473.  
  474. /*
  475. ** Hash a non-null terminated string "src" into "dest" using MD5
  476. */
  477. SECStatus
  478. MD5_HashBuf(unsigned char *dest, const unsigned char *src,
  479.         uint32 src_length)
  480. {
  481.     return(SECFailure);
  482. }
  483.  
  484.  
  485. /*
  486. ** Create a new MD5 context
  487. */
  488. MD5Context *
  489. MD5_NewContext(void)
  490. {
  491.     return(NULL);
  492. }
  493.  
  494. /*
  495. ** Destroy an MD5 secure hash context.
  496. **    "cx" the context
  497. **    "freeit" if PR_TRUE then free the object as well as its sub-objects
  498. */
  499. void
  500. MD5_DestroyContext(MD5Context *cx, PRBool freeit)
  501. {
  502.     return;
  503. }
  504.  
  505. /*
  506. ** Reset an MD5 context, preparing it for a fresh round of hashing
  507. */
  508. void
  509. MD5_Begin(MD5Context *cx)
  510. {
  511.     return;
  512. }
  513.  
  514. /*
  515. ** Update the MD5 hash function with more data.
  516. **    "cx" the context
  517. **    "input" the data to hash
  518. **    "inputLen" the amount of data to hash
  519. */
  520. void
  521. MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen)
  522. {
  523.     return;
  524. }
  525.  
  526. /*
  527. ** Finish the MD5 hash function. Produce the digested results in "digest"
  528. **    "cx" the context
  529. **    "digest" where the 16 bytes of digest data are stored
  530. **    "digestLen" where the digest length (16) is stored
  531. **    "maxDigestLen" the maximum amount of data that can ever be
  532. **       stored in "digest"
  533. */
  534. void
  535. MD5_End(MD5Context *cx, unsigned char *digest,
  536.     unsigned int *digestLen, unsigned int maxDigestLen)
  537. {
  538.     return;
  539. }
  540.  
  541. /*
  542. ** Hash a non-null terminated string "src" into "dest" using SHA-1
  543. */
  544. SECStatus
  545. SHA1_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length)
  546. {
  547.     return(SECFailure);
  548. }
  549.  
  550. /*
  551. ** Create a new SHA-1 context
  552. */
  553. SHA1Context *
  554. SHA1_NewContext(void)
  555. {
  556.     return(NULL);
  557. }
  558.  
  559. /*
  560. ** Destroy a SHA-1 secure hash context.
  561. **    "cx" the context
  562. **    "freeit" if PR_TRUE then free the object as well as its sub-objects
  563. */
  564. void
  565. SHA1_DestroyContext(SHA1Context *cx, PRBool freeit)
  566. {
  567.     return;
  568. }
  569.  
  570. /*
  571. ** Reset a SHA-1 context, preparing it for a fresh round of hashing
  572. */
  573. void
  574. SHA1_Begin(SHA1Context *cx)
  575. {
  576.     return;
  577. }
  578.  
  579. /*
  580. ** Update the SHA-1 hash function with more data.
  581. **    "cx" the context
  582. **    "input" the data to hash
  583. **    "inputLen" the amount of data to hash
  584. */
  585. void
  586. SHA1_Update(SHA1Context *cx, const unsigned char *input, unsigned int inputLen)
  587. {
  588.     return;
  589. }
  590.  
  591. /*
  592. ** Finish the SHA-1 hash function. Produce the digested results in "digest"
  593. **    "cx" the context
  594. **    "digest" where the 16 bytes of digest data are stored
  595. **    "digestLen" where the digest length (20) is stored
  596. **    "maxDigestLen" the maximum amount of data that can ever be
  597. **       stored in "digest"
  598. */
  599. void
  600. SHA1_End(SHA1Context *cx, unsigned char *digest,
  601.      unsigned int *digestLen, unsigned int maxDigestLen)
  602. {
  603.     return;
  604. }
  605.  
  606. /*
  607. ** Return a malloc'd ascii string which is the base64 encoded
  608. ** version of the input string.
  609. */
  610. char *
  611. BTOA_DataToAscii(const unsigned char *data, unsigned int len)
  612. {
  613.     return(NULL);
  614. }
  615.  
  616. /*
  617. ** Return a malloc'd string which is the base64 decoded version
  618. ** of the input string; set *lenp to the length of the returned data.
  619. */
  620. unsigned char *
  621. ATOB_AsciiToData(const char *string, unsigned int *lenp)
  622. {
  623.     return(NULL);
  624. }
  625.  
  626.  
  627.