commit 678ede7e54bf508991380c0f896fed6005b87ce9 from: rsc date: Mon Dec 27 00:14:43 2004 UTC various changes from plan 9 commit - e1dc7e4511d4644060d4904dcae50808d966fff7 commit + 678ede7e54bf508991380c0f896fed6005b87ce9 blob - 03b48adc2444255c92e55b3bbd34a845c5b28737 blob + 7f3325197e0859fe0822d915b61712fc8c5a5cef --- include/httpd.h +++ include/httpd.h @@ -235,6 +235,7 @@ ulong hdate2sec(char*); int hdatefmt(Fmt*); int hfail(HConnect*, int, ...); int hflush(Hio*); +int hlflush(Hio*); int hgetc(Hio*); int hgethead(HConnect *c, int many); int hinit(Hio*, int, int); blob - da1a1ed4c5182e254135e87e0b5596ca789846d7 blob + 36b36351ab144a50e3de43c56a061ec452b90411 --- include/ip.h +++ include/ip.h @@ -3,6 +3,7 @@ #if defined(__cplusplus) extern "C" { #endif + /* #pragma src "/sys/src/libip" #pragma lib "libip.a" @@ -106,9 +107,11 @@ long udpwrite(int, Udphdr*, void*, long); Ipifc* readipifc(char*, Ipifc*, int); +void hnputv(void*, uvlong); void hnputl(void*, uint); void hnputs(void*, ushort); uint nhgetl(void*); +uvlong nhgetv(void*); ushort nhgets(void*); ushort ptclbsum(uchar*, int); blob - ff6fd4bcc3cba49881902d9d88332b9eec3f68a3 blob + d91d8906327c9c5165b63370b616ebe4d2b0258b --- include/libc.h +++ include/libc.h @@ -715,8 +715,8 @@ extern int unmount(char*, char*); */ extern int noted(int); extern int notify(void(*)(void*, char*)); -extern void notifyenable(char*); -extern void notifydisable(char*); +extern void noteenable(char*); +extern void notedisable(char*); extern void notifyon(char*); extern void notifyoff(char*); extern int p9open(char*, int); blob - e65b7f976d05d317a06b155e6f56f38078bf9732 blob + e598a7809fb2913ba505dad5e0cd7ecc3aa6a840 --- include/libsec.h +++ include/libsec.h @@ -199,6 +199,7 @@ void rc4back(RC4state*, int); ///////////////////////////////////////////////////////// typedef struct RSApub RSApub; typedef struct RSApriv RSApriv; +typedef struct PEMChain PEMChain; // public/encryption key struct RSApub @@ -222,6 +223,13 @@ struct RSApriv mpint *c2; // (inv p) mod q }; +struct PEMChain +{ + PEMChain *next; + uchar *pem; + int pemlen; +}; + RSApriv* rsagen(int nlen, int elen, int rounds); mpint* rsaencrypt(RSApub *k, mpint *in, mpint *out); mpint* rsadecrypt(RSApriv *k, mpint *in, mpint *out); @@ -232,7 +240,8 @@ void rsaprivfree(RSApriv*); RSApub* rsaprivtopub(RSApriv*); RSApub* X509toRSApub(uchar*, int, char*, int); RSApriv* asn1toRSApriv(uchar*, int); -uchar* decodepem(char *s, char *type, int *len); +uchar* decodepem(char *s, char *type, int *len, char**); +PEMChain* decodepemchain(char *s, char *type); uchar* X509gen(RSApriv *priv, char *subj, ulong valid[2], int *certlen); ///////////////////////////////////////////////////////// @@ -330,6 +339,7 @@ typedef struct TLSconn{ uchar *sessionID; int certlen, sessionIDlen; int (*trace)(char*fmt, ...); + PEMChain *chain; } TLSconn; // tlshand.c @@ -343,6 +353,7 @@ extern int okThumbprint(uchar *sha1, Thumbprint *ok); // readcert.c extern uchar *readcert(char *filename, int *pcertlen); +PEMChain *readcertchain(char *filename); #if defined(__cplusplus) } blob - 8dbabe61dc01478a834c9e1467c7d57c44521cea blob + c8f00340036e5d4452773dfd30aed80b45ad01ca --- include/thread.h +++ include/thread.h @@ -13,11 +13,13 @@ void threadexits(char *); void threadexitsall(char *); void threadsetname(char*, ...); void threadsetstate(char*, ...); +void threadyield(void); void _threadready(_Thread*); void _threadswitch(void); void _threadsetsysproc(void); void _threadsleep(Rendez*); _Thread *_threadwakeup(Rendez*); +#define yield threadyield /* * per proc and thread data