projects
/
org.ibex.crypto.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
60a2432
)
unbreak broken fix
author
brian
<brian@brianweb.net>
Thu, 1 May 2008 17:10:42 +0000
(17:10 +0000)
committer
brian
<brian@brianweb.net>
Thu, 1 May 2008 17:10:42 +0000
(17:10 +0000)
darcs-hash:
20080501171042
-24bed-
011b2157a160c5cae07455c4ba55e0084ddb75c2
.gz
src/org/ibex/net/SSL.java
patch
|
blob
|
history
diff --git
a/src/org/ibex/net/SSL.java
b/src/org/ibex/net/SSL.java
index
dc1c201
..
74c4105
100644
(file)
--- a/
src/org/ibex/net/SSL.java
+++ b/
src/org/ibex/net/SSL.java
@@
-327,12
+327,13
@@
public class SSL extends Socket {
if(buf[0] != 11) throw new Exn("expected a Certificate message");
if((((buf[4]&0xff)<<16)|((buf[5]&0xff)<<8)|((buf[6]&0xff)<<0)) != buf.length-7) throw new Exn("size mismatch in Certificate message");
int p;
if(buf[0] != 11) throw new Exn("expected a Certificate message");
if((((buf[4]&0xff)<<16)|((buf[5]&0xff)<<8)|((buf[6]&0xff)<<0)) != buf.length-7) throw new Exn("size mismatch in Certificate message");
int p;
- int count;
+ int len,count;
p = 7;
count = 0;
p = 7;
count = 0;
- while(p < buf.length - 3) {
- p += 3 + ((buf[p+0]&0xff)<<16)|((buf[p+1]&0xff)<<8)|((buf[p+2]&0xff)<<0);
+ while(p < buf.length - 2) {
+ len = ((buf[p+0]&0xff)<<16)|((buf[p+1]&0xff)<<8)|((buf[p+2]&0xff)<<0);
+ p += 3 + len;
count++;
}
if(count == 0) throw new Exn("server didn't provide any certificates");
count++;
}
if(count == 0) throw new Exn("server didn't provide any certificates");
@@
-340,7
+341,7
@@
public class SSL extends Socket {
p = 7;
count = 0;
while(p < buf.length) {
p = 7;
count = 0;
while(p < buf.length) {
- int len = ((buf[p+0]&0xff)<<16)|((buf[p+1]&0xff)<<8)|((buf[p+2]&0xff)<<0);
+ len = ((buf[p+0]&0xff)<<16)|((buf[p+1]&0xff)<<8)|((buf[p+2]&0xff)<<0);
p += 3;
if(p + len > buf.length) throw new Exn("Certificate message cut short");
certs[count++] = new X509.Certificate(new ByteArrayInputStream(buf,p,len));
p += 3;
if(p + len > buf.length) throw new Exn("Certificate message cut short");
certs[count++] = new X509.Certificate(new ByteArrayInputStream(buf,p,len));