M ip/esp.c => ip/esp.c +15 -14
@@ 7,7 7,8 @@
#include "ip.h"
-#include "libcrypt.h"
+#include "mp.h"
+#include "libsec.h"
typedef struct Esphdr Esphdr;
typedef struct Esptail Esptail;
@@ 132,8 133,8 @@ static Algorithm espalg[] =
static Algorithm ahalg[] =
{
"null", 0, nullahinit,
- "hmac_sha_96", 128, shaahinit,
- "hmac_md5_96", 128, md5ahinit,
+ "seanq_hmac_sha1_96", 128, shaahinit,
+ "seanq_hmac_md5_96", 128, md5ahinit,
nil, 0, nil,
};
@@ 593,12 594,12 @@ nullahinit(Espcb *ecb, char *name, uchar*, int)
}
void
-hmac_sha(uchar hash[SHAdlen], uchar *t, long tlen, uchar *key, long klen)
+seanq_hmac_sha1(uchar hash[SHA1dlen], uchar *t, long tlen, uchar *key, long klen)
{
uchar ipad[65], opad[65];
int i;
DigestState *digest;
- uchar innerhash[SHAdlen];
+ uchar innerhash[SHA1dlen];
for(i=0; i<64; i++){
ipad[i] = 0x36;
@@ 609,20 610,20 @@ hmac_sha(uchar hash[SHAdlen], uchar *t, long tlen, uchar *key, long klen)
ipad[i] ^= key[i];
opad[i] ^= key[i];
}
- digest = sha(ipad, 64, nil, nil);
- sha(t, tlen, innerhash, digest);
- digest = sha(opad, 64, nil, nil);
- sha(innerhash, SHAdlen, hash, digest);
+ digest = sha1(ipad, 64, nil, nil);
+ sha1(t, tlen, innerhash, digest);
+ digest = sha1(opad, 64, nil, nil);
+ sha1(innerhash, SHA1dlen, hash, digest);
}
static int
shaauth(Espcb *ecb, uchar *t, int tlen, uchar *auth)
{
- uchar hash[SHAdlen];
+ uchar hash[SHA1dlen];
int r;
- memset(hash, 0, SHAdlen);
- hmac_sha(hash, t, tlen, (uchar*)ecb->ahstate, 16);
+ memset(hash, 0, SHA1dlen);
+ seanq_hmac_sha1(hash, t, tlen, (uchar*)ecb->ahstate, 16);
r = memcmp(auth, hash, ecb->ahlen) == 0;
memmove(auth, hash, ecb->ahlen);
return r;
@@ 644,7 645,7 @@ shaahinit(Espcb *ecb, char *name, uchar *key, int klen)
}
void
-hmac_md5(uchar hash[MD5dlen], uchar *t, long tlen, uchar *key, long klen)
+seanq_hmac_md5(uchar hash[MD5dlen], uchar *t, long tlen, uchar *key, long klen)
{
uchar ipad[65], opad[65];
int i;
@@ 673,7 674,7 @@ md5auth(Espcb *ecb, uchar *t, int tlen, uchar *auth)
int r;
memset(hash, 0, MD5dlen);
- hmac_md5(hash, t, tlen, (uchar*)ecb->ahstate, 16);
+ seanq_hmac_md5(hash, t, tlen, (uchar*)ecb->ahstate, 16);
r = memcmp(auth, hash, ecb->ahlen) == 0;
memmove(auth, hash, ecb->ahlen);
return r;
M pc/vgat2r4.c => pc/vgat2r4.c +18 -9
@@ 47,7 47,7 @@ enum { /* index registers */
CursorMode32x32 = 0x23,
CursorMode64x64 = 0x27,
- CursorMode = CursorMode64x64,
+ CursorMode = CursorMode32x32,
};
static ulong
@@ 186,7 186,7 @@ static void
t2r4curload(VGAscr* scr, Cursor* curs)
{
uchar *data;
- int x, y, zoom;
+ int size, x, y, zoom;
ulong clr, *mmio, pixels, set;
mmio = scr->mmio;
@@ 249,17 249,25 @@ t2r4curload(VGAscr* scr, Cursor* curs)
*data = 0x00;
*data = 0x00;
*data = 0x00;
- *data = 0x00;
- *data = 0x00;
- *data = 0x00;
- *data = 0x00;
+
+ if(CursorMode == CursorMode32x32 && zoom == 16)
+ continue;
+ *data = pixels>>24;
+ *data = pixels>>16;
+ *data = pixels>>8;
+ *data = pixels;
+
*data = 0x00;
*data = 0x00;
*data = 0x00;
*data = 0x00;
}
- while(y < 64){
- for(x = 0; x < 64/8; x++){
+ if(CursorMode == CursorMode32x32)
+ size = 32;
+ else
+ size = 64;
+ while(y < size){
+ for(x = 0; x < size/8; x++){
*data = 0x00;
*data = 0x00;
}
@@ 271,7 279,8 @@ t2r4curload(VGAscr* scr, Cursor* curs)
* Initialise the hotpoint and enable the cursor.
*/
t2r4xo(scr, CursorHotX, -curs->offset.x);
- t2r4xo(scr, CursorHotY, -curs->offset.y);
+ zoom = (scr->mmio[Zoom] & 0x0F)+1;
+ t2r4xo(scr, CursorHotY, -curs->offset.y*zoom);
t2r4xo(scr, CursorCtl, CursorMode);
}
M port/devsdp.c => port/devsdp.c +9 -9
@@ 6,7 6,7 @@
#include "../port/netif.h"
#include "../port/error.h"
-#include <libcrypt.h>
+#include <libsec.h>
#include "../port/thwack.h"
/*
@@ 328,8 328,8 @@ static Algorithm cipheralg[] =
static Algorithm authalg[] =
{
"null", 0, nullauthinit,
- "hmac_sha_96", 16, shaauthinit,
- "hmac_md5_96", 16, md5authinit,
+ "seanq_hmac_sha1_96", 16, shaauthinit,
+ "seanq_hmac_md5_96", 16, md5authinit,
nil, 0, nil,
};
@@ 993,7 993,7 @@ print("convsetstate %s -> %s\n", convstatename[c->state], convstatename[state]);
hnputl(c->out.secret, c->acceptid);
hnputl(c->out.secret+4, c->dialid);
}
- setalg(c, "hmac_md5_96", authalg, &c->auth);
+ setalg(c, "seanq_hmac_md5_96", authalg, &c->auth);
break;
case CLocalClose:
assert(c->state == CAccept || c->state == COpen);
@@ 1879,14 1879,14 @@ setsecret(OneWay *ow, char *secret)
static void
setkey(uchar *key, int n, OneWay *ow, char *prefix)
{
- uchar ibuf[SHAdlen], obuf[MD5dlen], salt[10];
+ uchar ibuf[SHA1dlen], obuf[MD5dlen], salt[10];
int i, round = 0;
while(n > 0){
for(i=0; i<round+1; i++)
salt[i] = 'A'+round;
- sha((uchar*)prefix, strlen(prefix), ibuf, sha(salt, round+1, nil, nil));
- md5(ibuf, SHAdlen, obuf, md5(ow->secret, sizeof(ow->secret), nil, nil));
+ sha1((uchar*)prefix, strlen(prefix), ibuf, sha1(salt, round+1, nil, nil));
+ md5(ibuf, SHA1dlen, obuf, md5(ow->secret, sizeof(ow->secret), nil, nil));
i = (n<MD5dlen) ? n : MD5dlen;
memmove(key, obuf, i);
key += i;
@@ 2156,7 2156,7 @@ shaauthinit(Conv *c)
}
static void
-hmac_md5(uchar hash[MD5dlen], ulong wrap, uchar *t, long tlen, uchar *key, long klen)
+seanq_hmac_md5(uchar hash[MD5dlen], ulong wrap, uchar *t, long tlen, uchar *key, long klen)
{
uchar ipad[65], opad[65], wbuf[4];
int i;
@@ 2191,7 2191,7 @@ md5auth(OneWay *ow, uchar *t, int tlen)
tlen -= ow->authlen;
memset(hash, 0, MD5dlen);
- hmac_md5(hash, ow->seqwrap, t, tlen, (uchar*)ow->authstate, 16);
+ seanq_hmac_md5(hash, ow->seqwrap, t, tlen, (uchar*)ow->authstate, 16);
r = memcmp(t+tlen, hash, ow->authlen) == 0;
memmove(t+tlen, hash, ow->authlen);
return r;
M port/devssl.c => port/devssl.c +3 -32
@@ 8,7 8,8 @@
#include "fns.h"
#include "../port/error.h"
-#include <libcrypt.h>
+#include <mp.h>
+#include <libsec.h>
#define NOSPOOKS 1
@@ 839,7 840,7 @@ Hashalg hashtab[] =
{
{ "md4", MD4dlen, md4, },
{ "md5", MD5dlen, md5, },
- { "sha", SHAdlen, sha, },
+ { "sha1", SHA1dlen, sha1, },
{ 0 }
};
@@ 1321,36 1322,6 @@ sslhangup(Dstate *s)
qunlock(&s->in.q);
}
-/*
- * crypt's interface to system, included here to override the
- * library version
- */
-void
-handle_exception(int type, char *exception)
-{
- if(type == CRITICAL)
- panic("crypt library: %s: %r", exception);
- else
- print("crypt library: %s: %r\n", exception);
-}
-
-extern void rbcheck(char*);
-
-void*
-crypt_malloc(int size)
-{
- return smalloc(size);
-}
-
-void
-crypt_free(void *x)
-{
- if(x == 0)
- return;
- free(x);
-}
-
-
static Dstate*
dsclone(Chan *ch)
{